VirtualBox shared folders: expect exact match for automation folder name
[grml-autoconfig.git] / autoconfig.functions
index 467c41e..3aa9787 100755 (executable)
@@ -13,12 +13,10 @@ KERNEL="$(uname -r)"
 ARCH="$(uname -m)"
 umask 022
 
-# old linuxrc version:
-[ -d /cdrom ]      && export LIVECD_PATH=/cdrom
-# initramfs layout until around December 2012:
-[ -d /live/image ] && export LIVECD_PATH=/live/image
-# initramfs layout since around December 2012:
-[ -d /lib/live/mount/medium ] && export LIVECD_PATH=/lib/live/mount/medium
+# initramfs layout since December 2012, backwards compatibility:
+[ -d /lib/live/mount/medium ] && export LIVECD_PATH='/lib/live/mount/medium'
+# initramfs layout since December 2018:
+[ -d /run/live/medium ] && export LIVECD_PATH='/run/live/medium'
 
 # Ignore these signals in non-interactive mode: INT, TERM, SEGV
 [ -z "$PS1" ] && trap "" 2 3 11
@@ -1715,12 +1713,18 @@ config_lvm(){
           fi
           eend 0
           if checkbootparam 'lvm' ; then
-             einfo "Bootoption LVM found. Searching for logical volumes and enabling them:"
              if $SYSTEMD ; then
-               service_wrapper lvm2-lvmetad start
-               vgchange -ay
-               eend $?
+               einfo "Bootoption LVM found, enabling related services."
+               if [ -r /etc/init.d/lvm2-lvmetad ] ; then
+                 service_wrapper lvm2-lvmetad start ; eend $?
+               fi
+               if [ -r /etc/init.d/lvm2-lvmpolld ] ; then
+                 service_wrapper lvm2-lvmpolld start ; eend $?
+               fi
+               einfo "Searching for logical volumes and enabling them:"
+               vgchange -ay ; eend $?
              else
+               einfo "Bootoption LVM found. Searching for logical volumes and enabling them:"
                service_wrapper lvm2 start ; eend $?
              fi
           fi
@@ -1878,7 +1882,7 @@ if $VIRTUALBOX ; then
         vbautomation="$(getbootparam 'vbautomation' 2>>$DEBUG)"
       fi
 
-      if ! VBoxControl sharedfolder list | egrep -q "^[0-9]+ - ${vbautomation}$" ; then
+      if ! VBoxControl sharedfolder list | egrep -q "^[0-9]+ - ${vbautomation}(\s+|$)" ; then
         ewarn "No automount shared folder '$vbautomation' available"
         eend 0
       else