Leave fresh-install kernel selection to the ISO

This commit is contained in:
Ryan Hughes committed 2026-09-14 16:46:45 -04:00
1 parent ff85faf8dd
commit 08a875852e
4 files changed
+1 -103

No files matched your search

+1 -3
View File
@@ -1,5 +1,3 @@
run_logged "$OMARCHY_INSTALL/hardware/kernel.sh"
run_logged "$OMARCHY_INSTALL/hardware/asus-rog.sh" run_logged "$OMARCHY_INSTALL/hardware/asus-rog.sh"
run_logged "$OMARCHY_INSTALL/hardware/framework16.sh" run_logged "$OMARCHY_INSTALL/hardware/framework16.sh"
run_logged "$OMARCHY_INSTALL/hardware/dell-xps-touchpad-haptics.sh" run_logged "$OMARCHY_INSTALL/hardware/dell-xps-touchpad-haptics.sh"
@@ -23,7 +21,7 @@ run_logged "$OMARCHY_INSTALL/hardware/intel/sof-firmware.sh"
run_logged "$OMARCHY_INSTALL/hardware/fix-elgato-camlink-4k.sh" run_logged "$OMARCHY_INSTALL/hardware/fix-elgato-camlink-4k.sh"
# Rebuilds the boot image, so it follows kernel and camera module setup. # Rebuilds the boot image, so it follows camera module setup.
run_logged "$OMARCHY_INSTALL/hardware/dell-xps13-sidecar-amps.sh" run_logged "$OMARCHY_INSTALL/hardware/dell-xps13-sidecar-amps.sh"
run_logged "$OMARCHY_INSTALL/hardware/asus/fix-asus-ptl-display-backlight.sh" run_logged "$OMARCHY_INSTALL/hardware/asus/fix-asus-ptl-display-backlight.sh"
-9
View File
@@ -1,9 +0,0 @@
# Install the default kernel before hardware setup pulls in DKMS modules.
# On a fresh T2 install linux-t2 is not installed yet, so also check the chip.
if [[ $(uname -m) == "x86_64" ]] && ! omarchy-pkg-present linux-t2; then
pci_devices=$(lspci -nn)
if ! grep "106b:180[12]" <<< "$pci_devices" >/dev/null; then
echo "Installing the Omarchy kernel..."
omarchy-pkg-add linux-omarchy linux-omarchy-headers
fi
fi
@@ -1,84 +0,0 @@
#!/bin/bash
set -euo pipefail
source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh"
leaf="$ROOT/install/hardware/kernel.sh"
scratch=$(mktemp -d)
trap 'rm -rf "$scratch"' EXIT
mkdir -p "$scratch/bin"
export PATH="$scratch/bin:$PATH" CALL_LOG="$scratch/calls"
cat > "$scratch/bin/uname" <<'SH'
#!/bin/bash
[[ $* == "-m" ]] || exit 99
printf '%s\n' "${TEST_ARCH:-x86_64}"
SH
cat > "$scratch/bin/omarchy-pkg-present" <<'SH'
#!/bin/bash
[[ $* == "linux-t2" ]] || exit 99
[[ ${T2_INSTALLED:-0} == "1" ]]
SH
cat > "$scratch/bin/lspci" <<'SH'
#!/bin/bash
[[ $* == "-nn" ]] || exit 99
[[ ${PCI_FAIL:-0} == "0" ]] || exit 1
printf '%s\n' "${PCI_DEVICES:-00:02.0 VGA compatible controller: Intel [8086:1234]}"
SH
cat > "$scratch/bin/omarchy-pkg-add" <<'SH'
#!/bin/bash
printf 'add %s\n' "$*" >> "$CALL_LOG"
[[ ${INSTALL_FAIL:-0} == "0" ]]
SH
chmod +x "$scratch/bin/"*
run_leaf() {
: > "$CALL_LOG"
bash -euo pipefail "$leaf" > "$scratch/output" 2>&1
}
run_leaf
grep -Fxq 'add linux-omarchy linux-omarchy-headers' "$CALL_LOG" || fail "ordinary systems install the generic kernel and headers"
pass "ordinary x86_64 installs receive the Omarchy kernel without a Panther Lake hardware gate"
T2_INSTALLED=1 run_leaf
[[ ! -s $CALL_LOG ]] || fail "an installed T2 kernel excludes the system"
pass "hardware setup skips systems with linux-t2 installed"
for device in 1801 1802; do
PCI_DEVICES="04:00.0 Mass storage controller: Apple Inc. T2 [106b:$device]" run_leaf
[[ ! -s $CALL_LOG ]] || fail "fresh T2 hardware must not install the generic kernel"
done
pass "fresh T2 hardware is excluded before its specialized kernel has been installed"
TEST_ARCH=aarch64 run_leaf
[[ ! -s $CALL_LOG ]] || fail "ARM hardware cannot install an x86_64 kernel"
pass "ARM hardware is excluded"
if PCI_FAIL=1 run_leaf; then
fail "failed T2 hardware detection must stop kernel setup"
fi
[[ ! -s $CALL_LOG ]] || fail "unidentified hardware must not install the generic kernel"
pass "failed PCI detection prevents installing the generic kernel on unidentified hardware"
if INSTALL_FAIL=1 run_leaf; then
fail "package installation failure must fail kernel setup"
fi
pass "kernel package installation failures stop hardware setup"
kernel_line=$(grep -n 'hardware/kernel.sh' "$ROOT/install/hardware/all.sh" | cut -d: -f1)
for script in nvidia.sh intel/ipu7-camera.sh fix-elgato-camlink-4k.sh; do
driver_line=$(grep -n "hardware/$script" "$ROOT/install/hardware/all.sh" | cut -d: -f1)
(( kernel_line < driver_line )) || fail "the generic kernel is installed before $script pulls in DKMS drivers"
done
pass "kernel setup precedes NVIDIA, IPU7, and Cam Link DKMS setup"
for package in linux-omarchy linux-omarchy-headers; do
grep -Fxq "$package" "$ROOT/install/omarchy-other.packages" || fail "the ISO includes $package"
done
! grep -q 'linux-omarchy-ptl-novrr-mm' "$ROOT/install/omarchy-other.packages" || fail "the ISO must not pull in the retired PTL variant"
pass "the ISO package list includes the generic kernel and headers"
-7
View File
@@ -13,13 +13,6 @@ grep -q 'run_logged .*hardware/dell-xps13-sidecar-amps.sh' "$all" ||
fail "the sidecar amplifier workaround runs during hardware setup" fail "the sidecar amplifier workaround runs during hardware setup"
pass "the sidecar amplifier workaround runs during hardware setup" pass "the sidecar amplifier workaround runs during hardware setup"
# The apply step rebuilds the boot image, so the default kernel must be installed.
kernel_line=$(grep -n 'hardware/kernel.sh' "$all" | cut -d: -f1)
amps_line=$(grep -n 'hardware/dell-xps13-sidecar-amps.sh' "$all" | cut -d: -f1)
((kernel_line < amps_line)) ||
fail "the sidecar amplifier workaround runs after the default kernel is installed"
pass "the sidecar amplifier workaround runs after the default kernel is installed"
[[ -n $migration ]] || fail "a migration enables the workaround on existing installs" [[ -n $migration ]] || fail "a migration enables the workaround on existing installs"
pass "a migration enables the workaround on existing installs" pass "a migration enables the workaround on existing installs"