diff options
Diffstat (limited to 'raveos-calamares-theme')
4 files changed, 52 insertions, 1 deletions
diff --git a/raveos-calamares-theme/PKGBUILD b/raveos-calamares-theme/PKGBUILD index d44daa5..ef0933f 100644 --- a/raveos-calamares-theme/PKGBUILD +++ b/raveos-calamares-theme/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: AlexC <alexc@alexc.hu> pkgname=raveos-calamares-theme pkgver=2.0.0 -pkgrel=39 +pkgrel=40 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 new file mode 100644 index 0000000..a462bc9 --- /dev/null +++ b/raveos-calamares-theme/etc/calamares/modules/calamares-fix-bootentry.sh @@ -0,0 +1,42 @@ +#!/bin/bash +set -e + +echo ">>> [fix-bootentry] Running INSIDE target system" + +ENTRYDIR="/boot/loader/entries" +[ -d "${ENTRYDIR}" ] || { echo ">>> [fix-bootentry] No ${ENTRYDIR}, skipping."; exit 0; } + +# 95-raveos.install (kernel-install hook, fired during pacstrap/mkinitcpio) +# detects the root device via findmnt at hook-time. Depending on the +# 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=. + +ROOT_UUID="$(findmnt -no UUID / || true)" +if [ -z "${ROOT_UUID}" ]; then + ROOT_UUID="$(awk '$2 == "/" && $1 ~ /^UUID=/ {print $1; exit}' /etc/fstab | sed 's/^UUID=//')" +fi + +if [ -z "${ROOT_UUID}" ]; then + echo ">>> [fix-bootentry] Could not determine root UUID from findmnt or fstab, leaving entries untouched." + exit 0 +fi + +echo ">>> [fix-bootentry] Root UUID: ${ROOT_UUID}" + +for f in "${ENTRYDIR}"/*.conf; do + [ -f "$f" ] || continue + + if grep -qE '^options[[:space:]].*\broot=' "$f"; then + echo ">>> [fix-bootentry] Already has root=, skipping: $f" + continue + fi + + echo ">>> [fix-bootentry] Patching missing root= in: $f" + sed -i -E "s#^options[[:space:]]+#options root=UUID=${ROOT_UUID} #" "$f" +done + +echo ">>> [fix-bootentry] Done." diff --git a/raveos-calamares-theme/etc/calamares/modules/shellprocess-final.conf b/raveos-calamares-theme/etc/calamares/modules/shellprocess-final.conf index f89762d..fc06d93 100644 --- a/raveos-calamares-theme/etc/calamares/modules/shellprocess-final.conf +++ b/raveos-calamares-theme/etc/calamares/modules/shellprocess-final.conf @@ -24,6 +24,8 @@ script: - "if [ -x ${ROOT}/usr/lib/raveos-plasma-theme/auto-apply.sh ]; then arch-chroot ${ROOT} /usr/lib/raveos-plasma-theme/auto-apply.sh; fi" - "if [ -x ${ROOT}/usr/lib/raveos-hyprland-theme/auto-apply.sh ]; then arch-chroot ${ROOT} /usr/lib/raveos-hyprland-theme/auto-apply.sh; fi" - "arch-chroot ${ROOT} /bin/bash -c 'pacman -Qi plasma-bigscreen &>/dev/null && pacman -Rcns --noconfirm plasma-bigscreen || true'" + - "arch-chroot ${ROOT} sed -i '/^HOOKS=/ s/udev /udev plymouth /' /etc/mkinitcpio.conf" + - "arch-chroot ${ROOT} mkinitcpio -P" - "install -Dm644 /etc/systemd/system/reflector-once.service ${ROOT}/etc/systemd/system/reflector-once.service" - "chroot ${ROOT} systemctl enable reflector-once.service" - "gsettings set org.gnome.desktop.interface gtk-theme 'Yaru-olive-dark'" diff --git a/raveos-calamares-theme/etc/calamares/modules/shellprocess-loader.conf b/raveos-calamares-theme/etc/calamares/modules/shellprocess-loader.conf index 69d9f30..3b2fde0 100644 --- a/raveos-calamares-theme/etc/calamares/modules/shellprocess-loader.conf +++ b/raveos-calamares-theme/etc/calamares/modules/shellprocess-loader.conf @@ -4,6 +4,13 @@ script: # 1. Copy across RaveOS bootloader, loader.conf, remove the other entry - command: "cp -r /root/.loader.conf ${ROOT}/boot/loader/loader.conf || true" - command: "rm -r ${ROOT}/boot/loader/entries/*cachyos* || true" + # 2. Safety net: 95-raveos.install can silently produce a loader entry + # with no root= (findmnt returns empty depending on chroot context + # at kernel-install-hook time during pacstrap). Patch it here from + # the by-now-correct /etc/fstab. + - command: "install -Dm755 /etc/calamares/modules/calamares-fix-bootentry.sh ${ROOT}/root/calamares-fix-bootentry.sh" + - command: "arch-chroot ${ROOT} /bin/bash /root/calamares-fix-bootentry.sh" + - command: "-rm ${ROOT}/root/calamares-fix-bootentry.sh" # - command: "install -Dm755 /etc/calamares/modules/calamares-microcode-fix.sh ${ROOT}/root/calamares-microcode-fix.sh" |