diff --git a/PKGBUILD b/PKGBUILD index e49ad58..e84fdbf 100755 --- a/PKGBUILD +++ b/PKGBUILD @@ -4,7 +4,7 @@ pkgbase=linux-charcoal-616 _nepbase=linux-neptune-616 -_tag=6.16.12-valve21 +_tag=6.16.12-valve23 _ver=3 pkgver=${_tag//-/.}.cc$_ver pkgrel=1 @@ -96,7 +96,7 @@ source=( 6.16-poc-selector-v2.6.1.patch 6.16-nap-v0.4.0.patch ) -sha256sums=('a69eea3b189ab64e65608140d6cd7c57823d1b39b361e876197eec1b4d1db957' +sha256sums=('4011d16fef57b8f04cbcddc0937819f7fd32225f65d63698afbd5dc6629d0ff0' '37452b4d09e5e42134ae24a61f2f656790837c327268074cf79d7dab3558b972' 'd88eaf0f94bae470040e4882f334c05b1bb2ab0a99e4b7299aa0b2337810ab8d' 'fd57213c524e24cd9c72e2fecd9b2005934b6099e209864e5a93eb03406fca21' diff --git a/README.md b/README.md index c55286f..ba02c3b 100644 --- a/README.md +++ b/README.md @@ -61,13 +61,20 @@ Charcoal is an optimized Linux kernel for Steam Deck, Asus ROG Ally, and other A ## Install -Download the [latest release](https://github.com/V10lator/linux-charcoal/releases/latest) and run the following on your device: +Run the following on your device to automatically download and install the latest release: + +```bash +curl -L https://github.com/V10lator/linux-charcoal/raw/master/install.sh | bash +``` + +Or manually download the [latest release](https://github.com/V10lator/linux-charcoal/releases/latest) and run: ```bash cd ~/Downloads -sudo steamos-readonly disable -sudo pacman -U linux-charcoal-*-x86_64.pkg.tar.zst # Confirm when asked to remove linux-neptune-* -sudo steamos-readonly enable +sudo steamos-devmode enable --no-prompt +pacman -Qq | grep '^linux-neptune' | xargs -r sudo pacman -Rns --noconfirm +sudo pacman -U linux-charcoal-*-x86_64.pkg.tar.zst +sudo grub-mkconfig -o /efi/EFI/steamos/grub.cfg rm linux-charcoal* ``` @@ -87,14 +94,20 @@ You can also verify in Gaming Mode under **Settings → System**, where the kern ## Uninstall -To remove Charcoal and return to the stock Neptune kernel: +Run the following to automatically remove Charcoal and restore the Neptune kernel: + +```bash +curl -L https://github.com/V10lator/linux-charcoal/raw/master/uninstall.sh | bash +``` + +Or manually: ```bash -sudo steamos-readonly disable -_neptune=$(pacman -Qi $(pacman -Qq 'linux-charcoal*') | awk '/^Replaces/{print $3}') -sudo pacman -Rsn $(pacman -Qq 'linux-charcoal*') +sudo steamos-devmode enable --no-prompt +_neptune=$(pacman -Qi $(pacman -Qq | grep '^linux-charcoal' | grep -v headers | head -1) | grep '^Replaces' | tr ' ' '\n' | grep '^linux-neptune' | head -1) +sudo pacman -Rsn $(pacman -Qq | grep '^linux-charcoal') sudo pacman -S "$_neptune" -sudo steamos-readonly enable +sudo grub-mkconfig -o /efi/EFI/steamos/grub.cfg ``` Then reboot. diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..a4687a9 --- /dev/null +++ b/install.sh @@ -0,0 +1,50 @@ +#!/usr/bin/bash + +if [ "$EUID" -eq 0 ]; then + echo "Please do not run as root" + exit 1 +fi + +echo "Fetching latest Charcoal release..." +RELEASE_JSON=$(curl -s https://api.github.com/repos/V10lator/linux-charcoal/releases/latest) +PKG_URL=$(echo "$RELEASE_JSON" | grep "browser_download_url" | grep -v "headers" | grep "x86_64.pkg.tar.zst" | cut -d '"' -f 4) +HEADERS_URL=$(echo "$RELEASE_JSON" | grep "browser_download_url" | grep "headers" | grep "x86_64.pkg.tar.zst" | cut -d '"' -f 4) + +if [ -z "$PKG_URL" ] || [ -z "$HEADERS_URL" ]; then + echo "Failed to fetch release URLs" + exit 1 +fi + +echo "Downloading kernel..." +curl -L "$PKG_URL" -o /tmp/linux-charcoal.pkg.tar.zst + +echo "Downloading headers..." +curl -L "$HEADERS_URL" -o /tmp/linux-charcoal-headers.pkg.tar.zst + +echo "Enabling dev mode (disables read-only filesystem and initialises keyring)..." +sudo steamos-devmode enable --no-prompt + +echo "Removing existing Neptune kernel..." +_original_neptune=$(pacman -Qq | grep '^linux-neptune' | grep -v headers | head -1) +pacman -Qq | grep '^linux-neptune' | xargs -r sudo pacman -Rns --noconfirm + +echo "Installing Charcoal kernel..." +if ! sudo pacman -U --noconfirm /tmp/linux-charcoal.pkg.tar.zst /tmp/linux-charcoal-headers.pkg.tar.zst; then + echo "Install failed — restoring original Neptune kernel..." + sudo pacman -S --noconfirm "$_original_neptune" + rm -f /tmp/linux-charcoal*.pkg.tar.zst + exit 1 +fi + +# Save original neptune for uninstall script to restore correctly +echo "$_original_neptune" | sudo tee /etc/charcoal-original-neptune > /dev/null + +echo "Updating GRUB..." +sudo grub-mkconfig -o /efi/EFI/steamos/grub.cfg + +echo "Cleaning up..." +rm -f /tmp/linux-charcoal*.pkg.tar.zst + +echo "" +echo "Done! Reboot to use the Charcoal kernel." +echo "Verify after reboot with: uname -a" diff --git a/uninstall.sh b/uninstall.sh new file mode 100755 index 0000000..73a5179 --- /dev/null +++ b/uninstall.sh @@ -0,0 +1,44 @@ +#!/usr/bin/bash + +if [ "$EUID" -eq 0 ]; then + echo "Please do not run as root" + exit 1 +fi + +if ! pacman -Qq | grep -q '^linux-charcoal'; then + echo "Charcoal kernel is not installed" + exit 1 +fi + +# Use the originally installed neptune saved during install if available, +# otherwise fall back to the series from Charcoal's Replaces field +if [ -f /etc/charcoal-original-neptune ]; then + _neptune=$(cat /etc/charcoal-original-neptune) + echo "Restoring originally installed Neptune kernel: $_neptune" +else + _neptune=$(pacman -Qi $(pacman -Qq | grep '^linux-charcoal' | grep -v headers | head -1) | grep '^Replaces' | tr ' ' '\n' | grep '^linux-neptune' | head -1) + echo "Will reinstall: $_neptune (original not recorded, using Charcoal's Replaces field)" +fi + +if [ -z "$_neptune" ]; then + echo "Failed to detect Neptune kernel to restore" + exit 1 +fi + +echo "Enabling dev mode (disables read-only filesystem and initialises keyring)..." +sudo steamos-devmode enable --no-prompt + +echo "Removing Charcoal kernel..." +sudo pacman -Rsn --noconfirm $(pacman -Qq | grep '^linux-charcoal') + +echo "Reinstalling Neptune kernel..." +sudo pacman -S --noconfirm "$_neptune" + +echo "Updating GRUB..." +sudo grub-mkconfig -o /efi/EFI/steamos/grub.cfg + +sudo rm -f /etc/charcoal-original-neptune + +echo "" +echo "Done! Reboot to return to the Neptune kernel." +echo "Verify after reboot with: uname -a"