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
This commit is contained in:
SSD 2024-06-05 12:34:28 +00:00 committed by Stefan Hansson
parent e0382da4f7
commit 086078ded7
No known key found for this signature in database
GPG key ID: 8A700086A9FE41FD
2 changed files with 13 additions and 12 deletions

View file

@ -1,7 +1,7 @@
# Maintainer: Oliver Smith <ollieparanoid@postmarketos.org> # Maintainer: Oliver Smith <ollieparanoid@postmarketos.org>
# Co-Maintainer: Clayton Craft <clayton@craftyguy.net> # Co-Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=postmarketos-initramfs pkgname=postmarketos-initramfs
pkgver=2.7.0 pkgver=2.7.1
pkgrel=0 pkgrel=0
pkgdesc="Base files for the postmarketOS initramfs / initramfs-extra" pkgdesc="Base files for the postmarketOS initramfs / initramfs-extra"
url="https://postmarketos.org" url="https://postmarketos.org"
@ -89,7 +89,7 @@ sha512sums="
ab41b45b0613f25a61114ed8c8b92bc53c60838f6e2e0ba18c76e5369b2984e6023a0661887692673aca3f647f268c468a468f6b1ac424cfee609017a89481dd 00-initramfs-base.files ab41b45b0613f25a61114ed8c8b92bc53c60838f6e2e0ba18c76e5369b2984e6023a0661887692673aca3f647f268c468a468f6b1ac424cfee609017a89481dd 00-initramfs-base.files
8a4adad3785af474b36a09a05f6a3b2c4b4f43aac331a53b903abfa51ea12be1e3d1d807b7a6e66a1346815f3b0044daf8cd62e21e2dc75d2db13ee265a72985 00-initramfs-extra-base.files 8a4adad3785af474b36a09a05f6a3b2c4b4f43aac331a53b903abfa51ea12be1e3d1d807b7a6e66a1346815f3b0044daf8cd62e21e2dc75d2db13ee265a72985 00-initramfs-extra-base.files
102cb49a5b44282afee7808945c69e9bb9310677efeefc681d92217f0399a90fcbb37eb9ac7aed89cc27c324780298c7c2de6de2bdb89a77499faad1c312e539 init.sh 102cb49a5b44282afee7808945c69e9bb9310677efeefc681d92217f0399a90fcbb37eb9ac7aed89cc27c324780298c7c2de6de2bdb89a77499faad1c312e539 init.sh
eec9cd4e9b123270615ba9ff840818ae2f1a0dddbe8cf3ea863b5ee4ba3229628adb804d50ac7105c582073fba8f75141af249ebeb60c369da0052ca0fabda19 init_functions.sh 091cb54268a8b5a0f2793c64e3eb633d5f6aee084ab2b6fcdb39c56404c97e1256294d48cd991e39e067a5b4defc4c20a82005c74a470e97577cbe8339a5348d init_functions.sh
ba3275a9af788c7c782322a22a0f144d5e50e3498ea6886486a29331f23ae89cd32d500a3635cfa7cab369afba92edc18aeca64ccbf0cd589061cce23d15b46c unudhcpd.conf ba3275a9af788c7c782322a22a0f144d5e50e3498ea6886486a29331f23ae89cd32d500a3635cfa7cab369afba92edc18aeca64ccbf0cd589061cce23d15b46c unudhcpd.conf
675e7d5bee39b2df7d322117f8dcaccc274d61beaf4d50ead19bbf2109446d64b1c0aa0c5b4f9846eb6c1c403418f28f6364eff4537ba41120fbfcbc484b7da7 mdev.conf 675e7d5bee39b2df7d322117f8dcaccc274d61beaf4d50ead19bbf2109446d64b1c0aa0c5b4f9846eb6c1c403418f28f6364eff4537ba41120fbfcbc484b7da7 mdev.conf
" "

View file

@ -248,7 +248,17 @@ find_root_partition() {
find_boot_partition() { find_boot_partition() {
[ -n "$PMOS_BOOT" ] && echo "$PMOS_BOOT" && return [ -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. # this should be set on all new installs.
# shellcheck disable=SC2013 # shellcheck disable=SC2013
for x in $(cat /proc/cmdline); do for x in $(cat /proc/cmdline); do
@ -297,15 +307,6 @@ find_boot_partition() {
done done
fi 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") PMOS_BOOT=$(pretty_dm_path "$PMOS_BOOT")
echo "$PMOS_BOOT" echo "$PMOS_BOOT"
} }