Commit ba4c4259 by Frederic Crozat Committed by Serge Hallyn

various fixes for openSUSE template for lxc-clone usage

- create /etc/hostname as symlink to /etc/HOSTNAME - fix inadequate space in lxc.mount config, preventing lxc-clone to work Jiri Slaby: some cleanups Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
parent 336d5469
...@@ -34,8 +34,8 @@ configure_opensuse() ...@@ -34,8 +34,8 @@ configure_opensuse()
# set network as static, but everything is done by LXC outside the container # set network as static, but everything is done by LXC outside the container
cat <<EOF > $rootfs/etc/sysconfig/network/ifcfg-eth0 cat <<EOF > $rootfs/etc/sysconfig/network/ifcfg-eth0
STARTMODE='auto' STARTMODE='manual'
BOOTPROTO='static' BOOTPROTO='none'
EOF EOF
# set default route # set default route
...@@ -71,6 +71,8 @@ EOF ...@@ -71,6 +71,8 @@ EOF
cat <<EOF > $rootfs/etc/HOSTNAME cat <<EOF > $rootfs/etc/HOSTNAME
$hostname $hostname
EOF EOF
# ensure /etc/hostname is available too
ln -s -f HOSTNAME $rootfs/etc/hostname
# do not use hostname from HOSTNAME variable # do not use hostname from HOSTNAME variable
cat <<EOF >> $rootfs/etc/sysconfig/cron cat <<EOF >> $rootfs/etc/sysconfig/cron
...@@ -253,6 +255,9 @@ copy_configuration() ...@@ -253,6 +255,9 @@ copy_configuration()
rootfs=$2 rootfs=$2
name=$3 name=$3
# only disable network if no network configuration was passed
grep -q "^lxc.network.type" $path/config || echo 'lxc.network.type = empty' >> $path/config
grep -q "^lxc.rootfs" $path/config 2>/dev/null || echo "lxc.rootfs = $rootfs" >> $path/config grep -q "^lxc.rootfs" $path/config 2>/dev/null || echo "lxc.rootfs = $rootfs" >> $path/config
cat <<EOF >> $path/config cat <<EOF >> $path/config
lxc.utsname = $name lxc.utsname = $name
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment