]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc-fedora template. Cleanup for rootfs.
authorMichael H. Warfield <mhw@WittsEnd.com>
Tue, 21 May 2013 18:17:25 +0000 (14:17 -0400)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 22 May 2013 01:32:24 +0000 (20:32 -0500)
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 <mhw@WittsEnd.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
templates/lxc-fedora.in

index 481f7187b01881af4344b372be3042df1167b458..871ae7a713042df9110904cead3f49d33f5943cd 100644 (file)
@@ -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 }'`