main/postmarketos-initramfs: always mount the correct rootfs, make /boot optional
- If we have
pmos_root_uuid=
on cmdline (generated by boot-deploy based on fstab), then look only for that root partition and don't fallback to mounting others. This avoids accidentally mounting the wrong rootfs based on enumeration order or timing, when you have multiple installations of pmOS attached to the system. - For encrypted installations of pmOS, skip falling back to the unreliable auto detection routine. Instead mount
/dev/mapper/root
directly as rootfs.
There are also two commits that make it possible to boot pmOS in "single partition mode" where there is just a root partition and no boot partition (see pmbootstrap!2512 (merged)):
- Don't mount subpartitions just to find the boot partition, since it might not exist. This isn't needed anymore since we now look only for the correct rootfs given by
pmos_root_uuid=
. Reverts !5625 (merged) - Adjust workaround for old installations of pmOS without proper fstab to check if the fstab is empty instead of looking for a /boot entry.
These can go in independent of the pmbootstrap MR though, since the changes are minimal and there are no negative effects for existing installation options.
See commit log for details.
Cc: @caleb @craftyguy
Merge request reports
Activity
requested review from @craftyguy
- Resolved by Newbyte
Is this related to %Restrict and document supported boot methods and partition layouts ?
@Minecrell this is great, thanks a lot!
added 54 commits
-
3d4a3464...0af3cf87 - 50 commits from branch
postmarketOS:master
- e5a1370d - main/postmarketos-initramfs: don't fallback looking for root when given UUID or path (MR 5920)
- 033d5f79 - main/postmarketos-initramfs: mount root partition we unlocked (MR 5920)
- 2965a659 - Revert "main/postmarketos-initramfs: mount subpartitions if root or boot is...
- 755132f6 - main/postmarketos-initramfs: skip mounting /boot if rootfs is in fstab (MR 5920)
Toggle commit list-
3d4a3464...0af3cf87 - 50 commits from branch
enabled an automatic merge when all merge checks for 755132f6 pass
The old installations do not have any entries in fstab, so fix this by checking if the file is empty instead (with all comments and whitespace removed).
Except that users could've had customization in their fstab, and thus such users will now have
/boot
not mounted and mkinitfs after kernel upgrades will write updated initramfs into/
's partition instead of/boot
. This happened to me. It results in confusing situation where device boots in very broken state (in case of pinephone, no wifi or modem) because it is still booting old initramfs with old kernel but without any modules (because/lib/modules/$oldversion
has been deleted).I'm fine with having such old installs do a one-time manual fixup of adding
/boot
to fstab instead of carrying technical debt forever, but we need to inform via a blog post to do this, including what exactly to add to fstab.mentioned in commit Arnavion/postmarketos.org@2b424b7d
mentioned in merge request postmarketos.org!350 (merged)
mentioned in commit Arnavion/postmarketos.org@cf76fb1e
mentioned in commit Arnavion/postmarketos.org@8bfc3993
mentioned in commit Arnavion/postmarketos.org@d8d9d2d5
mentioned in commit Arnavion/postmarketos.org@e9ad3219
mentioned in commit Arnavion/postmarketos.org@73130d0d