diff options
author | P.Jung | 2021-08-15 17:22:45 +0000 |
---|---|---|
committer | P.Jung | 2021-08-15 17:22:45 +0000 |
commit | 2f56ac6a8b4c27fa46dee26e3c98e05c79009719 (patch) | |
tree | 7e836d0e7748c8c2285541a973d3838bd56727a1 | |
parent | ef7dd2eced4de13b51e8e12bea43b9372f3aabf9 (diff) | |
download | aur-2f56ac6a8b4c27fa46dee26e3c98e05c79009719.tar.gz |
compile fix
-rw-r--r-- | .SRCINFO | 19 | ||||
-rw-r--r-- | PKGBUILD | 492 |
2 files changed, 234 insertions, 277 deletions
@@ -1,7 +1,7 @@ pkgbase = linux-cacule-rdb pkgdesc = Linux-CacULE-RDB Kernel by Hamad Marri and with some other patchsets pkgver = 5.13.11 - pkgrel = 1 + pkgrel = 2 url = https://github.com/hamadmarri/cacule-cpu-scheduler arch = x86_64 arch = x86_64_v3 @@ -19,8 +19,7 @@ pkgbase = linux-cacule-rdb makedepends = tar makedepends = xz options = !strip - source = https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.13.tar.xz - source = https://cdn.kernel.org/pub/linux/kernel/v5.x/patch-5.13.11.xz + source = https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.13.11.tar.xz source = config source = https://raw.githubusercontent.com/ptr1337/linux-cacule-aur/master/patches/5.13/arch-patches-v4/0001-arch-patches.patch source = https://raw.githubusercontent.com/ptr1337/linux-cacule-aur/master/patches/CacULE/v5.13/cacule-5.13.patch @@ -40,15 +39,13 @@ pkgbase = linux-cacule-rdb source = https://raw.githubusercontent.com/ptr1337/linux-cacule-aur/master/patches/5.13/pf-patches-v9/0001-pf-patches.patch source = https://raw.githubusercontent.com/ptr1337/linux-cacule-aur/master/patches/5.13/lru-patches-v7/0001-lru-patches.patch source = https://raw.githubusercontent.com/ptr1337/linux-cacule-aur/master/patches/5.13/ntfs3-patches-v2/0001-ntfs3-patches.patch - source = https://raw.githubusercontent.com/ptr1337/linux-cacule-aur/master/patches/5.13/lrng-patches/0001-lrng-patches-v2.patch source = https://raw.githubusercontent.com/ptr1337/linux-cacule-aur/master/patches/5.13/security-patches/0001-security-patches.patch source = https://raw.githubusercontent.com/ptr1337/linux-cacule-aur/master/patches/5.13/alsa-patches/0001-alsa-patches.patch source = https://raw.githubusercontent.com/ptr1337/linux-cacule-aur/master/patches/5.13/zstd-upstream-patches/0001-zstd-upstream-patches.patch source = https://raw.githubusercontent.com/ptr1337/linux-cacule-aur/master/patches/5.13/zstd-patches-v5/0001-zstd-patches.patch source = https://raw.githubusercontent.com/ptr1337/linux-cacule-aur/master/patches/5.13/clearlinux-patches-v2/0001-clearlinux-patches.patch source = https://raw.githubusercontent.com/ptr1337/linux-cacule-aur/master/patches/5.13/v4l2loopback-patches-v2/0001-v4l2loopback-patches.patch - md5sums = 76c60fb304510a7bbd9c838790bc5fe4 - md5sums = 33b12686c6f185e49a35c45e233d558e + md5sums = 89020a90124a6798054a03c7a2ead059 md5sums = bb15c4c539a601d9593289b78ca9a6d9 md5sums = 5a1e1af6bd9993ad250c070f90870b78 md5sums = 078da517ec2d54283af81d7da3af671a @@ -68,7 +65,6 @@ pkgbase = linux-cacule-rdb md5sums = f9b3c2263204ebfae89f29b83278b54b md5sums = e84f0dadb9e7487fac39541c5bd85d7a md5sums = b6623f818462d08b03fdc1b573c90e9f - md5sums = 2b2be59407dd342f1cea80602a93b6c0 md5sums = 9977ba0e159416108217a45438ebebb4 md5sums = 92e9db1a7777666a1e6353b4760f1275 md5sums = 9e5114dba6da65e8d444aa225b109a21 @@ -77,15 +73,18 @@ pkgbase = linux-cacule-rdb md5sums = 08590776013d05bc7a96ef5557c54200 pkgname = linux-cacule-rdb - pkgdesc = The Linux-CacULE-RDB Kernel by Hamad Marri and with some other patchsets kernel and modules + pkgdesc = The Linux-CacULE-RDB Kernel by Hamad Marri and with some other patchsets and modules depends = coreutils depends = kmod depends = initramfs optdepends = crda: to set the correct wireless channels of your country optdepends = linux-firmware: firmware images needed for some devices - optdepends = 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 provides = WIREGUARD-MODULE + replaces = virtualbox-guest-modules-arch + replaces = wireguard-arch pkgname = linux-cacule-rdb-headers - pkgdesc = Headers and scripts for building modules for the Linux-CacULE-RDB Kernel by Hamad Marri and with some other patchsets kernel + pkgdesc = Headers and scripts for building modules for the Linux-CacULE-RDB Kernel by Hamad Marri and with some other patchsets + depends = linux-cacule-rdb=5.13.11 + depends = pahole @@ -18,7 +18,7 @@ _500_HZ_ticks= ### Enable protect file mappings under memory pressure _mm_protect=y ### Enable Linux Random Number Generator -_lrng_enable= +#_lrng_enable=y # Tweak kernel options prior to a build via nconfig _makenconfig= @@ -39,35 +39,16 @@ _localmodcfg= # a new kernel is released, but again, convenient for package bumps. _use_current= - -# Only compile active modules to VASTLY reduce the number of modules built and -# the build time. -# -# To keep track of which modules are needed for your specific system/hardware, -# give module_db a try: https://aur.archlinux.org/packages/modprobed-db -# This PKGBUILD reads the database kept if it exists -# -# More at this wiki page ---> https://wiki.archlinux.org/index.php/Modprobed-db -_localmodcfg= - -# Use the current kernel's .config file -# Enabling this option will use the .config of the RUNNING kernel rather than -# the ARCH defaults. Useful when the package gets updated and you already went -# through the trouble of customizing your config options. NOT recommended when -# a new kernel is released, but again, convenient for package bumps. -_use_current= - ### IMPORTANT: Do no edit below this line unless you know what you're doing -_major=5.13 -_minor=11 -_srcname=linux-${_major} pkgbase=linux-cacule-rdb -pkgver=${_major}.${_minor} -#pkgver=${_major} -pkgrel=1 +pkgname=("${pkgbase}" "${pkgbase}-headers") +pkgver=5.13.11 +pkgrel=2 +arch=(x86_64 x86_64_v3) +pkgdesc='Linux Kernel with cacule scheduler and lto compiled' +_gittag=v${pkgver%.*}-${pkgver##*.} pkgdesc='Linux-CacULE-RDB Kernel by Hamad Marri and with some other patchsets' -arch=('x86_64' 'x86_64_v3') url="https://github.com/hamadmarri/cacule-cpu-scheduler" license=('GPL2') makedepends=('kmod' 'bc' 'libelf' 'python-sphinx' 'python-sphinx_rtd_theme' @@ -76,52 +57,50 @@ options=('!strip') _patchsource="https://raw.githubusercontent.com/ptr1337/linux-cacule-aur/master/patches/5.13" _caculepatches="https://raw.githubusercontent.com/ptr1337/linux-cacule-aur/master/patches/CacULE" source=( - "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-${_major}.tar.xz" - "https://cdn.kernel.org/pub/linux/kernel/v5.x/patch-${pkgver}.xz" - "config" - "${_patchsource}/arch-patches-v4/0001-arch-patches.patch" - "${_caculepatches}/v5.13/cacule-5.13.patch" - "${_patchsource}/cpu-patches/0001-cpu-patches.patch" - "${_patchsource}/futex-patches/0001-futex-resync-from-gitlab.collabora.com.patch" - "${_patchsource}/futex2-xanmod-patches-v3/0001-futex2-resync-from-gitlab.collabora.com.patch" - "${_patchsource}/winesync/5.13-winesync.patch" - "${_patchsource}/xanmod-patches-v2/0001-xanmod-patches.patch" - "${_patchsource}/zen-patches/0001-zen-patches.patch" - "${_patchsource}/lqx-patches-v3/0001-lqx-patches.patch" - "${_patchsource}/bfq-patches-v6/0001-bfq-patches.patch" - "${_patchsource}/block-patches-v2/0001-block-patches.patch" - "${_patchsource}/fixes-miscellaneous/0001-fixes-miscellaneous.patch" - "${_patchsource}/bbr2-patches-v2/0001-bbr2-patches.patch" - "${_patchsource}/btrfs-patches-v2/0001-btrfs-patches.patch" - "${_patchsource}/android-patches/0001-android-export-symbold-and-enable-building-ashmem-an.patch" - "${_patchsource}/pf-patches-v9/0001-pf-patches.patch" - "${_patchsource}/lru-patches-v7/0001-lru-patches.patch" - "${_patchsource}/ntfs3-patches-v2/0001-ntfs3-patches.patch" - "${_patchsource}/lrng-patches/0001-lrng-patches-v2.patch" - "${_patchsource}/security-patches/0001-security-patches.patch" - "${_patchsource}/alsa-patches/0001-alsa-patches.patch" - "${_patchsource}/zstd-upstream-patches/0001-zstd-upstream-patches.patch" - "${_patchsource}/zstd-patches-v5/0001-zstd-patches.patch" - "${_patchsource}/clearlinux-patches-v2/0001-clearlinux-patches.patch" - "${_patchsource}/v4l2loopback-patches-v2/0001-v4l2loopback-patches.patch" +"https://cdn.kernel.org/pub/linux/kernel/v${pkgver:0:1}.x/linux-${pkgver}.tar.xz" +"config" +"${_patchsource}/arch-patches-v4/0001-arch-patches.patch" +"${_caculepatches}/v5.13/cacule-5.13.patch" +"${_patchsource}/cpu-patches/0001-cpu-patches.patch" +"${_patchsource}/futex-patches/0001-futex-resync-from-gitlab.collabora.com.patch" +"${_patchsource}/futex2-xanmod-patches-v3/0001-futex2-resync-from-gitlab.collabora.com.patch" +"${_patchsource}/winesync/5.13-winesync.patch" +"${_patchsource}/xanmod-patches-v2/0001-xanmod-patches.patch" +"${_patchsource}/zen-patches/0001-zen-patches.patch" +"${_patchsource}/lqx-patches-v3/0001-lqx-patches.patch" +"${_patchsource}/bfq-patches-v6/0001-bfq-patches.patch" +"${_patchsource}/block-patches-v2/0001-block-patches.patch" +"${_patchsource}/fixes-miscellaneous/0001-fixes-miscellaneous.patch" +"${_patchsource}/bbr2-patches-v2/0001-bbr2-patches.patch" +"${_patchsource}/btrfs-patches-v2/0001-btrfs-patches.patch" +"${_patchsource}/android-patches/0001-android-export-symbold-and-enable-building-ashmem-an.patch" +"${_patchsource}/pf-patches-v9/0001-pf-patches.patch" +"${_patchsource}/lru-patches-v7/0001-lru-patches.patch" +"${_patchsource}/ntfs3-patches-v2/0001-ntfs3-patches.patch" +#"${_patchsource}/lrng-patches/0001-lrng-patches-v2.patch" +"${_patchsource}/security-patches/0001-security-patches.patch" +"${_patchsource}/alsa-patches/0001-alsa-patches.patch" +"${_patchsource}/zstd-upstream-patches/0001-zstd-upstream-patches.patch" +"${_patchsource}/zstd-patches-v5/0001-zstd-patches.patch" +"${_patchsource}/clearlinux-patches-v2/0001-clearlinux-patches.patch" +"${_patchsource}/v4l2loopback-patches-v2/0001-v4l2loopback-patches.patch" ) export KBUILD_BUILD_HOST=archlinux -export KBUILD_BUILD_USER=$pkgbase +export KBUILD_BUILD_USER="${pkgbase}" export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})" prepare() { - cd ${_srcname} + cd "${srcdir:?}/linux-${pkgver}" || ( + echo -e "\E[1;31mCan't cd to ${srcdir:?}/linux-${pkgver} directory! Prepare failed! \E[0m" + exit 1 + ) - ### Add upstream patches - echo "Add upstream patches" - patch -Np1 -i ../patch-${pkgver} - - ### Setting version - echo "Setting version..." - scripts/setlocalversion --save-scmversion - echo "-$pkgrel" > localversion.10-pkgrel - echo "${pkgbase#linux}" > localversion.20-pkgname + ### Setting version + echo "Setting version..." + scripts/setlocalversion --save-scmversion + echo "-$pkgrel" > localversion.10-pkgrel + echo "${pkgbase#linux}" > localversion.20-pkgname local src for src in "${source[@]}"; do @@ -132,120 +111,89 @@ prepare() { patch -Np1 < "../$src" done - ### Setting config echo "Setting config..." - cp "${srcdir}"/config .config + cp ../config .config + make olddefconfig ### CPU_ARCH SCRIPT ## - source "${startdir}"/configure - cpu_arch - - ### Optionally set tickrate to 2000HZ - if [ -n "$_2k_HZ_ticks" ]; then - echo "Setting tick rate to 2k..." - scripts/config --disable CONFIG_HZ_300 - scripts/config --enable CONFIG_HZ_2000 - scripts/config --set-val CONFIG_HZ 2000 - fi - - ### Optionally set tickrate to 1000 - if [ -n "$_1k_HZ_ticks" ]; then - echo "Setting tick rate to 1k..." - scripts/config --disable CONFIG_HZ_300 - scripts/config --enable CONFIG_HZ_1000 - scripts/config --set-val CONFIG_HZ 1000 - fi - - ### Optionally set tickrate to 500HZ - if [ -n "$_500_HZ_ticks" ]; then - echo "Setting tick rate to 500HZ..." - scripts/config --disable CONFIG_HZ_300 - scripts/config --enable CONFIG_HZ_500 - scripts/config --set-val CONFIG_HZ 500 - fi - - ### Optionally disable NUMA for 64-bit kernels only - # (x86 kernels do not support NUMA) - if [ -n "$_NUMAdisable" ]; then - echo "Disabling NUMA from kernel config..." - scripts/config --disable CONFIG_NUMA - fi - - if [ -n "$_winesync" ]; then - echo "Enable winesync support" - scripts/config --module CONFIG_WINESYNC - fi - - ### Set performance governor - if [ -n "$_per_gov" ]; then - echo "Setting performance governor..." - scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL - scripts/config --enable CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE - echo "Disabling uneeded governors..." - scripts/config --enable CONFIG_CPU_FREQ_GOV_ONDEMAND - scripts/config --disable CONFIG_CPU_FREQ_GOV_CONSERVATIVE - scripts/config --disable CONFIG_CPU_FREQ_GOV_USERSPACE - scripts/config --disable CONFIG_CPU_FREQ_GOV_SCHEDUTIL - fi - - ### Enable protect file mappings under memory pressure - if [ -n "$_mm_protect" ]; then - echo "Enabling protect file mappings under memory pressure..." - scripts/config --enable CONFIG_UNEVICTABLE_FILE - scripts/config --set-val CONFIG_UNEVICTABLE_FILE_KBYTES_LOW 262144 - scripts/config --set-val CONFIG_UNEVICTABLE_FILE_KBYTES_MIN 131072 - scripts/config --enable CONFIG_UNEVICTABLE_ANON - scripts/config --set-val CONFIG_UNEVICTABLE_ANON_KBYTES_LOW 65536 - scripts/config --set-val CONFIG_UNEVICTABLE_ANON_KBYTES_MIN 32768 + source "${startdir}"/configure + + cpu_arch + ### Optionally set tickrate to 2000HZ + if [ -n "$_2k_HZ_ticks" ]; then + echo "Setting tick rate to 2k..." + scripts/config --disable CONFIG_HZ_300 + scripts/config --enable CONFIG_HZ_2000 + scripts/config --set-val CONFIG_HZ 2000 fi + ### Optionally set tickrate to 1000 + if [ -n "$_1k_HZ_ticks" ]; then + echo "Setting tick rate to 1k..." + scripts/config --disable CONFIG_HZ_300 + scripts/config --enable CONFIG_HZ_1000 + scripts/config --set-val CONFIG_HZ 1000 + fi + + ### Optionally set tickrate to 500HZ + if [ -n "$_500_HZ_ticks" ]; then + echo "Setting tick rate to 500HZ..." + scripts/config --disable CONFIG_HZ_300 + scripts/config --enable CONFIG_HZ_500 + scripts/config --set-val CONFIG_HZ 500 + fi + + ### Optionally disable NUMA for 64-bit kernels only + # (x86 kernels do not support NUMA) + if [ -n "$_NUMAdisable" ]; then + echo "Disabling NUMA from kernel config..." + scripts/config --disable CONFIG_NUMA + fi + + if [ -n "$_winesync" ]; then + echo "Enable winesync support" + scripts/config --module CONFIG_WINESYNC + fi - ### Enable Linux Random Number Generator - if [ -n "$_lrng_enable" ]; then - echo "Enabling Linux Random Number Generator ..." - scripts/config --enable CONFIG_LRNG - scripts/config --disable CONFIG_LRNG_OVERSAMPLE_ENTROPY_SOURCES - scripts/config --set-val CONFIG_CONFIG_LRNG_OVERSAMPLE_ES_BITS 0 - scripts/config --set-val CONFIG_LRNG_SEED_BUFFER_INIT_ADD_BITS 0 - scripts/config --enable CONFIG_LRNG_CONTINUOUS_COMPRESSION_ENABLED - scripts/config --disable CONFIG_LRNG_CONTINUOUS_COMPRESSION_DISABLED - scripts/config --disable CONFIG_LRNG_SWITCHABLE_CONTINUOUS_COMPRESSION - scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_32 - scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_256 - scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_512 - scripts/config --enable CONFIG_LRNG_COLLECTION_SIZE_1024 - scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_2048 - scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_4096 - scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_8192 - scripts/config --set-val CONFIG_LRNG_COLLECTION_SIZE 1024 - scripts/config --disable CONFIG_LRNG_HEALTH_TESTS - scripts/config --set-val CONFIG_LRNG_RCT_CUTOFF 31 - scripts/config --set-val CONFIG_LRNG_APT_CUTOFF 325 - scripts/config --set-val CONFIG_LRNG_IRQ_ENTROPY_RATE 256 - scripts/config --enable CONFIG_LRNG_JENT - scripts/config --set-val CONFIG_LRNG_JENT_ENTROPY_RATE 16 - scripts/config --set-val CONFIG_LRNG_CPU_ENTROPY_RATE 8 - scripts/config --disable CONFIG_LRNG_DRNG_SWITCH - scripts/config --disable CONFIG_LRNG_DRBG - scripts/config --disable CONFIG_LRNG_TESTING_MENU - scripts/config --disable CONFIG_LRNG_SELFTEST - fi - echo "Enable Anbox" - scripts/config --module CONFIG_ASHMEM - scripts/config --enable CONFIG_ANDROID_BINDER_IPC_SELFTEST - scripts/config --enable CONFIG_ANDROID - scripts/config --enable CONFIG_ANDROID_BINDER_IPC - scripts/config --enable CONFIG_ANDROID_BINDERFS - scripts/config --set-str CONFIG_ANDROID_BINDER_DEVICES binder,hwbinder,vndbinder - echo "Disabling TCP_CONG_CUBIC..." - scripts/config --module CONFIG_TCP_CONG_CUBIC - scripts/config --disable CONFIG_DEFAULT_CUBIC - echo "Enabling TCP_CONG_BBR2..." - scripts/config --enable CONFIG_TCP_CONG_BBR2 - scripts/config --enable CONFIG_DEFAULT_BBR2 - scripts/config --set-str CONFIG_DEFAULT_TCP_CONG bbr2 - echo "Enable VHBA-Module" - scripts/config --module CONFIG_VHBA + ### Set performance governor + if [ -n "$_per_gov" ]; then + echo "Setting performance governor..." + scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL + scripts/config --enable CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE + echo "Disabling uneeded governors..." + scripts/config --enable CONFIG_CPU_FREQ_GOV_ONDEMAND + scripts/config --disable CONFIG_CPU_FREQ_GOV_CONSERVATIVE + scripts/config --disable CONFIG_CPU_FREQ_GOV_USERSPACE + scripts/config --disable CONFIG_CPU_FREQ_GOV_SCHEDUTIL + fi + + ### Enable protect file mappings under memory pressure + if [ -n "$_mm_protect" ]; then + echo "Enabling protect file mappings under memory pressure..." + scripts/config --enable CONFIG_UNEVICTABLE_FILE + scripts/config --set-val CONFIG_UNEVICTABLE_FILE_KBYTES_LOW 262144 + scripts/config --set-val CONFIG_UNEVICTABLE_FILE_KBYTES_MIN 131072 + scripts/config --enable CONFIG_UNEVICTABLE_ANON + scripts/config --set-val CONFIG_UNEVICTABLE_ANON_KBYTES_LOW 65536 + scripts/config --set-val CONFIG_UNEVICTABLE_ANON_KBYTES_MIN 32768 + fi + + echo "Enable Anbox" + scripts/config --module CONFIG_ASHMEM + scripts/config --enable CONFIG_ANDROID_BINDER_IPC_SELFTEST + scripts/config --enable CONFIG_ANDROID + scripts/config --enable CONFIG_ANDROID_BINDER_IPC + scripts/config --enable CONFIG_ANDROID_BINDERFS + scripts/config --set-str CONFIG_ANDROID_BINDER_DEVICES binder,hwbinder,vndbinder + echo "Disabling TCP_CONG_CUBIC..." + scripts/config --module CONFIG_TCP_CONG_CUBIC + scripts/config --disable CONFIG_DEFAULT_CUBIC + echo "Enabling TCP_CONG_BBR2..." + scripts/config --enable CONFIG_TCP_CONG_BBR2 + scripts/config --enable CONFIG_DEFAULT_BBR2 + scripts/config --set-str CONFIG_DEFAULT_TCP_CONG bbr2 + echo "Enable VHBA-Module" + scripts/config --module CONFIG_VHBA ### Optionally use running kernel's config # code originally by nous; http://aur.archlinux.org/packages.php?ID=40191 @@ -284,123 +232,134 @@ prepare() { } build() { - cd $_srcname + cd "${srcdir:?}/linux-${pkgver}" || ( + echo -e "\E[1;31mCan't cd to ${srcdir:?}/linux-${pkgver} directory! Build failed! \E[0m" + exit 1 + ) make all } -_package() { - pkgdesc="The $pkgdesc kernel and modules" - depends=('coreutils' 'kmod' 'initramfs') - optdepends=('crda: 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) +package_linux-cacule-rdb() { + pkgdesc="The ${pkgdesc} and modules" + depends=(coreutils kmod initramfs) + optdepends=('crda: to set the correct wireless channels of your country' + 'linux-firmware: firmware images needed for some devices') + provides=(VIRTUALBOX-GUEST-MODULES WIREGUARD-MODULE) + replaces=(virtualbox-guest-modules-arch wireguard-arch) + + cd "${srcdir:?}/linux-${pkgver}" || ( + echo -e "\E[1;31mCan't cd to ${srcdir:?}/linux-${pkgver} directory! Package linux kernel failed! \E[0m" + exit 1 + ) - cd $_srcname + local kernver="$(<version)" + local modulesdir="${pkgdir:?}/usr/lib/modules/$kernver" - local kernver="$(<version)" - local modulesdir="$pkgdir/usr/lib/modules/$kernver" + 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" - 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" + # Used by mkinitcpio to name the kernel + echo "${pkgbase}" | install -Dm644 /dev/stdin "${modulesdir}/pkgbase" - # Used by mkinitcpio to name the kernel - echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase" + echo "Installing modules..." + make INSTALL_MOD_PATH="${pkgdir:?}/usr" INSTALL_MOD_STRIP=1 modules_install - echo "Installing modules..." - make INSTALL_MOD_PATH="$pkgdir/usr" modules_install + # remove build and source links + rm "${modulesdir}/"{source,build} - # remove build and source links - rm "$modulesdir"/{source,build} } -_package-headers() { - pkgdesc="Headers and scripts for building modules for the $pkgdesc kernel" +package_linux-cacule-rdb-headers() { - cd ${_srcname} - local builddir="$pkgdir/usr/lib/modules/$(<version)/build" + pkgdesc="Headers and scripts for building modules for the ${pkgdesc}" + depends=("linux-cacule-rdb=${pkgver}" pahole) - echo "Installing build files..." - install -Dt "$builddir" -m644 .config Makefile Module.symvers System.map \ - localversion.* version vmlinux - install -Dt "$builddir/kernel" -m644 kernel/Makefile - install -Dt "$builddir/arch/x86" -m644 arch/x86/Makefile - cp -t "$builddir" -a scripts + cd "${srcdir:?}/linux-${pkgver}" || ( + echo -e "\E[1;31mCan't cd to ${srcdir:?}/linux-${pkgver} directory! Package linux headers failed! \E[0m" + exit 1 + ) - # add objtool for external module building and enabled VALIDATION_STACK option - install -Dt "$builddir/tools/objtool" tools/objtool/objtool + local builddir="${pkgdir:?}/usr/lib/modules/$(<version)/build" - # add xfs and shmem for aufs building - mkdir -p "$builddir"/{fs/xfs,mm} + echo "Installing build files..." + install -Dt "${builddir}" -m644 .config Makefile Module.symvers System.map \ + localversion.* version vmlinux + install -Dt "${builddir}/kernel" -m644 kernel/Makefile + install -Dt "${builddir}/arch/x86" -m644 arch/x86/Makefile + cp -t "${builddir}" -a scripts - 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 + # add objtool for external module building and enabled VALIDATION_STACK option + install -Dt "${builddir}/tools/objtool" tools/objtool/objtool - install -Dt "$builddir/drivers/md" -m644 drivers/md/*.h - install -Dt "$builddir/net/mac80211" -m644 net/mac80211/*.h + # add xfs and shmem for aufs building + mkdir -p "${builddir}"/{fs/xfs,mm} - # http://bugs.archlinux.org/task/13146 - install -Dt "$builddir/drivers/media/i2c" -m644 drivers/media/i2c/msp3400-driver.h + 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 - # http://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 + install -Dt "${builddir}/drivers/md" -m644 drivers/md/*.h + install -Dt "${builddir}/net/mac80211" -m644 net/mac80211/*.h - echo "Installing KConfig files..." - find . -name 'Kconfig*' -exec install -Dm644 {} "$builddir/{}" \; + # https://bugs.archlinux.org/task/13146 + install -Dt "${builddir}/drivers/media/i2c" -m644 drivers/media/i2c/msp3400-driver.h - echo "Removing unneeded architectures..." - local arch - for arch in "$builddir"/arch/*/; do - [[ $arch = */x86/ ]] && continue - echo "Removing $(basename "$arch")" - rm -r "$arch" - done + # 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 - echo "Removing documentation..." - rm -r "$builddir/Documentation" - - echo "Removing broken symlinks..." - find -L "$builddir" -type l -printf 'Removing %P\n' -delete - - echo "Removing loose objects..." - find "$builddir" -type f -name '*.o' -printf 'Removing %P\n' -delete - - echo "Stripping build tools..." - local file - while read -rd '' file; do - case "$(file -bi "$file")" in - application/x-sharedlib\;*) # Libraries (.so) - strip -v $STRIP_SHARED "$file" ;; - application/x-archive\;*) # Libraries (.a) - strip -v $STRIP_STATIC "$file" ;; - application/x-executable\;*) # Binaries - strip -v $STRIP_BINARIES "$file" ;; - application/x-pie-executable\;*) # Relocatable binaries - strip -v $STRIP_SHARED "$file" ;; - esac - done < <(find "$builddir" -type f -perm -u+x ! -name vmlinux -print0) - - echo "Adding symlink..." - mkdir -p "$pkgdir/usr/src" - ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase" -} + # https://bugs.archlinux.org/task/71392 + install -Dt "${builddir}/drivers/iio/common/hid-sensors" -m644 drivers/iio/common/hid-sensors/*.h -pkgname=("$pkgbase" "$pkgbase-headers") -for _p in "${pkgname[@]}"; do - eval "package_$_p() { - $(declare -f "_package${_p#$pkgbase}") - _package${_p#$pkgbase} - }" -done + echo "Installing KConfig files..." + find . -name 'Kconfig*' -exec install -Dm644 {} "${builddir}/{}" \; + + echo "Removing unneeded architectures..." + local arch + for arch in "${builddir}"/arch/*/; do + [[ $arch = */x86/ ]] && continue + echo "Removing $(basename "$arch")" + rm -r "$arch" + done + + echo "Removing documentation..." + rm -r "${builddir}/Documentation" + + echo "Removing broken symlinks..." + find -L "${builddir}" -type l -printf 'Removing %P\n' -delete + + echo "Removing loose objects..." + find "${builddir}" -type f -name '*.o' -printf 'Removing %P\n' -delete + + echo "Stripping build tools..." + local file + while read -rd '' file; do + case "$(file -bi "$file")" in + application/x-sharedlib\;*) # Libraries (.so) + strip -v "${STRIP_SHARED}" "$file" ;; + application/x-archive\;*) # Libraries (.a) + strip -v "${STRIP_STATIC}" "$file" ;; + application/x-executable\;*) # Binaries + strip -v "${STRIP_BINARIES}" "$file" ;; + application/x-pie-executable\;*) # Relocatable binaries + strip -v "${STRIP_SHARED}" "$file" ;; + esac + done < <(find "${builddir}" -type f -perm -u+x ! -name vmlinux -print0) + + echo "Stripping vmlinux..." + strip -v "${STRIP_STATIC}" "${builddir}/vmlinux" + + echo "Adding symlink..." + mkdir -p "${pkgdir:?}/usr/src" + ln -sr "${builddir}" "${pkgdir:?}/usr/src/${pkgbase}" + +} -md5sums=('76c60fb304510a7bbd9c838790bc5fe4' - '33b12686c6f185e49a35c45e233d558e' +md5sums=('89020a90124a6798054a03c7a2ead059' 'bb15c4c539a601d9593289b78ca9a6d9' '5a1e1af6bd9993ad250c070f90870b78' '078da517ec2d54283af81d7da3af671a' @@ -420,7 +379,6 @@ md5sums=('76c60fb304510a7bbd9c838790bc5fe4' 'f9b3c2263204ebfae89f29b83278b54b' 'e84f0dadb9e7487fac39541c5bd85d7a' 'b6623f818462d08b03fdc1b573c90e9f' - '2b2be59407dd342f1cea80602a93b6c0' '9977ba0e159416108217a45438ebebb4' '92e9db1a7777666a1e6353b4760f1275' '9e5114dba6da65e8d444aa225b109a21' |