summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorP.Jung2021-08-15 17:22:04 +0000
committerP.Jung2021-08-15 17:22:04 +0000
commite3b597c29f081dc39ac47b3f4e8a215788e3031c (patch)
tree5a1db8115c3efc724b5b0a5348d25e62374aab70
parentbc3a39a1150398fff169dae78bd804e80f8a0c4f (diff)
downloadaur-e3b597c29f081dc39ac47b3f4e8a215788e3031c.tar.gz
compile fix
-rw-r--r--.SRCINFO19
-rw-r--r--PKGBUILD324
2 files changed, 159 insertions, 184 deletions
diff --git a/.SRCINFO b/.SRCINFO
index f5d488016bcd..71f4904ca74b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = linux-cacule
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
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
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 = cd26faf6923b6d563f2f89787e2c701b
md5sums = 5a1e1af6bd9993ad250c070f90870b78
md5sums = 078da517ec2d54283af81d7da3af671a
@@ -68,7 +65,6 @@ pkgbase = linux-cacule
md5sums = f9b3c2263204ebfae89f29b83278b54b
md5sums = e84f0dadb9e7487fac39541c5bd85d7a
md5sums = b6623f818462d08b03fdc1b573c90e9f
- md5sums = 2b2be59407dd342f1cea80602a93b6c0
md5sums = 9977ba0e159416108217a45438ebebb4
md5sums = 92e9db1a7777666a1e6353b4760f1275
md5sums = 9e5114dba6da65e8d444aa225b109a21
@@ -77,15 +73,18 @@ pkgbase = linux-cacule
md5sums = 08590776013d05bc7a96ef5557c54200
pkgname = linux-cacule
- 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-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=5.13.11
+ depends = pahole
diff --git a/PKGBUILD b/PKGBUILD
index 5abb58d83b0f..d88e7ec42ce1 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -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=
@@ -41,15 +41,14 @@ _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
-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'
@@ -58,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
@@ -114,9 +111,9 @@ 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
@@ -181,37 +178,6 @@ prepare() {
scripts/config --set-val CONFIG_UNEVICTABLE_ANON_KBYTES_MIN 32768
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
@@ -266,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() {
+ 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-headers() {
- cd ${_srcname}
- local builddir="$pkgdir/usr/lib/modules/$(<version)/build"
+ pkgdesc="Headers and scripts for building modules for the ${pkgdesc}"
+ depends=("linux-cacule=${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
+
+ 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
-pkgname=("$pkgbase" "$pkgbase-headers")
-for _p in "${pkgname[@]}"; do
- eval "package_$_p() {
- $(declare -f "_package${_p#$pkgbase}")
- _package${_p#$pkgbase}
- }"
-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'
'cd26faf6923b6d563f2f89787e2c701b'
'5a1e1af6bd9993ad250c070f90870b78'
'078da517ec2d54283af81d7da3af671a'
@@ -402,7 +379,6 @@ md5sums=('76c60fb304510a7bbd9c838790bc5fe4'
'f9b3c2263204ebfae89f29b83278b54b'
'e84f0dadb9e7487fac39541c5bd85d7a'
'b6623f818462d08b03fdc1b573c90e9f'
- '2b2be59407dd342f1cea80602a93b6c0'
'9977ba0e159416108217a45438ebebb4'
'92e9db1a7777666a1e6353b4760f1275'
'9e5114dba6da65e8d444aa225b109a21'