Add Code testing workflow
[grml-scripts.git] / usr_sbin / grml2ram
index 16bf33c..3482bdb 100755 (executable)
@@ -19,12 +19,10 @@ if ! isgrmlcd ; then
    exit 1
 fi
 
-# 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'
 
 if [ -z "$CMDLINE" ]; then
   # if CMDLINE was set from the outside, we're debugging.
@@ -52,7 +50,7 @@ getbootparam(){
 MEDIA_PATH="$(getbootparam live-media-path)"
 MEDIA_PATH="${MEDIA_PATH:-.}"
 
-IMAGE=$(find $LIVECD_PATH/${MEDIA_PATH}/ -name *.squashfs 2>/dev/null | head -1)
+IMAGE=$(find ${LIVECD_PATH}/${MEDIA_PATH}/ -name *.squashfs 2>/dev/null | head -1)
 if ! [ -r "$IMAGE" ] ; then
    if [ -r /cdrom/GRML/GRML ] ; then
       IMAGE='/cdrom/GRML/GRML'