summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD135
1 files changed, 65 insertions, 70 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 0f0d1661135e..d550b6c65acd 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,9 +4,9 @@
# longest and latest "longterm maintenance" kernel releases
# https://www.kernel.org/category/releases.html
-# 4.4 Greg Kroah-Hartman 2016-01-10 2022-02
-_LLL_VER=4.4
-_LLL_SUBVER=144
+# 4.9 Greg Kroah-Hartman 2016-12-11 2023-01
+_LLL_VER=4.9
+_LLL_SUBVER=125
# NUMA is optimized for multi-socket motherboards.
# A single multi-core CPU can actually run slower with NUMA enabled.
@@ -20,12 +20,8 @@ _NUMA_disable=y
_CK_VER=1
_CK_PATCH="http://ck.kolivas.org/patches/4.0/${_LLL_VER}/${_LLL_VER}-ck${_CK_VER}/patch-${_LLL_VER}-ck${_CK_VER}.xz"
-# Alternative I/O scheduler by Paolo Valente
-_BFQ_VER=v7r11
-_BFQ_URL="http://algo.ing.unimo.it/people/paolo/disk_sched/patches/4.4.0-${_BFQ_VER}"
-_BFQ_PATCHS=("${_BFQ_URL}/0001-block-cgroups-kconfig-build-bits-for-BFQ-v7r11-4.4.0.patch"
- "${_BFQ_URL}/0002-block-introduce-the-BFQ-v7r11-I-O-sched-for-4.4.0.patch"
- "${_BFQ_URL}/0003-block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-v7r11-for.patch")
+# Alternative I/O scheduler by Paolo Valente in ck patch
+_BFQ_VER=v8
# Set this if you want it enabled globally i.e. for all devices in your system
# If you want it enabled on a device-by-device basis, leave this unset and see:
# https://wiki.archlinux.org/index.php/Linux-ck#How_to_enable_the_BFQ_I.2FO_Scheduler
@@ -33,12 +29,12 @@ _BFQ_enable=
# Ultra Kernel Samepage Merging
_UKSM_VER=0.1.2.6
-_UKSM_COMMIT=a00def1b1f3c36b37fdfff4a1b7b220459bbcad2
+_UKSM_COMMIT=676f9bb2a6da8705e463adc2161f70e00f150238
_UKSM_PATCH="https://raw.githubusercontent.com/dolohow/uksm/${_UKSM_COMMIT}/uksm-${_LLL_VER}.patch"
# CJKTTY patch
# https://github.com/Gentoo-zh/linux-cjktty
-# https://github.com/torvalds/linux/compare/v4.4...Gentoo-zh:4.4-utf8
+# https://github.com/torvalds/linux/compare/v4.9...Gentoo-zh:4.9-utf8
_CJKTTY_PATCH_FILE=linux-cjktty-${_LLL_VER}.patch
_CJKTTY_PATCH_URL="https://github.com/torvalds/linux/compare/v${_LLL_VER}...Gentoo-zh:${_LLL_VER}-utf8.patch"
_CJKTTY_PATCH="${_CJKTTY_PATCH_FILE}::${_CJKTTY_PATCH_URL}"
@@ -54,7 +50,7 @@ pkgrel=1
arch=('x86_64')
url="https://www.kernel.org/"
license=('GPL2')
-makedepends=('kmod' 'inetutils' 'bc' 'libelf')
+makedepends=('xmlto' 'kmod' 'inetutils' 'bc' 'libelf')
options=('!strip')
source=(
"https://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.xz"
@@ -62,38 +58,32 @@ source=(
"https://www.kernel.org/pub/linux/kernel/v4.x/patch-${pkgver}.xz"
#"https://www.kernel.org/pub/linux/kernel/v4.x/patch-${pkgver}.sign"
${_CK_PATCH}
- ${_BFQ_PATCHS[@]}
+ 'ck-patch-for-4.9.117+.patch'
${_UKSM_PATCH}
- 'uksm-patch-for-4.4.74+.patch'
${_CJKTTY_PATCH}
- 'linux-cjktty-patch-for-4.4.100+.patch'
+ 'linux-cjktty-patch-for-4.9.112+.patch'
'config' # the main kernel config file
'60-linux.hook' # pacman hook for depmod
'90-linux.hook' # pacman hook for initramfs regeneration
'linux.preset' # standard config files for mkinitcpio ramdisk
- '0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch'
)
validpgpkeys=(
'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds
'647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman
)
# https://www.kernel.org/pub/linux/kernel/v4.x/sha256sums.asc
-sha256sums=('401d7c8fef594999a460d10c72c5a94e9c2e1022f16795ec51746b0d165418b2'
+sha256sums=('029098dcffab74875e086ae970e3828456838da6e0ba22ce3f64ef764f3d7f1a'
'SKIP'
- 'bc7a4aa50c593d7840356ef6204bef986c9383e0df9815073920d0599057f869'
- 'a800a076e7f9ab07e8baee33919f8731087f876000f8ab6a327521a7a772838f'
- 'd1cf14cc696b0f716454fe8eb9746383700889d5d22ad829611f0433cc77b4ce'
- 'b17c3fb18c5b8c20a45a38198f293679ca6aef08d16f12cd816a5cfafac4b2c4'
- '69a21bc286a628128cfc4723558829cb6ff6c2d7c4dfd4468457898674187b25'
- '58fbfa57e46cb480a74d199799d3620bd650e64147a2f05d6ddd5ecde699d84c'
- 'cbdfae2079618500533bfdc4edf27382cca2a733b56726d587078c2e0751c060'
- '0b860e2514b0a08d98350ba417877b5f63d35c65cc6fc5fa9f6ab4df7dd2d8c7'
- '2d37c03fc8fd6e3d124e2ec7f9fd9885316bdd2c0654dddb4e427dab3d67d270'
- '71d60594577b59596166add0318a8ce187c8de7787659925371ddc21b40437e5'
+ '32d94daf7f01d43a4774d6c4045b89655e6e975ddd6f6792553173c675aef299'
+ '5b9d8f4ef73f87e8595de66ccc38bad86e290fd9453bd536b9cc950f5344b82d'
+ '83083a6afc8be5504629049d6659beb6d2e8412a50db4caa4c1bec2a0d3ec2d7'
+ '65fae53b7ac44a9f3ffdcf5722e70f248ffcc183583b686066a766d27f269e1d'
+ '41acf07ce9316ec2d4149331e92223dc59d2f2090efb7b71cd96522a5ba9bf48'
+ 'afda821d57be33c5e93390e353b1aa99bd0bd41dff70feac90249097b9b44ea9'
+ 'e1c3a3dc250cd6abcbc7dd6c646a324e7b9960210fbf170c829f29e4f426cc07'
'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21'
'75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919'
- 'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65'
- '36b1118c8dedadc4851150ddd4eb07b1c58ac5bbf3022cc2501a27c2b476da98')
+ 'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65')
_kernelname=${pkgbase#linux}
@@ -106,28 +96,21 @@ prepare() {
# add latest fixes from stable queue, if needed
# http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git
- # disable USER_NS for non-root users by default
- patch -Np1 -i ../0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch
-
# fix naming schema in EXTRAVERSION of ck patch set
sed -i -re "s/^(.EXTRAVERSION).*$/\1 = /" "../patch-${_LLL_VER}-ck${_CK_VER}"
# Patch source with ck patch set
- msg "Patching source with ck${_CK_VER} including BFS"
- patch -Np1 -i "../patch-${_LLL_VER}-ck${_CK_VER}"
-
- msg "Patching source with BFQ ${_BFQ_VER} patches"
- for p in ${_BFQ_PATCHS[@]}; do
- patch -Np1 -i "../$(basename $p)"
- done
+ msg "Patching source with ck${_CK_VER} including BFS BFQ"
+ cp "../patch-${_LLL_VER}-ck${_CK_VER}" "../patch-${_LLL_VER}.${_LLL_SUBVER}-ck${_CK_VER}"
+ patch -i ../ck-patch-for-4.9.117+.patch "../patch-${_LLL_VER}.${_LLL_SUBVER}-ck${_CK_VER}"
+ patch -Np1 -i "../patch-${_LLL_VER}.${_LLL_SUBVER}-ck${_CK_VER}"
msg "Patching source with uksm ${_UKSM_VER} patches"
cp "../uksm-${_LLL_VER}.patch" "../uksm-${_LLL_VER}.${_LLL_SUBVER}.patch"
- patch -i ../uksm-patch-for-4.4.74+.patch "../uksm-${_LLL_VER}.${_LLL_SUBVER}.patch"
patch -Np1 -i "../uksm-${_LLL_VER}.${_LLL_SUBVER}.patch"
msg "Patching source with Gentoo-zh/linux-cjktty patches"
cp "../${_CJKTTY_PATCH_FILE}" "../${_CJKTTY_PATCH_FILE}.${_LLL_SUBVER}.patch"
- patch -i ../linux-cjktty-patch-for-4.4.100+.patch "../${_CJKTTY_PATCH_FILE}.${_LLL_SUBVER}.patch"
+ patch -i ../linux-cjktty-patch-for-4.9.112+.patch "../${_CJKTTY_PATCH_FILE}.${_LLL_SUBVER}.patch"
patch -Np1 -i "../${_CJKTTY_PATCH_FILE}.${_LLL_SUBVER}.patch"
cp -Tf ../config .config
@@ -223,9 +206,6 @@ _package() {
# now we call depmod...
depmod -b "${pkgdir}/usr" -F System.map "${_kernver}"
- # add vmlinux
- install -Dt "${pkgdir}/usr/lib/modules/${_kernver}/build" -m644 vmlinux
-
# sed expression for following substitutions
local _subst="
s|%PKGBASE%|${pkgbase}|g
@@ -254,17 +234,25 @@ _package-headers() {
cd ${_srcname}
local _builddir="${pkgdir}/usr/lib/modules/${_kernver}/build"
- install -Dt "${_builddir}" -m644 Makefile .config Module.symvers
+ msg2 "Installing build files..."
+ install -Dt "${_builddir}" -m644 Makefile .config Module.symvers System.map vmlinux
install -Dt "${_builddir}/kernel" -m644 kernel/Makefile
+ install -Dt "${_builddir}/arch/x86" -m644 arch/x86/Makefile
+ cp -t "${_builddir}" -a scripts
- mkdir "${_builddir}/.tmp_versions"
+ # add objtool for external module building and enabled VALIDATION_STACK option
+ install -Dt "${_builddir}/tools/objtool" tools/objtool/objtool
- cp -t "${_builddir}" -a include scripts
+ # add xfs and shmem for aufs building
+ mkdir -p "${_builddir}"/{fs/xfs,mm}
- install -Dt "${_builddir}/arch/x86" -m644 arch/x86/Makefile
- install -Dt "${_builddir}/arch/x86/kernel" -m644 arch/x86/kernel/asm-offsets.s
+ # ???
+ mkdir "${_builddir}/.tmp_versions"
+ msg2 "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
install -Dt "${_builddir}/drivers/md" -m644 drivers/md/*.h
install -Dt "${_builddir}/net/mac80211" -m644 net/mac80211/*.h
@@ -280,39 +268,46 @@ _package-headers() {
install -Dt "${_builddir}/drivers/media/dvb-frontends" -m644 drivers/media/dvb-frontends/*.h
install -Dt "${_builddir}/drivers/media/tuners" -m644 drivers/media/tuners/*.h
- # add xfs and shmem for aufs building
- mkdir -p "${_builddir}"/{fs/xfs,mm}
-
- # copy in Kconfig files
- find . -name Kconfig\* -exec install -Dm644 {} "${_builddir}/{}" \;
+ msg2 "Installing KConfig files..."
+ find . -name 'Kconfig*' -exec install -Dm644 {} "${_builddir}/{}" \;
- # remove unneeded architectures
+ msg2 "Removing unneeded architectures..."
local _arch
for _arch in "${_builddir}"/arch/*/; do
[[ ${_arch} == */x86/ ]] && continue
rm -r "${_arch}"
done
- # remove files already in linux-docs package
+ msg2 "Removing files already in linux-docs package..."
rm -r "${_builddir}/Documentation"
- # remove now broken symlinks
+ msg2 "Removing broken symlinks..."
find -L "${_builddir}" -type l -printf 'Removing %P\n' -delete
- # Fix permissions
- chmod -R u=rwX,go=rX "${_builddir}"
-
- # strip scripts directory
- local _binary _strip
- while read -rd '' _binary; do
- case "$(file -bi "${_binary}")" in
- *application/x-sharedlib*) _strip="${STRIP_SHARED}" ;; # Libraries (.so)
- *application/x-archive*) _strip="${STRIP_STATIC}" ;; # Libraries (.a)
- *application/x-executable*) _strip="${STRIP_BINARIES}" ;; # Binaries
- *) continue ;;
+ msg2 "Removing loose objects..."
+ find "${_builddir}" -type f -name '*.o' -printf 'Removing %P\n' -delete
+
+ msg2 "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
- /usr/bin/strip ${_strip} "${_binary}"
- done < <(find "${_builddir}/scripts" -type f -perm -u+w -print0 2>/dev/null)
+ done < <(find "${_builddir}" -type f -perm -u+x ! -name vmlinux -print0)
+
+ msg2 "Adding symlink..."
+ mkdir -p "$pkgdir/usr/src"
+ ln -sr "${_builddir}" "$pkgdir/usr/src/$pkgbase-$pkgver"
+
+ msg2 "Fixing permissions..."
+ chmod -Rc u=rwX,go=rX "$pkgdir"
}
_package-docs() {