X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=components%2F9990-misc-helpers.sh;h=6f84ead820f18fb6db03b013b101b28f85c49bb7;hb=HEAD;hp=535d5926898a426e8bb1bd6a3c178fc1a8848d72;hpb=cf60d58aaf46248744f163b4892040a8e323579a;p=live-boot-grml.git diff --git a/components/9990-misc-helpers.sh b/components/9990-misc-helpers.sh index 535d592..d14b072 100755 --- a/components/9990-misc-helpers.sh +++ b/components/9990-misc-helpers.sh @@ -268,6 +268,21 @@ check_dev () # Adding raid support if [ -x /scripts/local-block/mdadm ] then + # Before actually doing anything, make sure that no auto-generated + # mdadm.conf is around in the initramfs. + # Short explanation of why this is needed: + # /usr/share/initramfs-tools/hooks/mdadm is executed as part of + # mkinitramfs, which generates an /etc/mdadm/mdadm.conf file if one + # doesn't exist yet (which should always be the case in our new + # chroot) based on the host system configuration. Eventually, this + # is copied into the generated initramfs and then causes issues on + # other systems. + # It's safe to delete the file within the initramfs. The actual + # squashfs root will not be affected by that (and, additionally, + # a FAI script makes sure that the mdadm.conf in there gets wiped + # of any auto-generated arrays). + rm -rf '/etc/mdadm/mdadm.conf' + # Back in the day, when there was still a local-top mdadm script, we # used to select specific devices to be auto-assembled. # This functionality was dropped in the local-block script, so just