diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 187 |
1 files changed, 85 insertions, 102 deletions
@@ -22,7 +22,7 @@ _makegconfig= # NUMA is optimized for multi-socket motherboards. # A single multi-core CPU actually runs slower with NUMA enabled. # See, https://bugs.archlinux.org/task/31187 -_NUMAdisable=y +_NUMAdisable= # Compile ONLY used modules to VASTLYreduce the number of modules built # and the build time. @@ -47,22 +47,25 @@ _1k_HZ_ticks= ### Do not edit below this line unless you know what you're doing pkgbase=linux-next-git -pkgver=20191129.r0.g419593dad843 +pkgver=20240523.r0.g3689b0ef08b7 _srcname=linux-next pkgrel=1 pkgdesc='Linux NEXT' arch=('x86_64') url="http://www.kernel.org/" -license=('GPL2') -options=('!strip') -makedepends=('kmod' 'bc' 'libelf' 'git' 'python-sphinx' 'python-sphinx_rtd_theme' - 'graphviz' 'imagemagick') -_lucjanver=5.4 +license=(GPL-2.0-only) +options=( + !debug + !strip +) +makedepends=('bc' 'libelf' 'git' 'pahole' 'cpio' 'perl' 'tar' 'xz' 'python') +_lucjanver=next #_lucjanpath="https://raw.githubusercontent.com/sirlucjan/kernel-patches/master/${_lucjanver}" _lucjanpath="https://gitlab.com/sirlucjan/kernel-patches/raw/master/${_lucjanver}" -source=("git://git.kernel.org/pub/scm/linux/kernel/git/next/${_srcname}.git" - "${_lucjanpath}/arch-patches/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch" +source=("git+https://git.kernel.org/pub/scm/linux/kernel/git/next/${_srcname}.git" + "${_lucjanpath}/arch-patches-sep/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch" + "${_lucjanpath}/arch-patches-sep/0002-arch-Kconfig-Default-to-maximum-amount-of-ASLR-bits.patch" # the main kernel config files 'config') @@ -79,8 +82,7 @@ prepare() { cd $_srcname ### Setting version - msg2 "Setting version..." - scripts/setlocalversion --save-scmversion + echo "Setting version..." echo "-$pkgrel" > localversion.10-pkgrel echo "${pkgbase#linux}" > localversion.20-pkgname @@ -89,25 +91,27 @@ prepare() { for src in "${source[@]}"; do src="${src%%::*}" src="${src##*/}" + src="${src%.zst}" [[ $src = *.patch ]] || continue - msg2 "Applying patch $src..." + echo "Applying patch $src..." patch -Np1 < "../$src" done ### Setting config - msg2 "Setting config..." + echo "Setting config..." cp ../config .config make olddefconfig + diff -u ../config .config || : ### Prepared version make -s kernelrelease > version - msg2 "Prepared %s version %s" "$pkgbase" "$(<version)" + echo "Prepared $pkgbase version $(<version)" ### Optionally use running kernel's config # code originally by nous; http://aur.archlinux.org/packages.php?ID=40191 if [ -n "$_use_current" ]; then if [[ -s /proc/config.gz ]]; then - msg2 "Extracting config from /proc/config.gz..." + echo "Extracting config from /proc/config.gz..." # modprobe configs zcat /proc/config.gz > ./.config else @@ -120,54 +124,52 @@ prepare() { ### Optionally set tickrate to 1000 if [ -n "$_1k_HZ_ticks" ]; then - msg2 "Setting tick rate to 1k..." - sed -i -e 's/^CONFIG_HZ_300=y/# CONFIG_HZ_300 is not set/' \ - -i -e 's/^# CONFIG_HZ_1000 is not set/CONFIG_HZ_1000=y/' \ - -i -e 's/^CONFIG_HZ=300/CONFIG_HZ=1000/' ./.config + echo "Setting tick rate to 1k..." + scripts/config -d HZ_300 \ + -e HZ_1000 \ + --set-val HZ 1000 fi - - ### Optionally disable NUMA for 64-bit kernels only - # (x86 kernels do not support NUMA) + + ### Disable NUMA if [ -n "$_NUMAdisable" ]; then - msg2 "Disabling NUMA from kernel config..." - sed -i -e 's/CONFIG_NUMA=y/# CONFIG_NUMA is not set/' \ - -i -e '/CONFIG_AMD_NUMA=y/d' \ - -i -e '/CONFIG_X86_64_ACPI_NUMA=y/d' \ - -i -e '/CONFIG_NODES_SPAN_OTHER_NODES=y/d' \ - -i -e '/# CONFIG_NUMA_EMU is not set/d' \ - -i -e '/CONFIG_NODES_SHIFT=6/d' \ - -i -e '/CONFIG_NEED_MULTIPLE_NODES=y/d' \ - -i -e '/# CONFIG_MOVABLE_NODE is not set/d' \ - -i -e '/CONFIG_USE_PERCPU_NUMA_NODE_ID=y/d' \ - -i -e '/CONFIG_ACPI_NUMA=y/d' ./.config + echo "Disabling NUMA from kernel config..." + scripts/config -d NUMA \ + -d AMD_NUMA \ + -d X86_64_ACPI_NUMA \ + -d NODES_SPAN_OTHER_NODES \ + -d NUMA_EMU \ + -d USE_PERCPU_NUMA_NODE_ID \ + -d ACPI_NUMA \ + -d ARCH_SUPPORTS_NUMA_BALANCING \ + -d NODES_SHIFT \ + -u NODES_SHIFT \ + -d NEED_MULTIPLE_NODES \ + -d NUMA_BALANCING \ + -d NUMA_BALANCING_DEFAULT_ENABLED fi ### Optionally load needed modules for the make localmodconfig # See https://aur.archlinux.org/packages/modprobed-db if [ -n "$_localmodcfg" ]; then if [ -f $HOME/.config/modprobed.db ]; then - msg2 "Running Steven Rostedt's make localmodconfig now" + echo "Running Steven Rostedt's make localmodconfig now" make LSMOD=$HOME/.config/modprobed.db localmodconfig else - msg2 "No modprobed.db data found" + echo "No modprobed.db data found" exit fi fi ### Running make nconfig - - [[ -z "$_makenconfig" ]] || make nconfig - + [[ -z "$_makenconfig" ]] || make nconfig + ### Running make menuconfig - [[ -z "$_makemenuconfig" ]] || make menuconfig - + ### Running make xconfig - [[ -z "$_makexconfig" ]] || make xconfig - + ### Running make gconfig - [[ -z "$_makegconfig" ]] || make gconfig ### Save configuration for later reuse @@ -177,22 +179,22 @@ prepare() { build() { cd $_srcname - make bzImage modules - make htmldocs + make all + make -C tools/bpf/bpftool vmlinux.h feature-clang-bpf-co-re=1 } _package() { pkgdesc="The $pkgdesc kernel and modules" depends=('coreutils' 'kmod' 'initramfs') - optdepends=('crda: to set the correct wireless channels of your country' + optdepends=('wireless-regdb: to set the correct wireless channels of your country' 'linux-firmware: firmware images needed for some devices' 'modprobed-db: Keeps track of EVERY kernel module that has ever been probed - useful for those of us who make localmodconfig') + provides=(VIRTUALBOX-GUEST-MODULES WIREGUARD-MODULE KSMBD-MODULE) cd $_srcname - local kernver="$(<version)" - local modulesdir="$pkgdir/usr/lib/modules/$kernver" + local modulesdir="$pkgdir/usr/lib/modules/$(<version)" - msg2 "Installing boot image..." + echo "Installing boot image..." # systemd expects to find the kernel here to allow hibernation # https://github.com/systemd/systemd/commit/edda44605f06a41fb86b7ab8128dcf99161d2344 install -Dm644 "$(make -s image_name)" "$modulesdir/vmlinuz" @@ -200,37 +202,37 @@ _package() { # Used by mkinitcpio to name the kernel echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase" - msg2 "Installing modules..." - make INSTALL_MOD_PATH="$pkgdir/usr" modules_install + echo "Installing modules..." + ZSTD_CLEVEL=19 make INSTALL_MOD_PATH="$pkgdir/usr" INSTALL_MOD_STRIP=1 \ + DEPMOD=/doesnt/exist modules_install # Suppress depmod - # remove build and source links - rm "$modulesdir"/{source,build} - - msg2 "Fixing permissions..." - chmod -Rc u=rwX,go=rX "$pkgdir" + # remove build links + rm "$modulesdir"/build } _package-headers() { pkgdesc="Headers and scripts for building modules for the $pkgdesc kernel" - depends=('linux-next-git') + depends=('linux-next-git' 'pahole') cd $_srcname local builddir="$pkgdir/usr/lib/modules/$(<version)/build" - msg2 "Installing build files..." + echo "Installing build files..." install -Dt "$builddir" -m644 .config Makefile Module.symvers System.map \ - localversion.* version vmlinux + localversion.* version vmlinux tools/bpf/bpftool/vmlinux.h install -Dt "$builddir/kernel" -m644 kernel/Makefile install -Dt "$builddir/arch/x86" -m644 arch/x86/Makefile cp -t "$builddir" -a scripts - # add objtool for external module building and enabled VALIDATION_STACK option + # required when STACK_VALIDATION is enabled install -Dt "$builddir/tools/objtool" tools/objtool/objtool - # add xfs and shmem for aufs building - mkdir -p "$builddir"/{fs/xfs,mm} + # required when DEBUG_INFO_BTF_MODULES is enabled + if [ -f tools/bpf/resolve_btfids/resolve_btfids ]; then + install -Dt "$builddir/tools/bpf/resolve_btfids" tools/bpf/resolve_btfids/resolve_btfids + fi - msg2 "Installing headers..." + echo "Installing headers..." cp -t "$builddir" -a include cp -t "$builddir/arch/x86" -a arch/x86/include install -Dt "$builddir/arch/x86/kernel" -m644 arch/x86/kernel/asm-offsets.s @@ -238,18 +240,21 @@ _package-headers() { install -Dt "$builddir/drivers/md" -m644 drivers/md/*.h install -Dt "$builddir/net/mac80211" -m644 net/mac80211/*.h - # http://bugs.archlinux.org/task/13146 + # https://bugs.archlinux.org/task/13146 install -Dt "$builddir/drivers/media/i2c" -m644 drivers/media/i2c/msp3400-driver.h - # http://bugs.archlinux.org/task/20402 + # https://bugs.archlinux.org/task/20402 install -Dt "$builddir/drivers/media/usb/dvb-usb" -m644 drivers/media/usb/dvb-usb/*.h install -Dt "$builddir/drivers/media/dvb-frontends" -m644 drivers/media/dvb-frontends/*.h install -Dt "$builddir/drivers/media/tuners" -m644 drivers/media/tuners/*.h - msg2 "Installing KConfig files..." + # https://bugs.archlinux.org/task/71392 + install -Dt "$builddir/drivers/iio/common/hid-sensors" -m644 drivers/iio/common/hid-sensors/*.h + + echo "Installing KConfig files..." find . -name 'Kconfig*' -exec install -Dm644 {} "$builddir/{}" \; - msg2 "Removing unneeded architectures..." + echo "Removing unneeded architectures..." local arch for arch in "$builddir"/arch/*/; do [[ $arch = */x86/ ]] && continue @@ -257,19 +262,19 @@ _package-headers() { rm -r "$arch" done - msg2 "Removing documentation..." + echo "Removing documentation..." rm -r "$builddir/Documentation" - msg2 "Removing broken symlinks..." + echo "Removing broken symlinks..." find -L "$builddir" -type l -printf 'Removing %P\n' -delete - msg2 "Removing loose objects..." + echo "Removing loose objects..." find "$builddir" -type f -name '*.o' -printf 'Removing %P\n' -delete - msg2 "Stripping build tools..." + echo "Stripping build tools..." local file while read -rd '' file; do - case "$(file -bi "$file")" in + case "$(file -Sib "$file")" in application/x-sharedlib\;*) # Libraries (.so) strip -v $STRIP_SHARED "$file" ;; application/x-archive\;*) # Libraries (.a) @@ -281,38 +286,15 @@ _package-headers() { esac done < <(find "$builddir" -type f -perm -u+x ! -name vmlinux -print0) - msg2 "Adding symlink..." + echo "Stripping vmlinux..." + strip -v $STRIP_STATIC "$builddir/vmlinux" + + echo "Adding symlink..." mkdir -p "$pkgdir/usr/src" ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase" - - msg2 "Fixing permissions..." - chmod -Rc u=rwX,go=rX "$pkgdir" -} - -_package-docs() { - pkgdesc="Documentation for the $pkgdesc kernel" - depends=('linux-next-git') - - cd $_srcname - local builddir="$pkgdir/usr/lib/modules/$(<version)/build" - - msg2 "Installing documentation..." - local src dst - while read -rd '' src; do - dst="${src#Documentation/}" - dst="$builddir/Documentation/${dst#output/}" - install -Dm644 "$src" "$dst" - done < <(find Documentation -name '.*' -prune -o ! -type d -print0) - - msg2 "Adding symlink..." - mkdir -p "$pkgdir/usr/share/doc" - ln -sr "$builddir/Documentation" "$pkgdir/usr/share/doc/$pkgbase" - - msg2 "Fixing permissions..." - chmod -Rc u=rwX,go=rX "$pkgdir" } -pkgname=("$pkgbase" "$pkgbase-headers" "$pkgbase-docs") +pkgname=("$pkgbase" "$pkgbase-headers") for _p in "${pkgname[@]}"; do eval "package_$_p() { $(declare -f "_package${_p#$pkgbase}") @@ -321,5 +303,6 @@ for _p in "${pkgname[@]}"; do done sha512sums=('SKIP' - '823e5be350152e9f36342229156ffd59c2632d1aab3b85b55caad15bcf1fc6c55e7a22b5b28eecb84a9e96bbc351ca1d348c2ba4b66302134919bababef16a93' - '34d66658963dbd72fa3e96f2c5d5bccafb781fa14f6ebafe7859953929ba2fbb112f1435ca68cec8389d789cf0efa81d5fc0f5ac6dfa23a704348ab83709e9db') + 'ced0e91e2e8293fa838589bb3fe3cc53f12a608297713d20a3b32793fdbfb4524d0b37e79e6ad5c9e63bce8e9ba7560f21cae17ae3b386a55c293446ef217846' + 'baa07e7b440af857ec32449ef570f50793a96da8e0b4aa6f905b048b9626ac6c10ceb9df97b42a02c550a029906efbc584eeafa30dd6faa22959bdf649ee2639' + 'c80d1ed0eb4ffc2a8638ff731f6f449b082b76f5345783cf35beb20f0a86b41ebb0d033c4ed342f84789ccfe7b7ae3a60588454b41eb241563ac8e7f5f3a5629') |