From: Michael Prokop Date: Tue, 15 Oct 2013 15:36:32 +0000 (+0200) Subject: Properly boot from mdadm via findiso boot option. X-Git-Tag: debian/4.0_alpha17-1~3 X-Git-Url: http://git.grml.org/?p=live-boot-grml.git;a=commitdiff_plain;h=130f0d741827ba9fef3a02cc25e4ea3b619a4352 Properly boot from mdadm via findiso boot option. For example grml-rescueboot uses findiso for booting the ISO. When booting from a software RAID using mdadm then /scripts/local-top/mdadm being used inside /scripts/boot/9990-misc-helpers.sh leaks its output to the environment, causing invalid data used inside the mount_images_in_directory function. Because the invalid data results in a failing mount_images_in_directory execution we end up with failed boot and error message: "No supported filesystem images found at ...." So instead redirect output of /scripts/local-top/mdadm to /boot.log. Also make sure to check for existence of /conf/conf.d/md before accessing it (the file doesn't always exist). While at it also make sure the same logic is used for /scripts/local-top/lvm2. See http://bts.grml.org/grml/issue1270 --- diff --git a/components/9990-misc-helpers.sh b/components/9990-misc-helpers.sh index 902ddfe..c656f23 100755 --- a/components/9990-misc-helpers.sh +++ b/components/9990-misc-helpers.sh @@ -161,7 +161,7 @@ check_dev () # Adding lvm support if [ -x /scripts/local-top/lvm2 ] then - ROOT="$device" resume="" /scripts/local-top/lvm2 + ROOT="$device" resume="" /scripts/local-top/lvm2 >>/boot.log fi ;; @@ -169,10 +169,10 @@ check_dev () # Adding raid support if [ -x /scripts/local-top/mdadm ] then - cp /conf/conf.d/md /conf/conf.d/md.orig + [ -r /conf/conf.d/md ] && cp /conf/conf.d/md /conf/conf.d/md.orig echo "MD_DEVS=$device " >> /conf/conf.d/md - /scripts/local-top/mdadm - mv /conf/conf.d/md.orig /conf/conf.d/md + /scripts/local-top/mdadm >>/boot.log + [ -r /conf/conf.d/md.orig ] && mv /conf/conf.d/md.orig /conf/conf.d/md fi ;; esac