Skip to content
Snippets Groups Projects
Commit 1259d74b authored by Minecrell's avatar Minecrell Committed by Alexey Minnekhanov
Browse files

main/postmarketos-initramfs: mount subpartitions if root or boot is missing (MR 5625)

Commit 7030e08e ("postmarketos-initramfs: check for root subpartition
(MR 5048)") changed the partition check in mount_subpartitions to look for
the root partition instead of the boot partition, in order to mount
subpartitions even if the pmOS_boot partition was already found.

Unfortunately, this causes regressions for the opposite case: If we find a
root partition, but the boot partition exists only as a subpartition then
mount_subpartitions will return early, without actually making the boot
partition accessible.

This is easy to trigger if you have a different Linux distribution with an
encrypted crypto_LUKS volume installed and then flash pmOS subpartitions to
a single partition. find_root_partition() will return the crypto_LUKS
partition (without checking if it belongs to pmOS) and the boot partition
is not found.

Fix both use cases by checking for root *and* boot partition. If any of
them is not found, we try to mount the subpartitions.
parent 683be8f0
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment