Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
c01c25fc
Unverified
Commit
c01c25fc
authored
Nov 25, 2013
by
Stéphane Graber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tab/spaces consistency for templates
Signed-off-by:
Stéphane Graber
<
stgraber@ubuntu.com
>
parent
f7f1ba77
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
38 deletions
+43
-38
lxc-alpine.in
templates/lxc-alpine.in
+12
-7
lxc-openmandriva.in
templates/lxc-openmandriva.in
+4
-4
lxc-opensuse.in
templates/lxc-opensuse.in
+22
-22
lxc-oracle.in
templates/lxc-oracle.in
+1
-1
lxc-sshd.in
templates/lxc-sshd.in
+1
-1
lxc-ubuntu-cloud.in
templates/lxc-ubuntu-cloud.in
+3
-3
No files found.
templates/lxc-alpine.in
View file @
c01c25fc
...
...
@@ -300,7 +300,7 @@ while [ $# -gt 0 ]; do
optarg_check
$opt
"
$1
"
arch
=
$1
shift
;;
;;
--
)
break
;;
--
*
=
*
)
...
...
@@ -335,12 +335,17 @@ lxc_arch=$arch
apk_arch
=
$arch
case
"
$arch
"
in
i[3-6]86
)
apk_arch
=
x86
;;
x86
)
lxc_arch
=
i686
;;
x86_64|
""
)
;;
*
)
die
"unsupported architecture:
$arch
"
;;
i[3-6]86
)
apk_arch
=
x86
;;
x86
)
lxc_arch
=
i686
;;
x86_64|
""
)
;;
*
)
die
"unsupported architecture:
$arch
"
;;
esac
:
${
APK
:
=apk
}
...
...
templates/lxc-openmandriva.in
View file @
c01c25fc
...
...
@@ -181,7 +181,7 @@ install_openmandriva()
echo
"Checking cache download in
$cache
/rootfs ... "
if
[
!
-e
"
$cache
/rootfs"
]
;
then
echo
$cache
/rootfs
echo
$cache
/rootfs
create_chroot_openmandriva
if
[
$?
-ne
0
]
;
then
echo
"Failed to download 'openmandriva basesystem-minimal'"
...
...
@@ -349,9 +349,9 @@ if [ -f /etc/lsb-release ]; then
if
[
"
$DISTRIB_ID
"
=
"OpenMandrivaLinux"
]
;
then
release
=
openmandriva2013.0
elif
[
"
$DISTRIB_ID
"
=
"RosaDesktop.Fresh"
]
;
then
release
=
rosa2012.1
release
=
rosa2012.1
else
echo
"This is not an OpenMandriva or ROSA release"
echo
"This is not an OpenMandriva or ROSA release"
exit
1
fi
fi
...
...
@@ -366,7 +366,7 @@ do
-P
|
--profile
)
profile
=
$2
;
shift
2
;;
-c
|
--clean
)
clean
=
$2
;
shift
2
;;
-R
|
--release
)
release
=
$2
;
shift
2
;;
-a
|
--arch
)
arch
=
$2
;
shift
2
;;
-a
|
--arch
)
arch
=
$2
;
shift
2
;;
-4
|
--ipv4
)
ipv4
=
$2
;
shift
2
;;
-6
|
--ipv6
)
ipv6
=
$2
;
shift
2
;;
-g
|
--gw
)
gw
=
$2
;
shift
2
;;
...
...
templates/lxc-opensuse.in
View file @
c01c25fc
...
...
@@ -246,29 +246,29 @@ copy_configuration()
name
=
$3
if
grep
-q
"^lxc.network.type"
$path
/config
;
then
TYPE
=
$(
sed
'/^#/d; /lxc.network.type/!d; s/.*=[ \t]*//'
$path
/config
)
grep
-q
"^lxc.network.ipv4"
$path
/config
IPV4_NOT_CONFIGURED
=
$?
if
[
!
grep
-q
"^lxc.network.*.gateway"
$path
/config
]
;
then
[
$IPV4_NOT_CONFIGURED
-eq
0
]
&&
IPV4
=
$(
sed
'/^#/d; /lxc.network.ipv4/!d; /gateway/d; s/.*=[ \t]*//; s/\([[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+\).*/\1/'
$path
/config
)
if
[
"
$TYPE
"
=
"veth"
-o
"
$TYPE
"
=
"macvlan"
]
;
then
if
[
$IPV4_NOT_CONFIGURED
-eq
0
-a
"
$IPV4
"
!=
"0.0.0.0"
]
;
then
# set default route
IP
=
$(
/sbin/ip route |
awk
'/default/ { print $3 }'
)
echo
"lxc.network.ipv4.gateway =
$IP
"
>>
$path
/config
else
# set network as dhcp
sed
-i
-e
's/BOOTPROTO=.*/BOOTPROTO=dhcp/'
$rootfs
/etc/sysconfig/network/ifcfg-eth0
fi
fi
fi
if
[
"
$TYPE
"
!=
"empty"
]
;
then
echo
"#remove next line if host DNS configuration should not be available to container"
>>
$path
/config
echo
"lxc.mount.entry = /etc/resolv.conf etc/resolv.conf none bind,ro 0 0"
>>
$path
/config
fi
TYPE
=
$(
sed
'/^#/d; /lxc.network.type/!d; s/.*=[ \t]*//'
$path
/config
)
grep
-q
"^lxc.network.ipv4"
$path
/config
IPV4_NOT_CONFIGURED
=
$?
if
[
!
grep
-q
"^lxc.network.*.gateway"
$path
/config
]
;
then
[
$IPV4_NOT_CONFIGURED
-eq
0
]
&&
IPV4
=
$(
sed
'/^#/d; /lxc.network.ipv4/!d; /gateway/d; s/.*=[ \t]*//; s/\([[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+\).*/\1/'
$path
/config
)
if
[
"
$TYPE
"
=
"veth"
-o
"
$TYPE
"
=
"macvlan"
]
;
then
if
[
$IPV4_NOT_CONFIGURED
-eq
0
-a
"
$IPV4
"
!=
"0.0.0.0"
]
;
then
# set default route
IP
=
$(
/sbin/ip route |
awk
'/default/ { print $3 }'
)
echo
"lxc.network.ipv4.gateway =
$IP
"
>>
$path
/config
else
# set network as dhcp
sed
-i
-e
's/BOOTPROTO=.*/BOOTPROTO=dhcp/'
$rootfs
/etc/sysconfig/network/ifcfg-eth0
fi
fi
fi
if
[
"
$TYPE
"
!=
"empty"
]
;
then
echo
"#remove next line if host DNS configuration should not be available to container"
>>
$path
/config
echo
"lxc.mount.entry = /etc/resolv.conf etc/resolv.conf none bind,ro 0 0"
>>
$path
/config
fi
else
echo
'lxc.network.type = empty'
>>
$path
/config
echo
'lxc.network.type = empty'
>>
$path
/config
fi
grep
-q
"^lxc.rootfs"
$path
/config 2>/dev/null
||
echo
"lxc.rootfs =
$rootfs
"
>>
$path
/config
...
...
templates/lxc-oracle.in
View file @
c01c25fc
...
...
@@ -67,7 +67,7 @@ container_rootfs_configure()
if
[
-e
$container_rootfs
/etc/selinux/config
]
;
then
sed
-i
's|SELINUX=enforcing|SELINUX=disabled|'
$container_rootfs
/etc/selinux/config
else
mkdir
-p
$container_rootfs
/etc/selinux
mkdir
-p
$container_rootfs
/etc/selinux
echo
"SELINUX=disabled"
>
$container_rootfs
/etc/selinux/config
fi
sed
-i
's|session[ \t]*required[ \t]*pam_selinux.so[ \t]*close|#session required pam_selinux.so close|'
$container_rootfs
/etc/pam.d/login
...
...
templates/lxc-sshd.in
View file @
c01c25fc
...
...
@@ -220,7 +220,7 @@ send host-name "<hostname>";
EOF
ifconfig eth0 up
dhclient eth0
-cf
/dhclient.conf
echo
"Container IP address:"
echo
"Container IP address:"
ifconfig eth0 |grep inet
fi
...
...
templates/lxc-ubuntu-cloud.in
View file @
c01c25fc
...
...
@@ -404,9 +404,9 @@ copy_configuration $path $rootfs $name $arch $release
"
$CLONE_HOOK_FN
"
"
${
cloneargs
[@]
}
"
"
$rootfs
"
if
[
$mapped_uid
-ne
-1
]
;
then
chown
$mapped_uid
$path
/config
chown
-R
$mapped_uid
$STATE_DIR
chown
-R
$mapped_uid
$cache
chown
$mapped_uid
$path
/config
chown
-R
$mapped_uid
$STATE_DIR
chown
-R
$mapped_uid
$cache
fi
echo
"Container
$name
created."
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment