mirror of
https://github.com/theupriser/steamify-cachyos.git
synced 2026-10-03 17:41:58 +02:00
Implement kernel installation and locking function
Adds a function to install and pin a specific CachyOS kernel with verification and locking.
This commit is contained in:
1 parent
508f22acaf
commit
388b1286c9
1 file changed
+39
@@ -14,6 +14,39 @@ detect_valve_fremont() {
|
|||||||
[[ "$vendor" == "OEM" && "$product" == "F7F" ]]
|
[[ "$vendor" == "OEM" && "$product" == "F7F" ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
install_pinned_kernel() {
|
||||||
|
# Define URLs
|
||||||
|
local KERNEL_URL="https://archive.cachyos.org/archive/cachyos/linux-cachyos-7.1.6-1-x86_64.pkg.tar.zst"
|
||||||
|
local KERNEL_SIG_URL="https://archive.cachyos.org/archive/cachyos/linux-cachyos-7.1.6-1-x86_64.pkg.tar.zst.sig"
|
||||||
|
local HEADERS_URL="https://archive.cachyos.org/archive/cachyos/linux-cachyos-headers-7.1.6-1-x86_64.pkg.tar.zst"
|
||||||
|
local HEADERS_SIG_URL="https://archive.cachyos.org/archive/cachyos/linux-cachyos-headers-7.1.6-1-x86_64.pkg.tar.zst.sig"
|
||||||
|
|
||||||
|
# Extract filenames from URLs
|
||||||
|
local KERNEL_PKG=$(basename "$KERNEL_URL")
|
||||||
|
local KERNEL_SIG=$(basename "$KERNEL_SIG_URL")
|
||||||
|
local HEADERS_PKG=$(basename "$HEADERS_URL")
|
||||||
|
local HEADERS_SIG=$(basename "$HEADERS_SIG_URL")
|
||||||
|
|
||||||
|
info "Downloading CachyOS kernel packages and signatures..."
|
||||||
|
wget -c "$KERNEL_URL" "$KERNEL_SIG_URL" "$HEADERS_URL" "$HEADERS_SIG_URL" || { err "Failed to download kernel packages."; return 1; }
|
||||||
|
|
||||||
|
info "Verifying package signatures..."
|
||||||
|
if ! gpg --verify "$KERNEL_SIG" "$KERNEL_PKG" || ! gpg --verify "$HEADERS_SIG" "$HEADERS_PKG"; then
|
||||||
|
err "Signature verification failed!"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
info "Verification successful. Installing packages..."
|
||||||
|
sudo pacman -U --noconfirm "$KERNEL_PKG" "$HEADERS_PKG" || { err "Failed to install packages."; return 1; }
|
||||||
|
|
||||||
|
info "Locking the kernel packages to prevent updates..."
|
||||||
|
# This appends the kernel and headers to the IgnorePkg array in /etc/pacman.conf
|
||||||
|
sudo sed -i '/^#IgnorePkg/s/^#//' /etc/pacman.conf
|
||||||
|
sudo sed -i '/^IgnorePkg/ s/$/ linux-cachyos linux-cachyos-headers/' /etc/pacman.conf
|
||||||
|
|
||||||
|
ok "Installation complete and kernel successfully locked."
|
||||||
|
}
|
||||||
|
|
||||||
install_kernel_headers() {
|
install_kernel_headers() {
|
||||||
# DKMS can only build leds-valve against kernels whose headers are
|
# DKMS can only build leds-valve against kernels whose headers are
|
||||||
# installed. CachyOS ships several kernels (linux-cachyos, -lts, -bore,
|
# installed. CachyOS ships several kernels (linux-cachyos, -lts, -bore,
|
||||||
@@ -201,6 +234,9 @@ machine_status() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
machine_enable() {
|
machine_enable() {
|
||||||
|
# Install and pin the specific CachyOS kernel first
|
||||||
|
install_pinned_kernel || { err "Custom kernel setup failed."; return 1; }
|
||||||
|
|
||||||
ensure_aur_helper || { warn "Couldn't set up an AUR helper automatically. Install yay or paru, then run the wizard again."; return 1; }
|
ensure_aur_helper || { warn "Couldn't set up an AUR helper automatically. Install yay or paru, then run the wizard again."; return 1; }
|
||||||
install_valve_led_driver || { warn "LED driver setup ran into a problem - see errors above."; return 1; }
|
install_valve_led_driver || { warn "LED driver setup ran into a problem - see errors above."; return 1; }
|
||||||
install_headers_boot_check
|
install_headers_boot_check
|
||||||
@@ -237,6 +273,9 @@ EOF
|
|||||||
|
|
||||||
machine_disable() {
|
machine_disable() {
|
||||||
info "Removing Steam Machine support..."
|
info "Removing Steam Machine support..."
|
||||||
|
# Disables services, removes packages, and unpins the kernel
|
||||||
|
sudo sed -i '/^IgnorePkg/s/ linux-cachyos linux-cachyos-headers//' /etc/pacman.conf
|
||||||
|
sudo pacman -Syu --noconfirm linux-cachyos linux-cachyos-headers || { warn "Kernel upgrade issues."; }
|
||||||
systemctl --user disable --now steamos-manager.service 2>/dev/null
|
systemctl --user disable --now steamos-manager.service 2>/dev/null
|
||||||
sudo systemctl disable --now steamos-manager.service 2>/dev/null
|
sudo systemctl disable --now steamos-manager.service 2>/dev/null
|
||||||
sudo systemctl disable --now inputplumber.service 2>/dev/null
|
sudo systemctl disable --now inputplumber.service 2>/dev/null
|
||||||
|
|||||||
Reference in new issue
Block a user