-if ! [ -r /cdrom/GRML/GRML ] ; then
- eerror "Can not access /cdrom/GRML/GRML. Looks like you did run grml2ram already?" ; eend 1
- exit 1
+# 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
+
+if [ -z "$CMDLINE" ]; then
+ # if CMDLINE was set from the outside, we're debugging.
+ # otherwise, take CMDLINE from Kernel and config files.
+ CMDLINE="$(cat /proc/cmdline)"
+ [ -d ${LIVECD_PATH}/bootparams/ ] && CMDLINE="$CMDLINE $(cat ${LIVECD_PATH}/bootparams/* | tr '\n' ' ')"