diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 00000000000000..0e488ab2c11552 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,202 @@ +# Maintainer: Jan Alexander Steffens (heftig) +# Maintainer: KenHV + +pkgbase=linux-kensur +pkgver=5.19.9.kensur1 +pkgrel=1 +pkgdesc='Linux' +_srctag=v${pkgver%.*}-${pkgver##*.} +arch=(x86_64) +license=(GPL2) +makedepends=( + bc libelf pahole cpio perl tar xz +) + +options=('!strip') + +export KBUILD_BUILD_HOST=archlinux +export KBUILD_BUILD_USER=$pkgbase +export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})" + +[ -z ${personal+x} ] && personal=n +[ -z ${ci+x} ] && ci=n +[ -z ${lto+x} ] && lto=n +[ -z ${ccache+x} ] && ccache=n +[ -z ${clean+x} ] && clean=n + +prepare() { + cd .. + + echo "Setting config..." + make kensur_defconfig + + if [ "$ci" = "n" ]; then + vendor=$(lscpu | awk '/Vendor ID/{print $3}') + if [[ "$vendor" == "GenuineIntel" || "$vendor" == "AuthenticAMD" ]]; then + echo "CPU: $(lscpu | awk '/Model name/{ print substr($0, index($0,$3)) }')" + echo "Applying optimizations..." + scripts/config -d GENERIC_CPU + scripts/config --set-val NR_CPUS $(nproc --all) + scripts/config --set-val VGA_ARB_MAX_GPUS $(lspci | grep -E "VGA|3D" | wc -l) + + if [[ "$vendor" == "GenuineIntel" ]]; then + scripts/config -e MNATIVE_INTEL + elif [[ "$vendor" == "AuthenticAMD" ]]; then + scripts/config -e MNATIVE_AMD + fi + fi + fi + + if [ "$personal" = "y" ]; then + echo "Applying personal config..." + scripts/config -d DRM_AMDGPU + scripts/config -d DRM_NOUVEAU + scripts/config -d DRM_RADEON + scripts/config -d GENERIC_CPU + scripts/config -e MSKYLAKE + scripts/config --set-val NR_CPUS 8 + scripts/config --set-val VGA_ARB_MAX_GPUS 2 + fi + + if [ "$lto" = "y" ]; then + echo "Enabling Clang Full LTO..." + scripts/config -e LTO_CLANG_FULL + fi + + if [ "$clean" = "y" ]; then + echo "Clearing ccache..." + rm -rf /tmp/ccache/* + fi + + make -s kernelrelease > version + echo "Prepared $pkgbase version $(