Created
April 9, 2020 04:11
-
-
Save xnumad/66c315922731aebab4d6680ba5ebf660 to your computer and use it in GitHub Desktop.
lqxtcheck-V1 found at https://textuploader.com/1khof
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
_fileloc=$HOME/lqxcheck #Where to keep the pkgs | |
_CHROOT=$HOME/chroot #Where do you want the chroot | |
_nproc=$(nproc) #How many threads to compile on | |
if [[ $EUID -ne 0 ]]; then | |
echo "Give me the root password:" | |
sudo echo "Thanks" | |
fi | |
mkdir $_fileloc | |
cd $_fileloc | |
if [ ! -f "/etc/systemd/system/lqxcheck.timer" ] || [ ! -f "/etc/systemd/system/lqxcheck.service" ] || [ ! -f "/usr/bin/lqxcheck.sh" ]; then | |
( | |
echo [Unit] | |
echo Description=Calls lqxcheck.service on boot and hourly | |
echo [Timer] | |
echo OnBootSec=5min | |
echo OnUnitActiveSec=60min | |
echo [Install] | |
echo WantedBy=timers.target | |
) > lqxcheck.timer | |
( | |
echo [Unit] | |
echo Description=Builds updated linux-lqx packages in a chroot and then packages the resulting kernel into linux-lqx-bin for AUR use | |
echo [Service] | |
echo ExecStart=usr/bin/lqxcheck | |
) > lqxcheck.service | |
sudo cp * /etc/systemd/system/ | |
( | |
echo "#"!/bin/bash | |
echo cd $_fileloc | |
echo arch-nspawn $_CHROOT/root pacman -Syu | |
echo wget -O PKGBUILD https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=linux-lqx | |
echo makechrootpkg -r $_CHROOT #excluded -c to make use of ccache and preload #-n | |
) > lqxcheck.sh | |
sudo cp lqxcheck.sh /usr/bin/lqxcheck.sh | |
rm * | |
if ! pacman -Qg base-devel devtools > /dev/null; then | |
sudo pacman -S base-devel devtools --needed | |
fi | |
mkdir $_CHROOT | |
sudo mkarchroot $_CHROOT/root base-devel ccache preload | |
sudo arch-nspawn $_CHROOT/root sed 's/"#"MAKEFLAGS=-j1/MAKEFLAGS=-j$(_nproc)/g' /etc/makepkg.conf && sed 's/BUILDENV=(!distcc color !ccache check !sign)/BUILDENV=(!distcc color ccache check !sign)/g' /etc/makepkg.conf && sed 's/COMPRESSXZ="(xz -c -z -)"/COMPRESSXZ="(xz -c -z - --threads=0)"/g' /etc/makepkg.conf && systemctl enable --now preload | |
sudo systemctl enable --now lqxcheck.timer | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://aur.archlinux.org/packages/linux-lqx/#pinned-763286