From 224347aee80daad096556250a2939d9e3fd31880 Mon Sep 17 00:00:00 2001 From: Nippy Date: Fri, 9 Oct 2026 12:53:18 +0200 Subject: fix --- .../share/calamares/kernel-install/95-raveos.install | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'releng/airootfs/usr/share/calamares/kernel-install/95-raveos.install') diff --git a/releng/airootfs/usr/share/calamares/kernel-install/95-raveos.install b/releng/airootfs/usr/share/calamares/kernel-install/95-raveos.install index 94b4330..c4ffaa5 100755 --- a/releng/airootfs/usr/share/calamares/kernel-install/95-raveos.install +++ b/releng/airootfs/usr/share/calamares/kernel-install/95-raveos.install @@ -1,12 +1,10 @@ #!/bin/bash -# Single-entry, systemd-compliant kernel-install hook for CachyOS set -e COMMAND="$1" # add | remove KERNEL_VERSION="$2" # e.g. 6.18.4-1-cachyos -# Only act on CachyOS kernels case "$KERNEL_VERSION" in *cachyos*) ;; *) exit 0 ;; @@ -16,13 +14,9 @@ BOOT_ROOT="${KERNEL_INSTALL_BOOT_ROOT:-/boot}" ENTRY_DIR="$BOOT_ROOT/loader/entries" ENTRY_FILE="$ENTRY_DIR/raveos.conf" -# -------------------------------------------------- -# Fixed CachyOS kernel paths (non-versioned) -# -------------------------------------------------- LINUX_IMAGE="/vmlinuz-linux-cachyos" INITRAMFS_IMAGE="/initramfs-linux-cachyos.img" -# CPU Microcode detection (Intel vs AMD) MICROCODE="" CPU_VENDOR="$(grep -m1 'vendor_id' /proc/cpuinfo 2>/dev/null | awk '{print $3}' || true)" if [ "$CPU_VENDOR" = "GenuineIntel" ] && [ -f "$BOOT_ROOT/intel-ucode.img" ]; then @@ -34,9 +28,6 @@ else [ -f "$BOOT_ROOT/amd-ucode.img" ] && MICROCODE="/amd-ucode.img" fi -# Root device detection with fallback. -# findmnt prints btrfs mounts as "/dev/vda2[/@]" (device plus subvolume), -# which is not a valid device node for blkid/mount -- strip the bracket part. ROOT_SRC="$(findmnt -no SOURCE / | sed 's/\[.*\]//' || true)" ROOT_FS="$(findmnt -no FSTYPE / || true)" ROOT_OPTS="$(findmnt -no OPTIONS / || true)" @@ -62,9 +53,10 @@ esac OPTIONS="rw quiet splash" -# LUKS Encryption & Root Device Fallbacks if [[ "$ROOT_SRC" == /dev/mapper/* ]]; then - UUID="$(blkid -s UUID -o value "$ROOT_SRC" || true)" + PARENT_NAME="$(lsblk -no pkname "$ROOT_SRC" 2>/dev/null | head -n1)" + UUID="" + [ -n "$PARENT_NAME" ] && UUID="$(blkid -s UUID -o value "/dev/$PARENT_NAME" 2>/dev/null || true)" if [ -n "$UUID" ]; then OPTIONS="cryptdevice=UUID=$UUID:cryptroot root=/dev/mapper/cryptroot $OPTIONS" else @@ -84,9 +76,6 @@ else fi fi -# -------------------------------------------------- -# Btrfs subvolume support -# -------------------------------------------------- if [ "$ROOT_FS" = "btrfs" ]; then SUBVOL="$(echo "$ROOT_OPTS" | tr ',' '\n' | grep '^subvol=' || true)" [ -n "$SUBVOL" ] && OPTIONS="$OPTIONS rootflags=$SUBVOL" @@ -106,7 +95,6 @@ case "$COMMAND" in ;; remove) - # Only remove entry if this was the last CachyOS kernel rm -f "$ENTRY_FILE" ;; -- cgit v1.3