X-Git-Url: http://git.grml.org/?p=live-boot-grml.git;a=blobdiff_plain;f=components%2F9990-misc-helpers.sh;fp=components%2F9990-misc-helpers.sh;h=d14b0726bed869b86865f1dfd3a3fabdc0fdd3d8;hp=535d5926898a426e8bb1bd6a3c178fc1a8848d72;hb=6aa95101942a323e9bab7a2c925e75bad2ec9274;hpb=80b6bc422d0ed44a81bd15fe68cf05786f254188 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