From 8e2850c3a1c7210c790edfd493f2d35d083b7e6c Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Fri, 27 Sep 2024 16:41:37 +0200 Subject: [PATCH 1/8] Linux Neptune installation script --- core/tabs/system-setup/arch/linux-neptune.sh | 60 ++++++++++++++++++++ core/tabs/system-setup/tab_data.toml | 6 ++ tui/src/state.rs | 1 + 3 files changed, 67 insertions(+) create mode 100755 core/tabs/system-setup/arch/linux-neptune.sh diff --git a/core/tabs/system-setup/arch/linux-neptune.sh b/core/tabs/system-setup/arch/linux-neptune.sh new file mode 100755 index 00000000..d3f98d41 --- /dev/null +++ b/core/tabs/system-setup/arch/linux-neptune.sh @@ -0,0 +1,60 @@ +#! /bin/sh -e + +. ../../common-script.sh + +setUpRepos() { + if ! grep -q "^\s*$$jupiter-staging$$" /etc/pacman.conf; then + printf "%b\n" "${CYAN}Adding jupiter-staging to pacman repositories...${RC}" + echo "[jupiter-staging]" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf + echo "Server = https://steamdeck-packages.steamos.cloud/archlinux-mirror/\$repo/os/\$arch" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf + echo "SigLevel = Never" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf + fi + if ! grep -q "^\s*$$holo-staging$$" /etc/pacman.conf; then + printf "%b\n" "${CYAN}Adding holo-staging to pacman repositories...${RC}" + echo "[holo-staging]" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf + echo "Server = https://steamdeck-packages.steamos.cloud/archlinux-mirror/\$repo/os/\$arch" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf + echo "SigLevel = Never" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf + fi +} + +installKernel() { + if ! "$PACKAGER" -Q | grep -q "\blinux-neptune"; then + printf "%b\n" "${CYAN}Installing linux-neptune..." + "$ESCALATION_TOOL" "$PACKAGER" -Syyu --noconfirm + "$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm linux-neptune linux-neptune-headers + "$ESCALATION_TOOL" mkinitcpio -P + else + printf "%b\n" "${GREEN}linux-neptune detected. Skipping installation.${RC}" + fi + + if [ -f /etc/default/grub ]; then + printf "%b\n" "${CYAN}Updating GRUB...${RC}" + if ! grep -q '^UPDATEDEFAULT=' /etc/default/grub; then + echo 'UPDATEDEFAULT=yes' | sudo tee -a /etc/default/grub + else + sudo sed -i 's/^UPDATEDEFAULT=.*/UPDATEDEFAULT=yes/' /etc/default/grub + fi + if [ -f /boot/grub/grub.cfg ]; then + "$ESCALATION_TOOL" grub-mkconfig -o /boot/grub/grub.cfg + else + printf "%b\n" "${RED}GRUB configuration file not found. Run grub-mkconfig manually.${RC}" + fi + else + printf "%b\n" "${RED}GRUB not detected. Manually set your bootloader to use linux-neptune.${RC}" + fi +} + +copyFirmwareFiles() { + printf "%b\n" "${CYAN}Copying firmware files...${RC}" + "$ESCALATION_TOOL" mkdir -p /usr/lib/firmware/cirrus + "$ESCALATION_TOOL" cp /usr/lib/firmware/cs35l41-dsp1-spk-cali.bin /usr/lib/firmware/cirrus/ + "$ESCALATION_TOOL" cp /usr/lib/firmware/cs35l41-dsp1-spk-cali.wmfw /usr/lib/firmware/cirrus/ + "$ESCALATION_TOOL" cp /usr/lib/firmware/cs35l41-dsp1-spk-prot.bin /usr/lib/firmware/cirrus/ + "$ESCALATION_TOOL" cp /usr/lib/firmware/cs35l41-dsp1-spk-prot.wmfw /usr/lib/firmware/cirrus/ +} + +checkEnv +checkEscalationTool +setUpRepos +installKernel +copyFirmwareFiles diff --git a/core/tabs/system-setup/tab_data.toml b/core/tabs/system-setup/tab_data.toml index a68d2fdf..6a413902 100644 --- a/core/tabs/system-setup/tab_data.toml +++ b/core/tabs/system-setup/tab_data.toml @@ -15,6 +15,12 @@ description = "This command installs a minimal arch server setup under 5 minutes script = "arch/server-setup.sh" task_list = "SI D" +[[data.entries]] +name ="Linux Neptune for SteamDeck" +description = "Valve's fork of Linux Kernel for the SteamDeck" +script = "arch/linux-neptune.sh" +task_list = "I PFM K" + [[data.entries]] name = "Paru AUR Helper" description = "Paru is your standard pacman wrapping AUR helper with lots of features and minimal interaction.\nTo know more about AUR helpers visit: https://wiki.archlinux.org/title/AUR_helpers" diff --git a/tui/src/state.rs b/tui/src/state.rs index 4aee0aaa..623bd740 100644 --- a/tui/src/state.rs +++ b/tui/src/state.rs @@ -28,6 +28,7 @@ D - disk modifications (ex. partitioning) (privileged) FI - flatpak installation FM - file modification I - installation (privileged) +K - kernel modifications (privileged) MP - package manager actions SI - full system installation SS - systemd actions (privileged) From 96876d673a91eeff7617fdd5b3b3cc5f0395133f Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Fri, 27 Sep 2024 21:51:43 +0200 Subject: [PATCH 2/8] fixed some stuff that's not supposed to be here Co-authored-by: nnyyxxxx --- core/tabs/system-setup/arch/linux-neptune.sh | 44 ++++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/core/tabs/system-setup/arch/linux-neptune.sh b/core/tabs/system-setup/arch/linux-neptune.sh index d3f98d41..cc2f2e58 100755 --- a/core/tabs/system-setup/arch/linux-neptune.sh +++ b/core/tabs/system-setup/arch/linux-neptune.sh @@ -1,44 +1,44 @@ -#! /bin/sh -e +#!/bin/sh -e . ../../common-script.sh setUpRepos() { if ! grep -q "^\s*$$jupiter-staging$$" /etc/pacman.conf; then - printf "%b\n" "${CYAN}Adding jupiter-staging to pacman repositories...${RC}" + printf "%b\n" "${CYAN}Adding jupiter-staging to pacman repositories...${RC}" echo "[jupiter-staging]" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf - echo "Server = https://steamdeck-packages.steamos.cloud/archlinux-mirror/\$repo/os/\$arch" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf - echo "SigLevel = Never" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf + echo "Server = https://steamdeck-packages.steamos.cloud/archlinux-mirror/\$repo/os/\$arch" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf + echo "SigLevel = Never" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf fi if ! grep -q "^\s*$$holo-staging$$" /etc/pacman.conf; then - printf "%b\n" "${CYAN}Adding holo-staging to pacman repositories...${RC}" - echo "[holo-staging]" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf - echo "Server = https://steamdeck-packages.steamos.cloud/archlinux-mirror/\$repo/os/\$arch" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf - echo "SigLevel = Never" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf + printf "%b\n" "${CYAN}Adding holo-staging to pacman repositories...${RC}" + echo "[holo-staging]" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf + echo "Server = https://steamdeck-packages.steamos.cloud/archlinux-mirror/\$repo/os/\$arch" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf + echo "SigLevel = Never" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf fi } installKernel() { if ! "$PACKAGER" -Q | grep -q "\blinux-neptune"; then - printf "%b\n" "${CYAN}Installing linux-neptune..." + printf "%b\n" "${CYAN}Installing linux-neptune..." "$ESCALATION_TOOL" "$PACKAGER" -Syyu --noconfirm "$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm linux-neptune linux-neptune-headers - "$ESCALATION_TOOL" mkinitcpio -P + "$ESCALATION_TOOL" mkinitcpio -P else - printf "%b\n" "${GREEN}linux-neptune detected. Skipping installation.${RC}" + printf "%b\n" "${GREEN}linux-neptune detected. Skipping installation.${RC}" fi if [ -f /etc/default/grub ]; then - printf "%b\n" "${CYAN}Updating GRUB...${RC}" - if ! grep -q '^UPDATEDEFAULT=' /etc/default/grub; then - echo 'UPDATEDEFAULT=yes' | sudo tee -a /etc/default/grub - else - sudo sed -i 's/^UPDATEDEFAULT=.*/UPDATEDEFAULT=yes/' /etc/default/grub - fi - if [ -f /boot/grub/grub.cfg ]; then - "$ESCALATION_TOOL" grub-mkconfig -o /boot/grub/grub.cfg - else - printf "%b\n" "${RED}GRUB configuration file not found. Run grub-mkconfig manually.${RC}" - fi + printf "%b\n" "${CYAN}Updating GRUB...${RC}" + if ! grep -q '^UPDATEDEFAULT=' /etc/default/grub; then + echo 'UPDATEDEFAULT=yes' | "$ESCALATION_TOOL" tee -a /etc/default/grub + else + "$ESCALATION_TOOL" sed -i 's/^UPDATEDEFAULT=.*/UPDATEDEFAULT=yes/' /etc/default/grub + fi + if [ -f /boot/grub/grub.cfg ]; then + "$ESCALATION_TOOL" grub-mkconfig -o /boot/grub/grub.cfg + else + printf "%b\n" "${RED}GRUB configuration file not found. Run grub-mkconfig manually.${RC}" + fi else printf "%b\n" "${RED}GRUB not detected. Manually set your bootloader to use linux-neptune.${RC}" fi From c8aee416668f46bf4dc526b5bc6e93b30fada6f5 Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Sat, 28 Sep 2024 13:41:52 +0200 Subject: [PATCH 3/8] fix repo check --- core/tabs/system-setup/arch/linux-neptune.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/tabs/system-setup/arch/linux-neptune.sh b/core/tabs/system-setup/arch/linux-neptune.sh index cc2f2e58..93d204f9 100755 --- a/core/tabs/system-setup/arch/linux-neptune.sh +++ b/core/tabs/system-setup/arch/linux-neptune.sh @@ -3,13 +3,13 @@ . ../../common-script.sh setUpRepos() { - if ! grep -q "^\s*$$jupiter-staging$$" /etc/pacman.conf; then + if ! grep -q "^\s*\[jupiter-staging\]" /etc/pacman.conf; then printf "%b\n" "${CYAN}Adding jupiter-staging to pacman repositories...${RC}" echo "[jupiter-staging]" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf echo "Server = https://steamdeck-packages.steamos.cloud/archlinux-mirror/\$repo/os/\$arch" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf echo "SigLevel = Never" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf fi - if ! grep -q "^\s*$$holo-staging$$" /etc/pacman.conf; then + if ! grep -q "^\s*\[holo-staging\]" /etc/pacman.conf; then printf "%b\n" "${CYAN}Adding holo-staging to pacman repositories...${RC}" echo "[holo-staging]" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf echo "Server = https://steamdeck-packages.steamos.cloud/archlinux-mirror/\$repo/os/\$arch" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf From b3865960789fccf1fffbad6b0ca3deca4f578d85 Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Sat, 28 Sep 2024 21:24:09 +0200 Subject: [PATCH 4/8] added audio patches https://github.com/ChrisTitusTech/linutil/issues/269#issuecomment-2380379049 --- core/tabs/system-setup/arch/linux-neptune.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tabs/system-setup/arch/linux-neptune.sh b/core/tabs/system-setup/arch/linux-neptune.sh index 93d204f9..30d4b134 100755 --- a/core/tabs/system-setup/arch/linux-neptune.sh +++ b/core/tabs/system-setup/arch/linux-neptune.sh @@ -21,7 +21,7 @@ installKernel() { if ! "$PACKAGER" -Q | grep -q "\blinux-neptune"; then printf "%b\n" "${CYAN}Installing linux-neptune..." "$ESCALATION_TOOL" "$PACKAGER" -Syyu --noconfirm - "$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm linux-neptune linux-neptune-headers + "$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm linux-neptune linux-neptune-headers steamdeck-dsp jupiter-staging/alsa-ucm-conf "$ESCALATION_TOOL" mkinitcpio -P else printf "%b\n" "${GREEN}linux-neptune detected. Skipping installation.${RC}" From b318a14662addb5639cc260e2621b931bf188f84 Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Sun, 29 Sep 2024 20:55:51 +0200 Subject: [PATCH 5/8] add linux neptune to docs (userguide) --- docs/userguide.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/userguide.md b/docs/userguide.md index b72a9aa0..638ec924 100644 --- a/docs/userguide.md +++ b/docs/userguide.md @@ -11,9 +11,10 @@ ### Arch Setup +- **Server Setup**: Installs Arch Linux. +- **Linux Neptune**: Installs [Linux Neptune](https://github.com/neptune-mirror/linux-neptune) (Valve's fork of the Linux Kernel) for the [Steam Deck](https://wiki.archlinux.org/title/Steam_Deck). - **Paru Setup**: Installs the Paru AUR helper. - **Yay Setup**: Installs the Yay AUR helper. -- **Server Setup**: Installs Arch Linux. ### Fedora Setup From 1dc748fa490b3bbf277942828db7e145e16311af Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Tue, 1 Oct 2024 00:37:19 +0200 Subject: [PATCH 6/8] steamdeck precondition Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com> --- core/tabs/system-setup/tab_data.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/tabs/system-setup/tab_data.toml b/core/tabs/system-setup/tab_data.toml index 6a413902..5a27e656 100644 --- a/core/tabs/system-setup/tab_data.toml +++ b/core/tabs/system-setup/tab_data.toml @@ -21,6 +21,11 @@ description = "Valve's fork of Linux Kernel for the SteamDeck" script = "arch/linux-neptune.sh" task_list = "I PFM K" +[[data.preconditions]] +matches = true +data = { file = "/sys/devices/virtual/dmi/id/board_vendor" } +values = [ "Valve", "Jupiter" ] + [[data.entries]] name = "Paru AUR Helper" description = "Paru is your standard pacman wrapping AUR helper with lots of features and minimal interaction.\nTo know more about AUR helpers visit: https://wiki.archlinux.org/title/AUR_helpers" From 62330334dedc94ab58eaae80e8f3da4c5ad274a4 Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Thu, 3 Oct 2024 12:22:00 +0200 Subject: [PATCH 7/8] precondition fix --- core/tabs/system-setup/tab_data.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tabs/system-setup/tab_data.toml b/core/tabs/system-setup/tab_data.toml index 5a27e656..faa498dd 100644 --- a/core/tabs/system-setup/tab_data.toml +++ b/core/tabs/system-setup/tab_data.toml @@ -24,7 +24,7 @@ task_list = "I PFM K" [[data.preconditions]] matches = true data = { file = "/sys/devices/virtual/dmi/id/board_vendor" } -values = [ "Valve", "Jupiter" ] +values = [ "Valve" ] [[data.entries]] name = "Paru AUR Helper" From 70d5b584ac733584c6893ddf8df7c6b0d76c081f Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Thu, 3 Oct 2024 15:05:31 +0200 Subject: [PATCH 8/8] another precondition fix --- core/tabs/system-setup/tab_data.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tabs/system-setup/tab_data.toml b/core/tabs/system-setup/tab_data.toml index faa498dd..ed2d5f51 100644 --- a/core/tabs/system-setup/tab_data.toml +++ b/core/tabs/system-setup/tab_data.toml @@ -21,7 +21,7 @@ description = "Valve's fork of Linux Kernel for the SteamDeck" script = "arch/linux-neptune.sh" task_list = "I PFM K" -[[data.preconditions]] +[[data.entries.preconditions]] matches = true data = { file = "/sys/devices/virtual/dmi/id/board_vendor" } values = [ "Valve" ]