summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD113
1 files changed, 42 insertions, 71 deletions
diff --git a/PKGBUILD b/PKGBUILD
index f9d6bd7c7e6..383ee767e5e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,5 @@
# Maintainer: graysky <graysky AT archlinux DOT us>
# Contributor: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
-# Contributor: Tobias Powalowski <tpowa@archlinux.org>
-# Contributor: Thomas Baechler <thomas@archlinux.org>
### BUILD OPTIONS
# Set these variables to ANYTHING that is not null to enable them
@@ -63,7 +61,7 @@ _localmodcfg=
### IMPORTANT: Do no edit below this line unless you know what you're doing
pkgbase=linux-ck
-_srcver=5.2.20-arch1
+_srcver=5.3.10-arch1
pkgver=${_srcver%-*}
pkgrel=1
_ckpatchversion=1
@@ -72,36 +70,33 @@ url="https://wiki.archlinux.org/index.php/Linux-ck"
license=(GPL2)
makedepends=(kmod inetutils bc libelf)
options=('!strip')
-_ckpatch="patch-5.2-ck${_ckpatchversion}"
+_ckpatch="patch-5.3-ck${_ckpatchversion}"
_gcc_more_v='20190822'
source=(
"https://www.kernel.org/pub/linux/kernel/v5.x/linux-$pkgver.tar".{xz,sign}
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
"enable_additional_cpu_optimizations-$_gcc_more_v.tar.gz::https://github.com/graysky2/kernel_gcc_patch/archive/$_gcc_more_v.tar.gz"
- "http://ck.kolivas.org/patches/5.0/5.2/5.2-ck${_ckpatchversion}/$_ckpatch.xz"
- 0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch
- 0002-ZEN-Add-CONFIG-for-unprivileged_userns_clone.patch
+ "http://ck.kolivas.org/patches/5.0/5.3/5.3-ck${_ckpatchversion}/$_ckpatch.xz"
+ fix.systemd-detect-virt.patch::https://github.com/ckolivas/linux/commit/6e346c7b4258ac03ec308741e8e28e0da3abf911.patch
+ 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch
+ 0002-Bluetooth-hidp-Fix-assumptions-on-the-return-value-o.patch
)
validpgpkeys=(
'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds
'647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman
)
-sha256sums=('b121e2497cb6d1752f8f041f1385a72edf9fcf273cb505250e0c0135bb56ad69'
+sha256sums=('8162e0b88fb0ebf2b5982611709974a7f08aba2292a720fabaca700f960d9a22'
'SKIP'
- '42e2bc6a7d8439b3a6fe4084d1349077472e0a6831d8a39edda46824a5f0987b'
- 'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21'
- 'c043f3033bb781e2688794a59f6d1f7ed49ef9b13eb77ff9a425df33a244a636'
- 'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65'
+ 'e749cd85d37d4d70099b0a7f54e852b039ae07c14e4ab8be299c64edae5d4ba4'
'8c11086809864b5cef7d079f930bd40da8d0869c091965fa62e95de9a0fe13b5'
- 'f1abc13a8d859fbf6350040e45d7f04ad551a6d39f113ba96fbbd820118c0e36'
- '91fafa76bf9cb32159ac7f22191b3589278b91e65bc4505cf2fc6013b8037bf3'
- '63e4378e69e2f23ed87af32a4951477a6d82d4ac0de2295db46502c8120da9d9')
+ '5b66761eae4efa4cb967aba9d4e555aa320cf5c004f0848e6bfbcb75ef66fbf1'
+ '01367272cd82cafc24ae04d309d5c738352949727dc2a37f8578c14c7a90b9f0'
+ 'cb38c0468a9ee0507e97e48be4a51116c1db952b7599906f2c36933b03e1ca34'
+ '4b4d388e0cb6b2448d644463e4693bb08122716117aafa411ce78305da305642')
-_kernelname=${pkgbase#linux}
-: ${_kernelname:=-ARCH}
+export KBUILD_BUILD_HOST=archlinux
+export KBUILD_BUILD_USER=$pkgbase
+export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})"
prepare() {
cd linux-${pkgver}
@@ -109,7 +104,7 @@ prepare() {
msg2 "Setting version..."
scripts/setlocalversion --save-scmversion
echo "-$pkgrel" > localversion.10-pkgrel
- echo "$_kernelname" > localversion.20-pkgname
+ echo "${pkgbase#linux}" > localversion.20-pkgname
local src
for src in "${source[@]}"; do
@@ -134,19 +129,30 @@ prepare() {
sed -i -re "s/^(.EXTRAVERSION).*$/\1 = /" "../${_ckpatch}"
msg2 "Patching with ck patchset..."
-
+
# fix ck1 patchset for 5.2.18
sed -i -e '/^-CFLAGS/ s,+=,:=,' -i -e '/^+CFLAGS/ s,+=,:=,' ../"${_ckpatch}"
+
+ # ck patchset itself
patch -Np1 -i ../"${_ckpatch}"
+ # systemd-detect-virt fix from CK merged but not yet released
+ patch -Np1 -i ../fix.systemd-detect-virt.patch
+
+ # non-interactively apply ck1 default options
+ # this isn't redundant if we want a clean selection of subarch below
+ make olddefconfig
+
# https://github.com/graysky2/kernel_gcc_patch
msg2 "Applying enable_additional_cpu_optimizations_for_gcc_v9.1+_kernel_v4.13+.patch ..."
patch -Np1 -i "$srcdir/kernel_gcc_patch-$_gcc_more_v/enable_additional_cpu_optimizations_for_gcc_v9.1+_kernel_v4.13+.patch"
if [ -n "$_subarch" ]; then
+ # user wants a subarch so apply choice defined above interactively via 'yes'
yes "$_subarch" | make oldconfig
else
- make prepare
+ # no subarch defined so allow user to pick one
+ make oldconfig
fi
### Optionally load needed modules for the make localmodconfig
@@ -161,11 +167,8 @@ prepare() {
fi
fi
- # do not run `make olddefconfig` as it sets default options
- yes "" | make config >/dev/null
-
- make -s kernelrelease > ../version
- msg2 "Prepared %s version %s" "$pkgbase" "$(<../version)"
+ make -s kernelrelease > version
+ msg2 "Prepared %s version %s" "$pkgbase" "$(<version)"
[[ -z "$_makenconfig" ]] || make nconfig
@@ -180,25 +183,25 @@ build() {
_package() {
pkgdesc="The ${pkgbase/linux/Linux} kernel and modules with the ck1 patchset featuring MuQSS CPU scheduler"
- #_Kpkgdesc="The ${pkgbase/linux/Linux} kernel and modules with the ck1 patchset featuring MuQSS CPU scheduler"
- #pkgdesc="${_Kpkgdesc}"
depends=(coreutils kmod initramfs)
optdepends=('crda: to set the correct wireless channels of your country'
'linux-firmware: firmware images needed for some devices')
provides=("linux-ck=${pkgver}")
- backup=("etc/mkinitcpio.d/$pkgbase.preset")
- install=linux.install
#groups=('ck-generic')
+ cd linux-${pkgver}
+
local kernver="$(<version)"
local modulesdir="$pkgdir/usr/lib/modules/$kernver"
- cd linux-${pkgver}
-
msg2 "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"
+ #install -Dm644 "$(make -s image_name)" "$modulesdir/vmlinuz"
+ #
+ # hard-coded path in case user defined CC=xxx for build which causes errors
+ # see this FS https://bugs.archlinux.org/task/64315
+ install -Dm644 arch/x86/boot/bzImage "$modulesdir/vmlinuz"
install -Dm644 "$modulesdir/vmlinuz" "$pkgdir/boot/vmlinuz-$pkgbase"
# Used by mkinitcpio to name the kernel
@@ -207,54 +210,25 @@ _package() {
msg2 "Installing modules..."
make INSTALL_MOD_PATH="$pkgdir/usr" modules_install
- # a place for external modules,
- # with version file for building modules and running depmod from hook
- local extramodules="extramodules$_kernelname"
- local extradir="$pkgdir/usr/lib/modules/$extramodules"
- install -Dt "$extradir" -m644 ../version
- ln -sr "$extradir" "$modulesdir/extramodules"
-
# remove build and source links
rm "$modulesdir"/{source,build}
- msg2 "Installing hooks..."
- # sed expression for following substitutions
- local subst="
- s|%PKGBASE%|$pkgbase|g
- s|%KERNVER%|$kernver|g
- s|%EXTRAMODULES%|$extramodules|g
- "
-
- # hack to allow specifying an initially nonexisting install file
- sed "$subst" "$startdir/$install" > "$startdir/$install.pkg"
- true && install=$install.pkg
-
- # fill in mkinitcpio preset and pacman hooks
- sed "$subst" ../linux.preset | install -Dm644 /dev/stdin \
- "$pkgdir/etc/mkinitcpio.d/$pkgbase.preset"
- sed "$subst" ../60-linux.hook | install -Dm644 /dev/stdin \
- "$pkgdir/usr/share/libalpm/hooks/60-$pkgbase.hook"
- sed "$subst" ../90-linux.hook | install -Dm644 /dev/stdin \
- "$pkgdir/usr/share/libalpm/hooks/90-$pkgbase.hook"
-
msg2 "Fixing permissions..."
chmod -Rc u=rwX,go=rX "$pkgdir"
}
_package-headers() {
pkgdesc="Header files and scripts for building modules for ${pkgbase/linux/Linux} kernel"
- #_Hpkgdesc="Header files and scripts for building modules for ${pkgbase/linux/Linux} kernel"
- #pkgdesc="${_Hpkgdesc}"
depends=('linux-ck') # added to keep kernel and headers packages matched
provides=("linux-ck-headers=${pkgver}" "linux-headers=${pkgver}")
#groups=('ck-generic')
- local builddir="$pkgdir/usr/lib/modules/$(<version)/build"
-
cd linux-${pkgver}
+ local builddir="$pkgdir/usr/lib/modules/$(<version)/build"
msg2 "Installing build files..."
- install -Dt "$builddir" -m644 Makefile .config Module.symvers System.map vmlinux
+ 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
@@ -265,9 +239,6 @@ _package-headers() {
# add xfs and shmem for aufs building
mkdir -p "$builddir"/{fs/xfs,mm}
- # ???
- mkdir "$builddir/.tmp_versions"
-
msg2 "Installing headers..."
cp -t "$builddir" -a include
cp -t "$builddir/arch/x86" -a arch/x86/include
@@ -321,7 +292,7 @@ _package-headers() {
msg2 "Adding symlink..."
mkdir -p "$pkgdir/usr/src"
- ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase-$pkgver"
+ ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase"
msg2 "Fixing permissions..."
chmod -Rc u=rwX,go=rX "$pkgdir"