this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add first pass of SteamOS package script

+118
+118
.local/bin/steamos-restore-host-packages
··· 1 + #!/usr/bin/env fish 2 + 3 + set package_list \ 4 + kcm-wacomtablet \ 5 + nordvpn-bin \ 6 + touchegg \ 7 + libratbag 8 + 9 + function install_yay 10 + echo "Installing yay-bin..." 11 + # first install yay-bin to get AUR packages 12 + sudo pacman -S --noconfirm --needed git base-devel 13 + git clone https://aur.archlinux.org/yay-bin.git 14 + pushd yay-bin 15 + makepkg -si --noconfirm 16 + yay -Syu --noconfirm 17 + popd 18 + end 19 + 20 + function build_packages 21 + echo "Downloading + building packages..." 22 + for pkg in $package_list 23 + yay -G --noconfirm $pkg 24 + pushd $pkg 25 + makepkg -s --noconfirm 26 + popd 27 + end 28 + end 29 + 30 + function build_smiusbdisplay_driver 31 + yay -S --noconfirm linux-neptune-headers 32 + 33 + git clone https://github.com/ian-h-chamberlain/steamos-smiusbdisplay-drivers.git 34 + 35 + # https://github.com/ian-h-chamberlain/steamos-smiusbdisplay-drivers/blob/main/README.md#build 36 + pushd steamos-smiusbdisplay-drivers/evdi-steamos-dkms 37 + makepkg -si --noconfirm 38 + 39 + set kernel (uname -r) 40 + set evdi_version (pacman -Q evdi-steamos-dkms | cut -d' ' -f2 | cut -d- -f1) 41 + 42 + sudo dkms build evdi/$evdi_version -k $kernel 43 + 44 + # Export dkms module somewhere the host can access it 45 + sudo dkms mktarball evdi/$evdi_version -k $kernel 46 + cp /var/lib/dkms/evdi/$evdi_version/tarball/*.tar.gz .. 47 + 48 + # Build the SMI usb driver itself 49 + cd ../smiusbdisplay-driver-bin 50 + if ! makepkg -s --noconfirm 51 + echo (set_color yellow)"WARNING:"(set_color normal)" failed to build SMI USB display driver. Maybe it's already installed?" 52 + end 53 + 54 + popd 55 + end 56 + 57 + function install_packages 58 + echo "Disabling read-only filesystem..." 59 + sudo steamos-readonly disable 60 + 61 + echo "Installing packages..." 62 + cd $build_dir 63 + for pkg in $package_list 64 + pushd $pkg 65 + if ! sudo pacman -U --noconfirm *.tar.zst 66 + echo (set_color yellow)"WARNING:"(set_color normal)" failed to install $pkg!" 67 + end 68 + popd 69 + end 70 + 71 + echo "Installing SMI USB display driver..." 72 + # https://github.com/ian-h-chamberlain/steamos-smiusbdisplay-drivers/blob/main/README.md#install 73 + pushd steamos-smiusbdisplay-drivers 74 + sudo pacman -S dkms 75 + 76 + set kernel (uname -r) 77 + set evdi_version (printf *.tar.gz | cut -d- -f2) 78 + 79 + # Load and install the previously built dkms archive 80 + sudo dkms ldtarball *.tar.gz 81 + sudo dkms install evdi/$evdi_version -k $kernel 82 + 83 + # Install the built SMI usb driver 84 + cd smiusbdisplay-driver-bin 85 + if ! sudo pacman -U --noconfirm *.tar.zst 86 + echo (set_color yellow)"WARNING:"(set_color normal)" failed to install SMI USB display driver!" 87 + end 88 + 89 + popd 90 + 91 + echo "Re-enabling read-only filesystem..." 92 + sudo steamos-readonly enable 93 + end 94 + 95 + 96 + ## Main script 97 + if test -f /run/.containerenv 98 + set build_dir $argv[1] 99 + cd $build_dir 100 + install_yay 101 + build_packages 102 + build_smiusbdisplay_driver 103 + else 104 + set build_dir (mktemp -d) 105 + trap "rm -rf $build_dir" EXIT 106 + 107 + # download and build packages inside a fresh HoloISO container 108 + distrobox ephemeral -- (status --current-filename) $build_dir 109 + 110 + set response (read --prompt-str "Install packages? [Y/n]: ") 111 + if string match --quiet --regex '^[yY]?$' -- "$response" 112 + install_packages 113 + echo "Done! Reboot for installation to complete." 114 + else 115 + echo "Skipping package installation. Nothing left to do." 116 + end 117 + 118 + end