Skip to content
Snippets Groups Projects
Verified Commit 7030e08e authored by Caleb Connolly's avatar Caleb Connolly :recycle: Committed by Clayton Craft
Browse files

postmarketos-initramfs: check for root subpartition (MR 5048)


In mount_subpartition we currently try to look for the boot partition,
to see if we're done (either we aren't using subpartitions or we found
the right one). However it is possible that a device might have
originally used the subpartition scheme, but was later converted to have
a real boot partition (for EFI for example).

In this scenario, the boot partition would be found immediately, but the
root subpartition would not be.

Address this by making mount_subpartition check for success by calling
find_root_partition instead of find_boot_partition. For most
installations this has no impact.

Signed-off-by: default avatarCaleb Connolly <caleb@postmarketos.org>
parent 0cd613c8
No related branches found
No related tags found
No related merge requests found
......@@ -150,7 +150,7 @@ mount_subpartitions() {
attempt_start=$(get_uptime_seconds)
wait_seconds=10
echo "Trying to mount subpartitions for $wait_seconds seconds..."
while [ -z "$(find_boot_partition)" ]; do
while [ -z "$(find_root_partition)" ]; do
partitions="$android_parts $(grep -v "loop\|ram" < /proc/diskstats |\
sed 's/\(\s\+[0-9]\+\)\+\s\+//;s/ .*//;s/^/\/dev\//')"
for partition in $partitions; do
......@@ -161,7 +161,7 @@ mount_subpartitions() {
# Ensure that this was the *correct* subpartition
# Some devices have mmc partitions that appear to have
# subpartitions, but aren't our subpartition.
if [ -n "$(find_boot_partition)" ]; then
if [ -n "$(find_root_partition)" ]; then
break
fi
kpartx -d "$partition"
......
  • Administrator @root

    mentioned in commit f3b649c3

    By Richard Acayan on 2024-06-28T21:55:06

    · Imported

    mentioned in commit f3b649c3

    By Richard Acayan on 2024-06-28T21:55:06

    Edited by Ghost User
    Toggle commit list
  • Administrator @root

    mentioned in merge request !5449 (closed)

    By Caleb Connolly on 2024-08-03T18:18:29

    · Imported

    mentioned in merge request !5449 (closed)

    By Caleb Connolly on 2024-08-03T18:18:29

    Edited by Ghost User
    Toggle commit list
  • Administrator @root

    mentioned in commit 1259d74b

    By Minecrell on 2024-09-26T11:19:42

    · Imported

    mentioned in commit 1259d74b

    By Minecrell on 2024-09-26T11:19:42

    Edited by Ghost User
    Toggle commit list
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