+grep -qe 'toram' -qe '2ram' -qe 'usb' -qe 'serial' \
+ -qe 'fromhd' -qe 'isofrom' -qe 'fromiso' -qe 'findiso' \
+ /proc/cmdline && INSTALLED=true
+
+# detect cdrom device
+if ! $INSTALLED ; then
+ # live-boot layout since December 2012:
+ if [ -d /lib/live/mount/medium ] ; then
+ CDROM="$(awk '/ \/lib\/live\/mount\/medium /{print $1;exit 0;}' /proc/mounts)"
+ MOUNTPATH="/lib/live/mount/medium"
+ # live-boot layout until December 2012:
+ elif [ -d /live/image ] ; then
+ CDROM="$(awk '/ \/live\/image /{print $1;exit 0;}' /proc/mounts)"
+ MOUNTPATH="/live/image"
+ else # old layout:
+ CDROM="$(awk '/ \/cdrom /{print $1;exit 0;}' /proc/mounts)"
+ MOUNTPATH="/cdrom"
+ fi