From 755132f651f325f967d711c1ee6451c118517dbd Mon Sep 17 00:00:00 2001 From: Stephan Gerhold Date: Fri, 22 Nov 2024 17:06:08 +0100 Subject: [PATCH] main/postmarketos-initramfs: skip mounting /boot if rootfs is in fstab (MR 5920) There is a special check in init_2nd.sh for older postmarketOS installations that do not have a valid /etc/fstab file. When /boot does not appear in fstab, it searches for the boot partition and mounts it manually. However, /boot might be intentionally omitted in fstab, e.g. because we just have a single rootfs partition that also contains /boot. In that case it will wait forever, trying to find the missing boot partition. The old installations do not have any entries in fstab, so fix this by checking if the file is empty instead (with all comments and whitespace removed). [ci:skip-build]: already built successfully in CI --- main/postmarketos-initramfs/APKBUILD | 6 +++--- main/postmarketos-initramfs/init_2nd.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/main/postmarketos-initramfs/APKBUILD b/main/postmarketos-initramfs/APKBUILD index 7ce019510..31c0dc550 100644 --- a/main/postmarketos-initramfs/APKBUILD +++ b/main/postmarketos-initramfs/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Caleb Connolly # Co-Maintainer: Clayton Craft pkgname=postmarketos-initramfs -pkgver=3.6.0 +pkgver=3.7.0 pkgrel=0 pkgdesc="Base files for the postmarketOS initramfs / initramfs-extra" url="https://postmarketos.org" @@ -109,8 +109,8 @@ sha512sums=" c0233d22858a5901db64e1d2fe1f6d39a2e2cfd1b94a10932483f55fed9461e9b8aa2d73b154b9d99a7a8b49ee02abfbddfe917ce0c6d7576601ba2668589c01 00-initramfs-base.files d0f35562365756d93066ce45924d17fb347b54095179c3262daa2f073e12743505cd5d9372ad30485915ca754d95a8edba9a74314e7949e0b3cf6978a87d03a5 00-initramfs-extra-base.files c497ace6f3d183c48722b9e4fd2b6fed21338d68a9e729c1423d3c3de3eaae7366d8dd75a11f78b7072a6795dcc5380c10d8b390738372ede6dc78074ae87a76 init.sh -6f2f4245b0cbda4ee5c0966e07ffa7ad6bd4432e382bc41c4c91d463ab325226f6a7be99ff1f83d3c0c46259b189886bd27b902c87cb90f0c55b4dc61960d3d6 init_functions.sh -74681044d10e0e1d5fee94451ee7fa67a1a0b093ae0e54860ed12e2bb98db98b01f0633663d06081753f210dd946752c3d291062faaf410a88501eb5ba12d904 init_2nd.sh +3a0010dbec4f349f7da64d2cf87b0e1665009bf0361fe4d50b10f1f92caf98f35d077159d7d3577ddb730dc60a7bfbb67fb50fc5f4bc27882d59679e7dc865f0 init_functions.sh +2d531177a7310ab95910379b3ab816ab8ba75520e1c11adf295f5ff8247d74553fe3a325c56c66aba4e41e33f0e813b0360c45b847983c1df448d5fb176e02cb init_2nd.sh 5ed5d96c45db0b32b6ff5f5e63b2821e442baf57c3ba587555e2cd92986c65aa13bc73ae591a8b35845e5d30384daf13b76e83961bd7cfe674a81320b34748d9 init_functions_2nd.sh 675e7d5bee39b2df7d322117f8dcaccc274d61beaf4d50ead19bbf2109446d64b1c0aa0c5b4f9846eb6c1c403418f28f6364eff4537ba41120fbfcbc484b7da7 mdev.conf ba3275a9af788c7c782322a22a0f144d5e50e3498ea6886486a29331f23ae89cd32d500a3635cfa7cab369afba92edc18aeca64ccbf0cd589061cce23d15b46c unudhcpd.conf diff --git a/main/postmarketos-initramfs/init_2nd.sh b/main/postmarketos-initramfs/init_2nd.sh index aac2ac27b..65bc78ae7 100644 --- a/main/postmarketos-initramfs/init_2nd.sh +++ b/main/postmarketos-initramfs/init_2nd.sh @@ -54,7 +54,7 @@ resize_filesystem_after_mount /sysroot # Mount boot partition into sysroot if needed since some # old installations don't have a proper /etc/fstab file. See #2800 -if ! cat /sysroot/etc/fstab | grep -v "#" | grep -q "/boot" ; then +if [ -z "$(cat /sysroot/etc/fstab | grep -v "#" | tr -d '[:space:]')" ]; then wait_boot_partition mount_boot_partition /sysroot/boot "rw" fi