[lxc-devel] [PATCH] lxc-fedora template. Cleanup for rootfs.

Michael H. Warfield mhw at WittsEnd.com
Tue May 21 18:17:25 UTC 2013


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 at 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 at WittsEnd.com>

--- 
diff --git a/templates/lxc-fedora.in b/templates/lxc-fedora.in
index 481f718..871ae7a 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 }'`

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 482 bytes
Desc: This is a digitally signed message part
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20130521/f0fc0abf/attachment.pgp>


More information about the lxc-devel mailing list