From: Michael H. Warfield Date: Tue, 21 May 2013 18:17:25 +0000 (-0400) Subject: lxc-fedora template. Cleanup for rootfs. X-Git-Tag: lxc-1.0.0.alpha1~1^2~190 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5bb4a226ebec9f3fb678a282a2b2833748d6707b;p=thirdparty%2Flxc.git lxc-fedora template. Cleanup for rootfs. This is just some minor changes in the way the Fedora template is synthesizing the target rootfs_path. Currently, the template uses a path with the container in it twice like this: /var/lib/lxc/rasputin/rasputin/rootfs This happens because the container name is already contained in the "path" and the template appends it a second time. This changes the logic to be congruent with other templates such as lxc-arch. The new behavior will be to create the rootfs like this: /var/lib/lxc/rasputin/rootfs Attached below the jump. Regards, Mike -- Michael H. Warfield (AI4NB) | (770) 985-6132 | mhw@WittsEnd.com /\/\|=mhw=|\/\/ | (678) 463-0932 | http://www.wittsend.com/mhw/ NIC whois: MHW9 | An optimist believes we live in the best of all PGP Key: 0x674627FF | possible worlds. A pessimist is sure of it! -- Signed-off-by: Michael H. Warfield Signed-off-by: Serge Hallyn --- diff --git a/templates/lxc-fedora.in b/templates/lxc-fedora.in index 481f7187b..871ae7a71 100644 --- a/templates/lxc-fedora.in +++ b/templates/lxc-fedora.in @@ -140,7 +140,7 @@ configure_fedora_systemd() { unlink ${rootfs_path}/etc/systemd/system/default.target touch ${rootfs_path}/etc/fstab - chroot ${rootfs_path} ln -s /dev/null //etc/systemd/system/udev.service + chroot ${rootfs_path} ln -s /dev/null /etc/systemd/system/udev.service chroot ${rootfs_path} ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target #dependency on a device unit fails it specially that we disabled udev # sed -i 's/After=dev-%i.device/After=/' ${rootfs_path}/lib/systemd/system/getty\@.service @@ -412,7 +412,7 @@ if [ -n "$needed_pkgs" ]; then fi if [ -z "$path" ]; then - path=$default_path + path=$default_path/$name fi if [ -z "$release" ]; then @@ -438,7 +438,7 @@ if [ "$(id -u)" != "0" ]; then fi -rootfs_path=$path/$name/rootfs +rootfs_path=$path/rootfs # check for 'lxc.rootfs' passed in through default config by lxc-create if grep -q '^lxc.rootfs' $path/config 2>/dev/null ; then rootfs_path=`grep 'lxc.rootfs =' $path/config | awk -F= '{ print $2 }'`