Merge remote-tracking branch 'origin/github/pr/11'
authorMichael Prokop <mika@grml.org>
Mon, 20 Dec 2021 16:18:02 +0000 (17:18 +0100)
committerMichael Prokop <mika@grml.org>
Mon, 20 Dec 2021 16:19:19 +0000 (17:19 +0100)
commit443ca4cf0d4bb4f20593c522ae05a83fc98d49ae
treec571fc0829e890423a80e7ff8ebd2bdf270ac4d3
parent27562cfcaba89409c8fcae3b6fb5b0a773db7c83
parent35e968ccac91c57e1f0353804621e048adbab5ee
Merge remote-tracking branch 'origin/github/pr/11'

Quoting sgf-dma from https://github.com/grml/grml-rescueboot/pull/11:

| As subject states, grml can't boot from (local) mdadm raid.
|
| The reason is simple: because hostname in initramfs (it's empty) does
| not match with the hostname of installed system, mdadm assembles arrays
| with different names, and there's no md device, which 42_grub has added
| to live-media=. E.g. when installed system has /dev/md/0 and hostname
| "debian11", mdadm from initramfs creates /dev/md126 and symlink
| /dev/md/debian11:0, but neither of them matches with /dev/md0 added into
| live-media= by 42_grub.
|
| I've tried (too) many workarounds, but none of them worked:
|
| * adding live-media= to CUSTOM_BOOTOPTIONS does not work, because
|   42_grub creates another one and effectively overwrites it.
|
| * ip= and (grml's) hostname= kernel command-line option works too late,
|   after mountroot stage at which initrd tries to assemble raid, so can't
|   help.
|
| * Neither works md= kernel option, which seems used for older mdadm
|   metadata formats and now ignored completely.
|
| * Nor (surprisingly) adding fixed mdadm.conf (with HOMEHOST <ignore> or
|   HOMEHOST real_hostname) to initramfs. This one because with boot=live
|   initramfs deletes mdadm.conf (in check_dev() function from
|   lib/live/boot/9990-misc-helpers.sh) before calling to
|   scripts/local-block/mdadm (well, the reason is explained there and
|   seems reasonable).
|
| So, patching 42_grub seems the only way.
|
| There're probably two ways of fixing this: allowing to overwrite
| live-media= in CUSTOM_BOOTOPTIONS or just fixing autodetected mdadm
| array name. Here is implementation of the second one.