summaryrefslogtreecommitdiff
path: root/releng
diff options
context:
space:
mode:
Diffstat (limited to 'releng')
-rw-r--r--releng/airootfs/etc/profile.d/raveos-fastfetch.sh2
-rwxr-xr-xreleng/airootfs/usr/share/calamares/kernel-install/95-raveos.install38
2 files changed, 23 insertions, 17 deletions
diff --git a/releng/airootfs/etc/profile.d/raveos-fastfetch.sh b/releng/airootfs/etc/profile.d/raveos-fastfetch.sh
index c97dc67..55460b8 100644
--- a/releng/airootfs/etc/profile.d/raveos-fastfetch.sh
+++ b/releng/airootfs/etc/profile.d/raveos-fastfetch.sh
@@ -1,7 +1,7 @@
#!/bin/bash
# RaveOS terminal greeting
# Guard: prevent double execution (login shell profile.d + .bashrc)
-[[ -n "$_RAVEOS_GREETING_DONE" ]] && return 2>/dev/null
+[[ -n "$_RAVEOS_GREETING_DONE" ]] && { return 2>/dev/null || exit 0; }
_RAVEOS_GREETING_DONE=1
if command -v fastfetch &>/dev/null; then
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 316204c..4bb0c6b 100755
--- a/releng/airootfs/usr/share/calamares/kernel-install/95-raveos.install
+++ b/releng/airootfs/usr/share/calamares/kernel-install/95-raveos.install
@@ -22,19 +22,19 @@ ENTRY_FILE="$ENTRY_DIR/raveos.conf"
LINUX_IMAGE="/vmlinuz-linux-cachyos"
INITRAMFS_IMAGE="/initramfs-linux-cachyos.img"
-# --------------------------------------------------
-# Microcode (must be first initrd)
-# --------------------------------------------------
+# CPU Microcode detection (Intel vs AMD)
MICROCODE=""
-[ -f "$BOOT_ROOT/intel-ucode.img" ] && MICROCODE="/intel-ucode.img"
-[ -f "$BOOT_ROOT/amd-ucode.img" ] && MICROCODE="/amd-ucode.img"
+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
+ MICROCODE="/intel-ucode.img"
+elif [ "$CPU_VENDOR" = "AuthenticAMD" ] && [ -f "$BOOT_ROOT/amd-ucode.img" ]; then
+ MICROCODE="/amd-ucode.img"
+else
+ [ -f "$BOOT_ROOT/intel-ucode.img" ] && MICROCODE="/intel-ucode.img"
+ [ -f "$BOOT_ROOT/amd-ucode.img" ] && MICROCODE="/amd-ucode.img"
+fi
-# --------------------------------------------------
-# Root device detection
-# --------------------------------------------------
-# findmnt can come back empty depending on the chroot/mount-namespace
-# context this hook runs in (e.g. during pacstrap). Fall back to
-# /proc/mounts, and finally /etc/fstab (once it exists), before giving up.
+# Root device detection with fallback
ROOT_SRC="$(findmnt -no SOURCE / || true)"
ROOT_FS="$(findmnt -no FSTYPE / || true)"
ROOT_OPTS="$(findmnt -no OPTIONS / || true)"
@@ -51,9 +51,6 @@ if [ -z "$ROOT_SRC" ] && [ -f /etc/fstab ]; then
ROOT_OPTS="$(awk '$2 == "/" {print $4; exit}' /etc/fstab)"
fi
-# /proc/mounts and /etc/fstab may give "UUID=xxxx"/"PARTUUID=xxxx" directly
-# instead of a /dev/ path -- resolve to an actual device node so the blkid
-# lookups below work either way.
case "$ROOT_SRC" in
UUID=*|PARTUUID=*|LABEL=*)
RESOLVED="$(blkid -t "$ROOT_SRC" -o device 2>/dev/null || true)"
@@ -63,7 +60,7 @@ esac
OPTIONS="rw quiet splash"
-# LUKS
+# LUKS Encryption & Root Device Fallbacks
if [[ "$ROOT_SRC" == /dev/mapper/* ]]; then
UUID="$(blkid -s UUID -o value "$ROOT_SRC" || true)"
if [ -n "$UUID" ]; then
@@ -73,7 +70,16 @@ if [[ "$ROOT_SRC" == /dev/mapper/* ]]; then
fi
else
PARTUUID="$(blkid -s PARTUUID -o value "$ROOT_SRC" || true)"
- [ -n "$PARTUUID" ] && OPTIONS="root=PARTUUID=$PARTUUID $OPTIONS"
+ if [ -n "$PARTUUID" ]; then
+ OPTIONS="root=PARTUUID=$PARTUUID $OPTIONS"
+ else
+ UUID="$(blkid -s UUID -o value "$ROOT_SRC" || true)"
+ if [ -n "$UUID" ]; then
+ OPTIONS="root=UUID=$UUID $OPTIONS"
+ else
+ OPTIONS="root=$ROOT_SRC $OPTIONS"
+ fi
+ fi
fi
# --------------------------------------------------