deck_boot/post_upgrade.sh

127 lines
4.2 KiB
Bash
Executable file

#!/bin/bash
# Sōon Yoru <yoru@serialexperiments.club>
set -e
if test $(id -u) != 0; then
echo must be root!
exit 1
fi
steamos-readonly disable
cd "$(dirname "$0")"
install() {
if [ $1 == '--fromfile' ]; then
shift
pacman -U --noconfirm $@
else
pacman -S --overwrite "*" --noconfirm $@
fi
}
aur_install() {
pikaur --user-id 1000 \
--xdg-cache-home /home/deck/.cache/ \
--xdg-data-home /home/deck/.local/share/ \
--pikaur-config /home/deck/.config/pikaur.conf \
-S --noedit --nodiff --overwrite "*" --noconfirm $@
}
uninstall() {
if [ $1 == '--force' ]; then
shift
pacman -Rcns --noconfirm $@ || true
elif [ $1 == '--nodeps' ]; then
shift
pacman -Rdd --noconfirm $@ || true
elif [ $1 == '--orphans' ]; then
pacman -Rcns --noconfirm $(pacman -Qqtd)
else
pacman -Qi $@ >/dev/null 2>&1 && pacman -Rcns --noconfirm $@ || true
fi
}
# Run the original SteamOS post upgrade script
/usr/lib/steamos/steamos-post-update
# If this script fails, I don't want it to run again
rm -fv /var/lib/steamos-atomupd/system-updated
cp -fv 10-ptrace.conf /etc/sysctl.d/
cp -fv mglru.conf /etc/tmpfiles.d/
cp -fv memlock.conf /etc/security/limits.d/
cp -fv locale.gen /etc/
mkdir -p /usr/lib/firmware/edid/
cp -fv ultrawide70.bin /usr/lib/firmware/edid/ultrawide.bin
cp -fv grub /etc/default/grub
pacman-key --init
pacman-key --populate archlinux holo
cp -fv pacman.conf /etc/
cp -fv makepkg.conf /etc/
pacman -Sy
if test ! -f /usr/include/bash/general.h; then
pacman -S --noconfirm bash
fi
install --needed $(pacman -Ss linux-neptune | grep installed | head -1 | cut -d' ' -f1)-headers
install --needed plymouth
if ! grep -rin ultrawide.bin /boot/efi/EFI/steamos/grub.cfg; then
grub-mkconfig -o /boot/efi/EFI/steamos/grub.cfg
fi
# some c headers are missing in the default installation
# needed to build programs
if test ! -f /usr/include/bits/types.h; then
install --asdeps glibc lib32-glibc linux-api-headers hidapi libx11 libpulse glib2 gtk3 gtk4 graphene pango gdk-pixbuf2 cairo atk libffi libtiff libpng libjpeg fontconfig freetype2 libxcb harfbuzz pixman zlib xz zstd libxrender libxdmcp libxau libxext xorgproto util-linux-libs graphite brotli expat fribidi libxft libthai libdatrie libxrandr libxcursor libxfixes libxcomposite libxinerama libxkbcommon libxi libxdamage libxtst libcloudproviders libepoxy wayland libglvnd dbus at-spi2-core libwnck3 libxres shared-mime-info qt5-base qt5-tools python python-gobject libnotify libsysprof-capture pcre2 bzip2 vulkan-headers vulkan-icd-loader # systemd-libs
fi
install --needed base-devel devtools cmake extra-cmake-modules git fish
chsh -s /usr/bin/fish deck
install --needed xfce4 network-manager-applet nm-connection-editor xfce4-eyes-plugin xfce4-sensors-plugin thunar-archive-plugin thunar-volman xfce4-screenshooter xfce4-taskmanager gnome-software gvfs mousepad blueman gnome-calculator ffmpegthumbnailer ristretto engrampa
cp -fv xfce4-steamos-oneshot.desktop /usr/share/xsessions/
cp -fv startplasma-steamos-oneshot /usr/bin/
cp -fv steamos-session-select /usr/bin/
cp -fv steam-jupiter /usr/bin/
cp -fv custom.conf /etc/atomic-update.conf.d/
# free space in /
uninstall noto-fonts-cjk
uninstall ttf-dejavu
uninstall podman
uninstall ibus
uninstall --force plasma kde-applications
rm -rfv $(find /usr/share/locale/* -maxdepth 1 -type d -not -name en_US -not -name pt_BR)
rm -rfv $(find /usr/share/wallpapers/* -maxdepth 1 -type d -not -name Shell)
if test ! -f /usr/bin/pikaur; then
if test ! -d pikaur; then
sudo -u deck git clone https://aur.archlinux.org/pikaur.git
fi
pushd pikaur
git clean -fdx
install --asdeps --needed python-hatchling python-build python-wheel python-installer python-setuptools python-markdown-it-py pyalpm
sudo -u deck makepkg -f
install --fromfile pikaur*.tar.zst
popd
fi
aur_install --needed xfce4-pulseaudio-plugin-allow150 openrgb-bin firedragon-bin colordf backup-conf keybase-bin
install --needed python python-pip veracrypt geany virtualbox telegram-desktop easyeffects lsp-plugins-lv2 audacity
# split due wrong size check
install --needed wine winetricks
#sudo -u deck wineboot -u
# clean
uninstall --orphans
aur_install -cc
systemctl reboot