[Libguestfs] [PATCH 09/11] appliance: fix errors in init for SLE / openSUSE

Cédric Bosdonnat cbosdonnat at suse.com
Thu May 12 13:29:17 UTC 2016


Running the init on openSUSE and SLE machines showed up minor errors:
 * skip the /etc/mtab symlink creation if the file is already existing.
 * make sure /run/lvm is created or lvmetab will complain.
---
 appliance/init | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/appliance/init b/appliance/init
index 413a95f..b22032e 100755
--- a/appliance/init
+++ b/appliance/init
@@ -70,7 +70,9 @@ ln -s ../run/lock /var/lock
 
 # On Fedora 23, util-linux creates /etc/mtab in %post .. stupid
 # and e2fsprogs fails if the link doesn't exist .. stupid stupid
-ln -s /proc/mounts /etc/mtab
+if ! test -e /etc/mtab; then
+  ln -s /proc/mounts /etc/mtab
+fi
 
 # devtmpfs is required since udev 176
 mount -t devtmpfs /dev /dev
@@ -132,6 +134,7 @@ mdadm -As --auto=yes --run
 
 # Scan for LVM.
 modprobe dm_mod ||:
+mkdir -p /run/lvm
 lvmetad ||:
 
 lvm vgchange -aay --sysinit
-- 
2.6.6




More information about the Libguestfs mailing list