Skip to content
Snippets Groups Projects
Stephan Gerhold's avatar
Minecrell authored
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.
1259d74b
History
Name Last commit Last update