anatol/booster

Unable to boot rootfs with quotes around UUID

Closed this issue · 11 comments

Hi, I've been trying to use booster, but I've been unable to get it to mount the rootfs. I see the error devAdd: cannot detect block type looped a few times on the same line.

booster config has modules: btrfs

booster.debug=1 has way too much info scrolling by too quickly to even capture with video but if there's a way to somehow get that data I would be glad to give more info.

Partition is unencrypted BTRFS. universal: true did not help.

full systemd-boot configuration, which is identical to my working config with mkinitcpio except for booster changes:

linux /vmlinuz-linux-g14
initrd /amd-ucode.img
initrd /booster-linux.img
options root=UUID="58e16728-f562-4211-bcc7-a8bbab97cb9b" fstype=btrfs rootflags=subvolid=1974 rw splash mitigations=off trace_clock=local amd_iommu=on random.trust_cpu=1 resume=UUID="ca1b6bf9-b4a1-4d73-8e81-0938ac8ce4cb" no_console_suspend clocksource=tsc tsc=reliable no_console_suspend ignore_loglevel initcall_debug```

Thanks for filing this issue. A few comments about your setup:

booster config has modules: btrfs

You don't really need this config option (and neither universal). If btrfs module presents in lsmod then it should be added to the image automatically. You can verify that it has been added with lsinitcpio <booster.img>

options root=UUID="58e16728-f562-4211-bcc7-a8bbab97cb9b" fstype=btrfs rootflags=subvolid=1974 rw splash mitigations=off trace_clock=local amd_iommu=on random.trust_cpu=1 resume=UUID="ca1b6bf9-b4a1-4d73-8e81-0938ac8ce4cb" no_console_suspend clocksource=tsc tsc=reliable no_console_suspend ignore_loglevel initcall_debug

Alright, first of all you need to remove quotes in root=UUID="58e16728-f562-4211-bcc7-a8bbab97cb9b". booster does not remove it and assumes uuid is "58e16728-f562-4211-bcc7-a8bbab97cb9b" which is incorrect. Are the quotes required by other initramfs?

fstype=btrfs

Booster documentation incorrectly named this boot option. It should be rootfstype as mentioned here https://www.kernel.org/doc/html/latest/admin-guide/kernel-parameters.html The documentation has been corrected in the master branch d7bfafe. Also I think this option is not needed for booster as it should detect btrfs filesystem automatically.

rootflags=subvolid=1974

This option is not supported in master yet. I just implemented it in this development branch https://github.com/anatol/booster/tree/options Do you have a chance to try it out and see if it works for you?

Ok, with the master branch I was able to get it to boot without the "" but it did ignore the flags and booted the wrong OS. With the options branch, it was able to boot the correct subvolume (following the rootflags correctly). It works without specifying rootfstype or modules: btrfs.
The quotes are there from me just copy-pasting from blkid. It is supported by mkinitcpio but not required. Maybe it could be mentioned in the documentation so others don't make the same mistake (or you could add support).

I do have another issue, but it might be unrelated to booster. If I add modules: amdgpu boot hangs when it tries to switch the framebuffer. The reason i bring it up is because I have amdgpu built into mkinicpio and I've never encountered this.

Last thing, I don't want to bombard you with issues but when i initially installed yesterday it did not build any initramfs, or at least I have no idea where it was built. There was nothing new present in /boot. Running booster created booster.img in my working directory. I have to specifiy a file location manually.

With the options branch, it was able to boot the correct subvolume (following the rootflags correctly).

Thanks for verifying it. The fix for it got merged master.

The quotes are there from me just copy-pasting from blkid. It is supported by mkinitcpio but not required. Maybe it could be mentioned in the documentation so others don't make the same mistake (or you could add support).

Yes it definitely need to be handled. Either remove quotes or verify that provided UUID matches expected format https://en.wikipedia.org/wiki/Universally_unique_identifier#Format

I do have another issue, but it might be unrelated to booster. If I add modules: amdgpu boot hangs when it tries to switch the framebuffer. The reason i bring it up is because I have amdgpu built into mkinicpio and I've never encountered this.

This probably happens because amdgpu expects some extra configuration/dependencies/firmware files to be loaded. I have a question here - what is the reason you want to load amdgpu in the initrd? Initrd goal is to be a minimalistic image that mounts root filesystem only. The graphics bringup/configuration should really be done by the main initialization daemon (like systemd).

Running booster created booster.img in my working directory. I have to specifiy a file location manually.

Running booster from command line produces output in the current directory:

$ booster
 -output string
    	Output initrd file (default "booster.img")

The /boot files are generated by the package installation hook https://github.com/anatol/booster/blob/master/packaging/arch/booster-install

Same issue here with booster 0.2-1 on Archlinux. BTRFS over LUKS failed to boot devAdd: cannot detect block device type

cat /proc/cmdline, on mkinitcpio:

initrd=\toxo\intel-ucode.img initrd=\toxo\initramfs-linux-ck-skylake.img luks.uuid=8378cf26-54fb-4cc3-9125-36e311178c21 luks.options=8378cf26-54fb-4cc3-9125-36e311178c21=allow-discards rd.luks.key=8378cf26-54fb-4cc3-9125-36e311178c21=/key:UUID=F862-7316 root=UUID=66ddfdb0-47ee-4d2d-ba0e-f09f482f36fd rw i915.enable_rc6=0 luks.uuid=8d132091-30a9-448d-ac0b-53136589516a rd.luks.key=8d132091-30a9-448d-ac0b-53136589516a=/key:UUID=F862-7316

$esp/loader/entries/ck-booster.conf

title	ArchLinux CK
linux	/toxo/vmlinuz-linux-ck-skylake
initrd	/toxo/intel-ucode.img
initrd	/toxo/booster-linux-ck-skylake.img
options	luks.uuid=8378cf26-54fb-4cc3-9125-36e311178c21 luks.options=8378cf26-54fb-4cc3-9125-36e311178c21=allow-discards rd.luks.key=8378cf26-54fb-4cc3-9125-36e311178c21=/key:UUID=F862-7316 root=UUID=66ddfdb0-47ee-4d2d-ba0e-f09f482f36fd rw i915.enable_rc6=0 luks.uuid=8d132091-30a9-448d-ac0b-53136589516a rd.luks.key=8d132091-30a9-448d-ac0b-53136589516a=/key:UUID=F862-7316

@moviuro could you please provide more logs? You can add booster.debug=1 to the boot params for more verbose output. The devAdd message might not be the main reason for the failure.

As of your config:

  • luks.options=8378cf26-54fb-4cc3-9125-36e311178c21=allow-discards for booster needs to be rd.luks.options=discard. See man booster for more information.
  • rd.luks.key= is not supported yet. See #37

Are the quotes required by other initramfs?

They're supported and handled properly by mkinitcpio, but not by dracut if I recall correctly. Supporting quotes would be useful for LABEL and PARTLABEL identification, e.g. root="LABEL=Arch Root".

e.g. root=LABEL="Arch Root".

The correct format is root="LABEL=Arch Root".

From https://www.kernel.org/doc/html/latest/admin-guide/kernel-parameters.html:

Double-quotes can be used to protect spaces in values, e.g.:

param="spaces in here"

My bad, I haven't used such a setup in a long time.

I only have

options root=LABEL=ArchLinux rw

and still get devAdd: cannot detect block device type...

Per @nl6720 comment above quotes happen only around boot param value e.g. root="LABEL=Arch Root" or root="UUID=ceb572d7-3062-4055-94d7-efae8a3e5281".

But the original issue says it wants to handle quotes around UUID value: root=UUID="58e16728-f562-4211-bcc7-a8bbab97cb9b".

Which way to specify quotes is correct?
Should these quotes use-case be applied to root and rd.luks.uuid only or there are more parameters that need to be unquoted?

For now I went with handling optional quotes around UUID parameters for root and rd.luks.uuid like this root=UUID="ceb572d7-3062-4055-94d7-efae8a3e5281". If you have other ideas how the quoting should work please share your thoughts.