detached 0731e46

feat(kernel): add CachyOS gaming-optimized kernel with automatic repository configuration

commit
0731e46575045013d11c46eaac1197da7a2750c4
author
bnema · · 2025-10-20 04:55 UTC
parent
3c04bd9
signature
unsigned
5 files · +89 -16
M install/base/all.sh +1 -0
@@ -5,5 +5,6 @@ stop_log_output # Stop for interactive prompt
55 source "$ARCHUP_INSTALL/base/kernel.sh" # Interactive (gum choose)
66 start_log_output # Resume after prompt
77
8+run_logged "$ARCHUP_INSTALL/base/cachyos-repo.sh" # Configure CachyOS repo if needed
89 run_logged "$ARCHUP_INSTALL/base/pacstrap.sh" # Non-interactive
910 run_logged "$ARCHUP_INSTALL/base/fstab.sh" # Non-interactive
@@ -5,5 +5,6 @@ stop_log_output # Stop for interactive prompt
5 source "$ARCHUP_INSTALL/base/kernel.sh" # Interactive (gum choose)5 source "$ARCHUP_INSTALL/base/kernel.sh" # Interactive (gum choose)
6 start_log_output # Resume after prompt6 start_log_output # Resume after prompt
7 7
8+run_logged "$ARCHUP_INSTALL/base/cachyos-repo.sh" # Configure CachyOS repo if needed
8 run_logged "$ARCHUP_INSTALL/base/pacstrap.sh" # Non-interactive9 run_logged "$ARCHUP_INSTALL/base/pacstrap.sh" # Non-interactive
9 run_logged "$ARCHUP_INSTALL/base/fstab.sh" # Non-interactive10 run_logged "$ARCHUP_INSTALL/base/fstab.sh" # Non-interactive
A install/base/cachyos-repo.sh +49 -0
@@ -0,0 +1,49 @@
1+#!/bin/bash
2+# Configure CachyOS repository if linux-cachyos kernel is selected
3+
4+# Only run if linux-cachyos is selected
5+if [[ "$ARCHUP_KERNEL" != "linux-cachyos" ]]; then
6+ exit 0
7+fi
8+
9+gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring CachyOS repository..."
10+
11+# Download and import CachyOS keyring
12+echo "Downloading CachyOS keyring..." >> "$ARCHUP_INSTALL_LOG_FILE"
13+pacman-key --recv-keys F3B607488DB35A47 --keyserver keyserver.ubuntu.com >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
14+pacman-key --lsign-key F3B607488DB35A47 >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
15+
16+# Detect CPU architecture for optimal repo selection
17+CPU_LEVEL="x86-64"
18+if grep -q "avx2" /proc/cpuinfo && grep -q "fma" /proc/cpuinfo; then
19+ CPU_LEVEL="x86-64-v3"
20+ echo "Detected x86-64-v3 CPU support" >> "$ARCHUP_INSTALL_LOG_FILE"
21+else
22+ echo "Using x86-64 (generic) repository" >> "$ARCHUP_INSTALL_LOG_FILE"
23+fi
24+
25+# Add CachyOS repository to live system's pacman.conf (for pacstrap)
26+echo "Configuring CachyOS repository on live system..." >> "$ARCHUP_INSTALL_LOG_FILE"
27+
28+# Check if already configured
29+if ! grep -q "\[cachyos\]" /etc/pacman.conf; then
30+ # Add CachyOS repo before [core] repository
31+ sed -i '/^\[core\]/i \
32+# CachyOS repositories\
33+[cachyos]\
34+Include = /etc/pacman.d/cachyos-mirrorlist\
35+' /etc/pacman.conf
36+fi
37+
38+# Create mirrorlist for CachyOS
39+cat > /etc/pacman.d/cachyos-mirrorlist << 'EOF'
40+## CachyOS mirrorlist
41+Server = https://mirror.cachyos.org/repo/$arch/$repo
42+EOF
43+
44+# Sync databases
45+echo "Syncing package databases..." >> "$ARCHUP_INSTALL_LOG_FILE"
46+pacman -Sy >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
47+
48+gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] CachyOS repository configured"
49+echo "CachyOS repository enabled for $CPU_LEVEL architecture" >> "$ARCHUP_INSTALL_LOG_FILE"
@@ -0,0 +1,49 @@
1+#!/bin/bash
2+# Configure CachyOS repository if linux-cachyos kernel is selected
3+
4+# Only run if linux-cachyos is selected
5+if [[ "$ARCHUP_KERNEL" != "linux-cachyos" ]]; then
6+ exit 0
7+fi
8+
9+gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring CachyOS repository..."
10+
11+# Download and import CachyOS keyring
12+echo "Downloading CachyOS keyring..." >> "$ARCHUP_INSTALL_LOG_FILE"
13+pacman-key --recv-keys F3B607488DB35A47 --keyserver keyserver.ubuntu.com >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
14+pacman-key --lsign-key F3B607488DB35A47 >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
15+
16+# Detect CPU architecture for optimal repo selection
17+CPU_LEVEL="x86-64"
18+if grep -q "avx2" /proc/cpuinfo && grep -q "fma" /proc/cpuinfo; then
19+ CPU_LEVEL="x86-64-v3"
20+ echo "Detected x86-64-v3 CPU support" >> "$ARCHUP_INSTALL_LOG_FILE"
21+else
22+ echo "Using x86-64 (generic) repository" >> "$ARCHUP_INSTALL_LOG_FILE"
23+fi
24+
25+# Add CachyOS repository to live system's pacman.conf (for pacstrap)
26+echo "Configuring CachyOS repository on live system..." >> "$ARCHUP_INSTALL_LOG_FILE"
27+
28+# Check if already configured
29+if ! grep -q "\[cachyos\]" /etc/pacman.conf; then
30+ # Add CachyOS repo before [core] repository
31+ sed -i '/^\[core\]/i \
32+# CachyOS repositories\
33+[cachyos]\
34+Include = /etc/pacman.d/cachyos-mirrorlist\
35+' /etc/pacman.conf
36+fi
37+
38+# Create mirrorlist for CachyOS
39+cat > /etc/pacman.d/cachyos-mirrorlist << 'EOF'
40+## CachyOS mirrorlist
41+Server = https://mirror.cachyos.org/repo/$arch/$repo
42+EOF
43+
44+# Sync databases
45+echo "Syncing package databases..." >> "$ARCHUP_INSTALL_LOG_FILE"
46+pacman -Sy >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
47+
48+gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] CachyOS repository configured"
49+echo "CachyOS repository enabled for $CPU_LEVEL architecture" >> "$ARCHUP_INSTALL_LOG_FILE"
M install/base/kernel.sh +18 -15
@@ -6,13 +6,14 @@ gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Kernel Selection"
66
77 # Ask user to choose kernel
88 echo
9-gum style --padding "0 0 0 $PADDING_LEFT" "Choose your kernel:"
10-gum style --padding "0 0 0 $PADDING_LEFT" " • linux - Stable mainline kernel (recommended)"
11-gum style --padding "0 0 0 $PADDING_LEFT" " • linux-lts - Long-term support (maximum stability)"
12-gum style --padding "0 0 0 $PADDING_LEFT" " • linux-zen - Performance-optimized (gaming/desktop)"
13-echo
14-
15-KERNEL_CHOICE=$(gum choose --padding "0 0 1 $PADDING_LEFT" "linux" "linux-lts" "linux-zen")
9+KERNEL_CHOICE=$(gum choose --padding "0 0 1 $PADDING_LEFT" \
10+ "linux - Stable mainline kernel (recommended)" \
11+ "linux-lts - Long-term support (maximum stability)" \
12+ "linux-zen - Performance-optimized for general use" \
13+ "linux-cachyos - Gaming-optimized")
14+
15+# Extract just the kernel name (before the dash)
16+KERNEL_CHOICE=$(echo "$KERNEL_CHOICE" | awk '{print $1}')
1617 export ARCHUP_KERNEL="$KERNEL_CHOICE"
1718
1819 gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Selected: $ARCHUP_KERNEL"
@@ -89,27 +90,29 @@ if [ "$CPU_TYPE" = "AMD" ]; then
8990 fi
9091
9192 echo
92- gum style --padding "0 0 0 $PADDING_LEFT" "AMD P-State modes:"
93- # Only show descriptions for available modes
93+ # Build choice options with descriptions
94+ declare -a MODE_CHOICES
9495 for mode in "${AVAILABLE_MODES[@]}"; do
9596 case "$mode" in
9697 active)
97- gum style --padding "0 0 0 $PADDING_LEFT" " • active - CPPC (best performance, desktop/gaming)"
98+ MODE_CHOICES+=("active - CPPC (best performance, desktop/gaming)")
9899 ;;
99100 guided)
100- gum style --padding "0 0 0 $PADDING_LEFT" " • guided - Balanced (laptop/hybrid use)"
101+ MODE_CHOICES+=("guided - Balanced (laptop/hybrid use)")
101102 ;;
102103 passive)
103- gum style --padding "0 0 0 $PADDING_LEFT" " • passive - Acpi-cpufreq replacement (compatibility)"
104+ MODE_CHOICES+=("passive - Acpi-cpufreq replacement (compatibility)")
104105 ;;
105106 esac
106107 done
107108 echo
108- gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "Note: CPU governors will be available after reboot"
109- gum style --padding "0 0 1 $PADDING_LEFT" " and depend on the P-State mode selected"
109+ gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "Note: CPU governors will be available after reboot and depend on the P-State mode selected"
110110 echo
111111
112- AMD_PSTATE=$(gum choose --padding "0 0 1 $PADDING_LEFT" "${AVAILABLE_MODES[@]}")
112+ AMD_PSTATE=$(gum choose --padding "0 0 1 $PADDING_LEFT" "${MODE_CHOICES[@]}")
113+
114+ # Extract just the mode name (before the dash)
115+ AMD_PSTATE=$(echo "$AMD_PSTATE" | awk '{print $1}')
113116 export ARCHUP_AMD_PSTATE="$AMD_PSTATE"
114117 gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] P-State: $AMD_PSTATE"
115118 echo "AMD P-State: $AMD_PSTATE (kernel parameter)" >> "$ARCHUP_INSTALL_LOG_FILE"
@@ -6,13 +6,14 @@ gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Kernel Selection"
6 6
7 # Ask user to choose kernel7 # Ask user to choose kernel
8 echo8 echo
9-gum style --padding "0 0 0 $PADDING_LEFT" "Choose your kernel:"9+KERNEL_CHOICE=$(gum choose --padding "0 0 1 $PADDING_LEFT" \
10-gum style --padding "0 0 0 $PADDING_LEFT" " • linux - Stable mainline kernel (recommended)"10+ "linux - Stable mainline kernel (recommended)" \
11-gum style --padding "0 0 0 $PADDING_LEFT" " • linux-lts - Long-term support (maximum stability)"11+ "linux-lts - Long-term support (maximum stability)" \
12-gum style --padding "0 0 0 $PADDING_LEFT" " • linux-zen - Performance-optimized (gaming/desktop)"12+ "linux-zen - Performance-optimized for general use" \
13-echo13+ "linux-cachyos - Gaming-optimized")
14-14+
15-KERNEL_CHOICE=$(gum choose --padding "0 0 1 $PADDING_LEFT" "linux" "linux-lts" "linux-zen")15+# Extract just the kernel name (before the dash)
16+KERNEL_CHOICE=$(echo "$KERNEL_CHOICE" | awk '{print $1}')
16 export ARCHUP_KERNEL="$KERNEL_CHOICE"17 export ARCHUP_KERNEL="$KERNEL_CHOICE"
17 18
18 gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Selected: $ARCHUP_KERNEL"19 gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Selected: $ARCHUP_KERNEL"
@@ -89,27 +90,29 @@ if [ "$CPU_TYPE" = "AMD" ]; then
89 fi90 fi
90 91
91 echo92 echo
92- gum style --padding "0 0 0 $PADDING_LEFT" "AMD P-State modes:"93+ # Build choice options with descriptions
93- # Only show descriptions for available modes94+ declare -a MODE_CHOICES
94 for mode in "${AVAILABLE_MODES[@]}"; do95 for mode in "${AVAILABLE_MODES[@]}"; do
95 case "$mode" in96 case "$mode" in
96 active)97 active)
97- gum style --padding "0 0 0 $PADDING_LEFT" " • active - CPPC (best performance, desktop/gaming)"98+ MODE_CHOICES+=("active - CPPC (best performance, desktop/gaming)")
98 ;;99 ;;
99 guided)100 guided)
100- gum style --padding "0 0 0 $PADDING_LEFT" " • guided - Balanced (laptop/hybrid use)"101+ MODE_CHOICES+=("guided - Balanced (laptop/hybrid use)")
101 ;;102 ;;
102 passive)103 passive)
103- gum style --padding "0 0 0 $PADDING_LEFT" " • passive - Acpi-cpufreq replacement (compatibility)"104+ MODE_CHOICES+=("passive - Acpi-cpufreq replacement (compatibility)")
104 ;;105 ;;
105 esac106 esac
106 done107 done
107 echo108 echo
108- gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "Note: CPU governors will be available after reboot"109+ gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "Note: CPU governors will be available after reboot and depend on the P-State mode selected"
109- gum style --padding "0 0 1 $PADDING_LEFT" " and depend on the P-State mode selected"
110 echo110 echo
111 111
112- AMD_PSTATE=$(gum choose --padding "0 0 1 $PADDING_LEFT" "${AVAILABLE_MODES[@]}")112+ AMD_PSTATE=$(gum choose --padding "0 0 1 $PADDING_LEFT" "${MODE_CHOICES[@]}")
113+
114+ # Extract just the mode name (before the dash)
115+ AMD_PSTATE=$(echo "$AMD_PSTATE" | awk '{print $1}')
113 export ARCHUP_AMD_PSTATE="$AMD_PSTATE"116 export ARCHUP_AMD_PSTATE="$AMD_PSTATE"
114 gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] P-State: $AMD_PSTATE"117 gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] P-State: $AMD_PSTATE"
115 echo "AMD P-State: $AMD_PSTATE (kernel parameter)" >> "$ARCHUP_INSTALL_LOG_FILE"118 echo "AMD P-State: $AMD_PSTATE (kernel parameter)" >> "$ARCHUP_INSTALL_LOG_FILE"
M install/base/pacstrap.sh +20 -0
@@ -31,3 +31,23 @@ pacstrap /mnt "${packages[@]}"
3131 gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Base system installed"
3232
3333 echo "Installed ${#packages[@]} packages" >> "$ARCHUP_INSTALL_LOG_FILE"
34+
35+# Configure CachyOS repository in installed system if linux-cachyos was selected
36+if [[ "$ARCHUP_KERNEL" == "linux-cachyos" ]]; then
37+ echo "Configuring CachyOS repository in installed system..." >> "$ARCHUP_INSTALL_LOG_FILE"
38+
39+ # Add CachyOS repo before [core] repository
40+ if ! grep -q "\[cachyos\]" /mnt/etc/pacman.conf; then
41+ sed -i '/^\[core\]/i \
42+# CachyOS repositories\
43+[cachyos]\
44+Include = /etc/pacman.d/cachyos-mirrorlist\
45+' /mnt/etc/pacman.conf
46+ fi
47+
48+ # Copy mirrorlist to installed system
49+ mkdir -p /mnt/etc/pacman.d
50+ cp /etc/pacman.d/cachyos-mirrorlist /mnt/etc/pacman.d/cachyos-mirrorlist
51+
52+ echo "CachyOS repository configured in installed system" >> "$ARCHUP_INSTALL_LOG_FILE"
53+fi
@@ -31,3 +31,23 @@ pacstrap /mnt "${packages[@]}"
31 gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Base system installed"31 gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Base system installed"
32 32
33 echo "Installed ${#packages[@]} packages" >> "$ARCHUP_INSTALL_LOG_FILE"33 echo "Installed ${#packages[@]} packages" >> "$ARCHUP_INSTALL_LOG_FILE"
34+
35+# Configure CachyOS repository in installed system if linux-cachyos was selected
36+if [[ "$ARCHUP_KERNEL" == "linux-cachyos" ]]; then
37+ echo "Configuring CachyOS repository in installed system..." >> "$ARCHUP_INSTALL_LOG_FILE"
38+
39+ # Add CachyOS repo before [core] repository
40+ if ! grep -q "\[cachyos\]" /mnt/etc/pacman.conf; then
41+ sed -i '/^\[core\]/i \
42+# CachyOS repositories\
43+[cachyos]\
44+Include = /etc/pacman.d/cachyos-mirrorlist\
45+' /mnt/etc/pacman.conf
46+ fi
47+
48+ # Copy mirrorlist to installed system
49+ mkdir -p /mnt/etc/pacman.d
50+ cp /etc/pacman.d/cachyos-mirrorlist /mnt/etc/pacman.d/cachyos-mirrorlist
51+
52+ echo "CachyOS repository configured in installed system" >> "$ARCHUP_INSTALL_LOG_FILE"
53+fi
M install/partitioning/format.sh +1 -1
@@ -33,7 +33,7 @@ if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then
3333 --pbkdf argon2id \
3434 --iter-time 2000 \
3535 --label ARCHUP_LUKS \
36- --stdin \
36+ --key-file - \
3737 "$ARCHUP_ROOT_PART" <<< "$ARCHUP_PASSWORD" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
3838
3939 echo "LUKS container created" >> "$ARCHUP_INSTALL_LOG_FILE"
@@ -33,7 +33,7 @@ if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then
33 --pbkdf argon2id \33 --pbkdf argon2id \
34 --iter-time 2000 \34 --iter-time 2000 \
35 --label ARCHUP_LUKS \35 --label ARCHUP_LUKS \
36- --stdin \36+ --key-file - \
37 "$ARCHUP_ROOT_PART" <<< "$ARCHUP_PASSWORD" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&137 "$ARCHUP_ROOT_PART" <<< "$ARCHUP_PASSWORD" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
38 38
39 echo "LUKS container created" >> "$ARCHUP_INSTALL_LOG_FILE"39 echo "LUKS container created" >> "$ARCHUP_INSTALL_LOG_FILE"

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 0

    ↑↓ moveenter openesc close