2024-09-27 20:51:43 +01:00
|
|
|
#!/bin/sh -e
|
2024-09-27 15:41:37 +01:00
|
|
|
|
|
|
|
. ../../common-script.sh
|
|
|
|
|
|
|
|
setUpRepos() {
|
|
|
|
if ! grep -q "^\s*$$jupiter-staging$$" /etc/pacman.conf; then
|
2024-09-27 20:51:43 +01:00
|
|
|
printf "%b\n" "${CYAN}Adding jupiter-staging to pacman repositories...${RC}"
|
2024-09-27 15:41:37 +01:00
|
|
|
echo "[jupiter-staging]" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf
|
2024-09-27 20:51:43 +01:00
|
|
|
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
|
2024-09-27 15:41:37 +01:00
|
|
|
fi
|
|
|
|
if ! grep -q "^\s*$$holo-staging$$" /etc/pacman.conf; then
|
2024-09-27 20:51:43 +01:00
|
|
|
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
|
2024-09-27 15:41:37 +01:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
installKernel() {
|
|
|
|
if ! "$PACKAGER" -Q | grep -q "\blinux-neptune"; then
|
2024-09-27 20:51:43 +01:00
|
|
|
printf "%b\n" "${CYAN}Installing linux-neptune..."
|
2024-09-27 15:41:37 +01:00
|
|
|
"$ESCALATION_TOOL" "$PACKAGER" -Syyu --noconfirm
|
|
|
|
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm linux-neptune linux-neptune-headers
|
2024-09-27 20:51:43 +01:00
|
|
|
"$ESCALATION_TOOL" mkinitcpio -P
|
2024-09-27 15:41:37 +01:00
|
|
|
else
|
2024-09-27 20:51:43 +01:00
|
|
|
printf "%b\n" "${GREEN}linux-neptune detected. Skipping installation.${RC}"
|
2024-09-27 15:41:37 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f /etc/default/grub ]; then
|
2024-09-27 20:51:43 +01:00
|
|
|
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
|
2024-09-27 15:41:37 +01:00
|
|
|
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
|