From 086078ded7af088164689370c9d2367a65627fcd Mon Sep 17 00:00:00 2001 From: SSD Date: Wed, 5 Jun 2024 12:34:28 +0000 Subject: [PATCH] main/postmarketos-initramfs: fix stowaway (MR 5206) I have noticed a bug. Because is some cases, uuid for the boot partition is set, it won't reach logic for the stowaway. [ci:skip-build]: already built successfully in CI --- main/postmarketos-initramfs/APKBUILD | 4 ++-- main/postmarketos-initramfs/init_functions.sh | 21 ++++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/main/postmarketos-initramfs/APKBUILD b/main/postmarketos-initramfs/APKBUILD index fe1677ba8..bcc8c94c3 100644 --- a/main/postmarketos-initramfs/APKBUILD +++ b/main/postmarketos-initramfs/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Oliver Smith # Co-Maintainer: Clayton Craft pkgname=postmarketos-initramfs -pkgver=2.7.0 +pkgver=2.7.1 pkgrel=0 pkgdesc="Base files for the postmarketOS initramfs / initramfs-extra" url="https://postmarketos.org" @@ -89,7 +89,7 @@ sha512sums=" ab41b45b0613f25a61114ed8c8b92bc53c60838f6e2e0ba18c76e5369b2984e6023a0661887692673aca3f647f268c468a468f6b1ac424cfee609017a89481dd 00-initramfs-base.files 8a4adad3785af474b36a09a05f6a3b2c4b4f43aac331a53b903abfa51ea12be1e3d1d807b7a6e66a1346815f3b0044daf8cd62e21e2dc75d2db13ee265a72985 00-initramfs-extra-base.files 102cb49a5b44282afee7808945c69e9bb9310677efeefc681d92217f0399a90fcbb37eb9ac7aed89cc27c324780298c7c2de6de2bdb89a77499faad1c312e539 init.sh -eec9cd4e9b123270615ba9ff840818ae2f1a0dddbe8cf3ea863b5ee4ba3229628adb804d50ac7105c582073fba8f75141af249ebeb60c369da0052ca0fabda19 init_functions.sh +091cb54268a8b5a0f2793c64e3eb633d5f6aee084ab2b6fcdb39c56404c97e1256294d48cd991e39e067a5b4defc4c20a82005c74a470e97577cbe8339a5348d init_functions.sh ba3275a9af788c7c782322a22a0f144d5e50e3498ea6886486a29331f23ae89cd32d500a3635cfa7cab369afba92edc18aeca64ccbf0cd589061cce23d15b46c unudhcpd.conf 675e7d5bee39b2df7d322117f8dcaccc274d61beaf4d50ead19bbf2109446d64b1c0aa0c5b4f9846eb6c1c403418f28f6364eff4537ba41120fbfcbc484b7da7 mdev.conf " diff --git a/main/postmarketos-initramfs/init_functions.sh b/main/postmarketos-initramfs/init_functions.sh index 1d55c0b53..7cb1b69e2 100644 --- a/main/postmarketos-initramfs/init_functions.sh +++ b/main/postmarketos-initramfs/init_functions.sh @@ -248,7 +248,17 @@ find_root_partition() { find_boot_partition() { [ -n "$PMOS_BOOT" ] && echo "$PMOS_BOOT" && return - # First check for pmos_boot_uuid on the cmdline + # Before doing anything else check if we are using a stowaway + if grep -q "pmos.stowaway" /proc/cmdline; then + mount_root_partition + PMOS_BOOT="/sysroot/boot" + mount --bind /sysroot/boot /boot + + echo "$PMOS_BOOT" + return + fi + + # Then check for pmos_boot_uuid on the cmdline # this should be set on all new installs. # shellcheck disable=SC2013 for x in $(cat /proc/cmdline); do @@ -297,15 +307,6 @@ find_boot_partition() { done fi - if grep -q "pmos.stowaway" /proc/cmdline; then - mount_root_partition - PMOS_BOOT="/sysroot/boot" - mount --bind /sysroot/boot /boot - - echo "$PMOS_BOOT" - return - fi - PMOS_BOOT=$(pretty_dm_path "$PMOS_BOOT") echo "$PMOS_BOOT" }