From df0241f1b924a5a2efda69969b4cba1a5a1ce1bb Mon Sep 17 00:00:00 2001 From: David Runge Date: Sat, 2 Nov 2019 10:29:18 +0100 Subject: PKGBUILD: Aligning with vanilla kernel package script. Removing hooks, install and preset file (mkinitcpio is now taking care of this itself on the basis of a pkgbase file). Adding python-sphinx to makedepends for html docs. Switching to a pkgver scheme, in which the patch number gets concatenated to the kernel version without any prefix. --- .SRCINFO | 21 ++++------ 60-linux-rt-lts.hook | 12 ------ 90-linux-rt-lts.hook | 11 ------ PKGBUILD | 107 ++++++++++++++++++++------------------------------- linux-rt-lts.install | 10 ----- linux-rt-lts.preset | 14 ------- 6 files changed, 50 insertions(+), 125 deletions(-) delete mode 100644 60-linux-rt-lts.hook delete mode 100644 90-linux-rt-lts.hook delete mode 100644 linux-rt-lts.install delete mode 100644 linux-rt-lts.preset diff --git a/.SRCINFO b/.SRCINFO index 0dd026a..04e77c6 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,26 +1,27 @@ pkgbase = linux-rt-lts - pkgver = 4.19.72_rt26 + pkgver = 4.19.72.26 pkgrel = 1 url = https://wiki.linuxfoundation.org/realtime/start arch = x86_64 license = GPL2 makedepends = bc makedepends = git + makedepends = graphviz + makedepends = imagemagick makedepends = inetutils makedepends = kmod makedepends = libelf + makedepends = python-sphinx + makedepends = python-sphinx_rtd_theme makedepends = xmlto options = !strip source = https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.19.72.tar.xz source = https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.19.72.tar.sign source = https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patch-4.19.72-rt26.patch.xz source = https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patch-4.19.72-rt26.patch.sign + source = config source = 0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch source = 0002-ZEN-Add-CONFIG-for-unprivileged_userns_clone.patch - source = config - source = 60-linux-rt-lts.hook - source = 90-linux-rt-lts.hook - source = linux-rt-lts.preset validpgpkeys = ABAF11C65A2970B130ABE3C479BE3E4300411886 validpgpkeys = 647F28654894E3BD457199BE38DBBDC86092693E validpgpkeys = 8218F88849AAC522E94CF470A5E9288C4FA415FA @@ -31,23 +32,17 @@ pkgbase = linux-rt-lts sha256sums = SKIP sha256sums = 7e360014f510daf6ab886f272531f98d9ae5cb5a55973a9b636346ac45f841f6 sha256sums = SKIP + sha256sums = e5a6ac3346c359353b3a7491bb77637870328a4bf3f3d57bf434a29b72632600 sha256sums = 75aa8dd708ca5a0137fbf7cddc9cafefe6aac6b8e0638c06c156d412d05af4bc sha256sums = 67aed9742e4281df6f0bd18dc936ae79319fee3763737f158c0e87a6948d100d - sha256sums = e5a6ac3346c359353b3a7491bb77637870328a4bf3f3d57bf434a29b72632600 - sha256sums = ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21 - sha256sums = 75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919 - sha256sums = ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65 pkgname = linux-rt-lts pkgdesc = The Linux-rt-lts kernel and modules - install = linux-rt-lts.install depends = coreutils - depends = linux-firmware depends = kmod - depends = mkinitcpio + depends = initramfs optdepends = crda: to set the correct wireless channels of your country optdepends = linux-firmware: firmware images needed for some devices - backup = etc/mkinitcpio.d/linux-rt-lts.preset pkgname = linux-rt-lts-headers pkgdesc = Header files and scripts for building modules for Linux-rt-lts kernel diff --git a/60-linux-rt-lts.hook b/60-linux-rt-lts.hook deleted file mode 100644 index b33873c..0000000 --- a/60-linux-rt-lts.hook +++ /dev/null @@ -1,12 +0,0 @@ -[Trigger] -Type = File -Operation = Install -Operation = Upgrade -Operation = Remove -Target = usr/lib/modules/%KERNVER%/* -Target = usr/lib/modules/%EXTRAMODULES%/* - -[Action] -Description = Updating %PKGBASE% module dependencies... -When = PostTransaction -Exec = /usr/bin/depmod %KERNVER% diff --git a/90-linux-rt-lts.hook b/90-linux-rt-lts.hook deleted file mode 100644 index be0d886..0000000 --- a/90-linux-rt-lts.hook +++ /dev/null @@ -1,11 +0,0 @@ -[Trigger] -Type = File -Operation = Install -Operation = Upgrade -Target = boot/vmlinuz-%PKGBASE% -Target = usr/lib/initcpio/* - -[Action] -Description = Updating %PKGBASE% initcpios... -When = PostTransaction -Exec = /usr/bin/mkinitcpio -p %PKGBASE% diff --git a/PKGBUILD b/PKGBUILD index bb0e279..1838683 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -6,29 +6,26 @@ # Contributor: Tobias Powalowski # Contributor: Thomas Baechler -#pkgbase=linux # Build stock -ARCH kernel -pkgbase=linux-rt-lts # Build kernel with a different name _pkgver=4.19.72 -_rtpatchver=rt26 -pkgver=${_pkgver}_${_rtpatchver} +_rtpatchver=26 +pkgbase=linux-rt-lts +pkgver=${_pkgver}.${_rtpatchver} pkgrel=1 arch=('x86_64') url="https://wiki.linuxfoundation.org/realtime/start" license=('GPL2') -makedepends=('bc' 'git' 'inetutils' 'kmod' 'libelf' 'xmlto') +makedepends=('bc' 'git' 'graphviz' 'imagemagick' 'inetutils' 'kmod' 'libelf' +'python-sphinx' 'python-sphinx_rtd_theme' 'xmlto') options=('!strip') _srcname=linux-${_pkgver} source=( "https://www.kernel.org/pub/linux/kernel/v4.x/linux-${_pkgver}.tar.xz" "https://www.kernel.org/pub/linux/kernel/v4.x/linux-${_pkgver}.tar.sign" - "https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patch-${_pkgver}-${_rtpatchver}.patch.xz" - "https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patch-${_pkgver}-${_rtpatchver}.patch.sign" + "https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patch-${_pkgver}-rt${_rtpatchver}.patch.xz" + "https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patch-${_pkgver}-rt${_rtpatchver}.patch.sign" + config # the main kernel config file 0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch 0002-ZEN-Add-CONFIG-for-unprivileged_userns_clone.patch - config # the main kernel config file - 60-${pkgbase}.hook # pacman hook for depmod - 90-${pkgbase}.hook # pacman hook for initramfs regeneration - ${pkgbase}.preset # standard config files for mkinitcpio ramdisk ) validpgpkeys=( 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds @@ -42,27 +39,25 @@ sha256sums=('f9fcb6b3bd29115ac55fc154e300c3dce2044502732f6842ad6c25e6f9f51f6d' 'SKIP' '7e360014f510daf6ab886f272531f98d9ae5cb5a55973a9b636346ac45f841f6' 'SKIP' - '75aa8dd708ca5a0137fbf7cddc9cafefe6aac6b8e0638c06c156d412d05af4bc' - '67aed9742e4281df6f0bd18dc936ae79319fee3763737f158c0e87a6948d100d' 'e5a6ac3346c359353b3a7491bb77637870328a4bf3f3d57bf434a29b72632600' - 'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21' - '75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919' - 'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65') + '75aa8dd708ca5a0137fbf7cddc9cafefe6aac6b8e0638c06c156d412d05af4bc' + '67aed9742e4281df6f0bd18dc936ae79319fee3763737f158c0e87a6948d100d') -_kernelname=${pkgbase#linux} -: ${_kernelname:=-ARCH} +export KBUILD_BUILD_HOST=archlinux +export KBUILD_BUILD_USER=$pkgbase +export KBUILD_BUILD_TIMESTAMP="@${SOURCE_DATE_EPOCH:-$(date +%s)}" prepare() { cd $_srcname # apply realtime patch - msg "applying patch-${_pkgver}-${_rtpatchver}.patch" - patch -Np1 -i ../patch-${_pkgver}-${_rtpatchver}.patch + msg "applying patch-${_pkgver}-rt${_rtpatchver}.patch" + patch -Np1 -i "../patch-${_pkgver}-rt${_rtpatchver}.patch" 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 @@ -78,68 +73,39 @@ prepare() { make olddefconfig # make menuconfig # CLI menu for configuration - make -s kernelrelease > ../version - msg2 "Prepared %s version %s" "$pkgbase" "$(<../version)" + make -s kernelrelease > version + msg2 "Prepared %s version %s" "$pkgbase" "$( "$startdir/$install.pkg" - true && install=$install.pkg - - # fill in mkinitcpio preset and pacman hooks - sed "$subst" ../${pkgbase}.preset | install -Dm644 /dev/stdin \ - "$pkgdir/etc/mkinitcpio.d/$pkgbase.preset" - sed "$subst" ../60-${pkgbase}.hook | install -Dm644 /dev/stdin \ - "$pkgdir/usr/share/libalpm/hooks/60-$pkgbase.hook" - sed "$subst" ../90-${pkgbase}.hook | install -Dm644 /dev/stdin \ - "$pkgdir/usr/share/libalpm/hooks/90-$pkgbase.hook" - msg2 "Fixing permissions..." chmod -Rc u=rwX,go=rX "$pkgdir" } @@ -147,12 +113,12 @@ _package() { _package-headers() { pkgdesc="Header files and scripts for building modules for ${pkgbase/linux/Linux} kernel" - local builddir="$pkgdir/usr/lib/modules/$(/dev/null && ! mountpoint -q /boot; then - echo "WARNING: /boot appears to be a separate partition but is not mounted." - fi -} - -post_remove() { - rm -f boot/initramfs-%PKGBASE%.img - rm -f boot/initramfs-%PKGBASE%-fallback.img -} diff --git a/linux-rt-lts.preset b/linux-rt-lts.preset deleted file mode 100644 index 66709a8..0000000 --- a/linux-rt-lts.preset +++ /dev/null @@ -1,14 +0,0 @@ -# mkinitcpio preset file for the '%PKGBASE%' package - -ALL_config="/etc/mkinitcpio.conf" -ALL_kver="/boot/vmlinuz-%PKGBASE%" - -PRESETS=('default' 'fallback') - -#default_config="/etc/mkinitcpio.conf" -default_image="/boot/initramfs-%PKGBASE%.img" -#default_options="" - -#fallback_config="/etc/mkinitcpio.conf" -fallback_image="/boot/initramfs-%PKGBASE%-fallback.img" -fallback_options="-S autodetect" -- cgit v1.2.3