summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--raveos-calamares-theme/PKGBUILD2
-rw-r--r--raveos-calamares-theme/etc/calamares/modules/calamares-fix-bootentry.sh14
2 files changed, 12 insertions, 4 deletions
diff --git a/raveos-calamares-theme/PKGBUILD b/raveos-calamares-theme/PKGBUILD
index f0d55d7..318bceb 100644
--- a/raveos-calamares-theme/PKGBUILD
+++ b/raveos-calamares-theme/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: nippy <nippy@tuta.io>
pkgname=raveos-calamares-theme
pkgver=2.0.0
-pkgrel=65
+pkgrel=66
pkgdesc="RaveOS Calamares Theme"
arch=('any')
url="https://git.rp1.hu/RaveOS"
diff --git a/raveos-calamares-theme/etc/calamares/modules/calamares-fix-bootentry.sh b/raveos-calamares-theme/etc/calamares/modules/calamares-fix-bootentry.sh
index a462bc9..f49e1d0 100644
--- a/raveos-calamares-theme/etc/calamares/modules/calamares-fix-bootentry.sh
+++ b/raveos-calamares-theme/etc/calamares/modules/calamares-fix-bootentry.sh
@@ -11,9 +11,12 @@ ENTRYDIR="/boot/loader/entries"
# chroot/mount-namespace context that detection can silently come back
# empty, producing a loader entry with no "root=" in its options line
# (system then drops to an emergency shell on boot: "Failed to mount ''
-# on real root"). By this point in the install sequence /etc/fstab is
-# already correctly generated, so use it as the authoritative source and
-# patch any entry that is missing root=.
+# on real root"). On btrfs it can also come back in findmnt's bracket form
+# ("/dev/vda2[/@]"), which blkid cannot resolve -- that produces a
+# syntactically present but unusable root= (emergency shell: "Failed to
+# mount '/dev/vda2[/@]' on real root"). By this point in the install
+# sequence /etc/fstab is already correctly generated, so use it as the
+# authoritative source and patch both the missing and malformed cases.
ROOT_UUID="$(findmnt -no UUID / || true)"
if [ -z "${ROOT_UUID}" ]; then
@@ -31,6 +34,11 @@ for f in "${ENTRYDIR}"/*.conf; do
[ -f "$f" ] || continue
if grep -qE '^options[[:space:]].*\broot=' "$f"; then
+ if grep -qE 'root=[^[:space:]]*\[' "$f"; then
+ echo ">>> [fix-bootentry] Fixing malformed (findmnt-style) root= in: $f"
+ sed -i -E "s#root=[^[:space:]]*\[[^]]*\]#root=UUID=${ROOT_UUID}#" "$f"
+ continue
+ fi
echo ">>> [fix-bootentry] Already has root=, skipping: $f"
continue
fi