From 3d46167c4f419479f09a4c8bc1025e6f2248b2d5 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 15 Oct 2013 16:42:23 +0200 Subject: [PATCH] Add patch to properly boot from mdadm via findiso boot option [Closes: issue1270] 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. Thanks: thinkgear for reporting and providing a test VM --- .../patches/44_fix_mdadm_usage_for_findiso.patch | 25 ++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 26 insertions(+) create mode 100644 debian/patches/44_fix_mdadm_usage_for_findiso.patch diff --git a/debian/patches/44_fix_mdadm_usage_for_findiso.patch b/debian/patches/44_fix_mdadm_usage_for_findiso.patch new file mode 100644 index 0000000..cc4ef34 --- /dev/null +++ b/debian/patches/44_fix_mdadm_usage_for_findiso.patch @@ -0,0 +1,25 @@ +--- a/scripts/boot/9990-misc-helpers.sh ++++ b/scripts/boot/9990-misc-helpers.sh +@@ -202,7 +202,7 @@ + # 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 + ;; + +@@ -210,10 +210,10 @@ + # 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 diff --git a/debian/patches/series b/debian/patches/series index adedde3..b7a5c6d 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -20,3 +20,4 @@ 41_drop_nameserver_from_ip_option.patch 42_restore_support_for_old_persistence.patch 43_fix_udev_usage_in_is_nice_device.patch +44_fix_mdadm_usage_for_findiso.patch -- 2.1.4