summaryrefslogtreecommitdiff
path: root/PKGBUILD
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2019-11-02 10:29:18 +0100
committerDavid Runge <dave@sleepmap.de>2019-11-02 10:29:18 +0100
commitdf0241f1b924a5a2efda69969b4cba1a5a1ce1bb (patch)
treefddf89e7accf17b1536011b0d451517d82545852 /PKGBUILD
parent0a2adc182cf7be98b7e4a887c764d9c7f7c04c4e (diff)
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.
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD107
1 files changed, 42 insertions, 65 deletions
diff --git a/PKGBUILD b/PKGBUILD
index bb0e279..1838683 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -6,29 +6,26 @@
# Contributor: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: Thomas Baechler <thomas@archlinux.org>
-#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" "$(<version)"
}
build() {
cd $_srcname
- make bzImage modules
+ make bzImage modules htmldocs
}
_package() {
pkgdesc="The ${pkgbase/linux/Linux} kernel and modules"
- [[ $pkgbase = linux ]] && groups=(base)
- depends=(coreutils linux-firmware kmod mkinitcpio)
+ depends=(coreutils kmod initramfs)
optdepends=('crda: to set the correct wireless channels of your country'
'linux-firmware: firmware images needed for some devices')
- backup=("etc/mkinitcpio.d/$pkgbase.preset")
- install=${pkgbase}.install
+ cd $_srcname
local kernver="$(<version)"
local modulesdir="$pkgdir/usr/lib/modules/$kernver"
- cd $_srcname
-
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 "$modulesdir/vmlinuz" "$pkgdir/boot/vmlinuz-$pkgbase"
+
+ # Used by mkinitcpio to name the kernel
+ echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase"
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" ../${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/$(<version)/build"
-
cd $_srcname
+ 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
@@ -163,7 +129,7 @@ _package-headers() {
# add xfs and shmem for aufs building
mkdir -p "$builddir"/{fs/xfs,mm}
- # ???
+ # this is gone in v5.3
mkdir "$builddir/.tmp_versions"
msg2 "Installing headers..."
@@ -219,7 +185,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"
@@ -228,14 +194,25 @@ _package-headers() {
_package-docs() {
pkgdesc="Kernel hackers manual - HTML documentation that comes with the ${pkgbase/linux/Linux} kernel"
- local builddir="$pkgdir/usr/lib/modules/$(<version)/build"
-
cd $_srcname
+ local builddir="$pkgdir/usr/lib/modules/$(<version)/build"
msg2 "Installing documentation..."
mkdir -p "$builddir"
cp -t "$builddir" -a Documentation
+ msg2 "Removing doctrees..."
+ rm -r "$builddir/Documentation/output/.doctrees"
+
+ msg2 "Moving HTML docs..."
+ local src dst
+ while read -rd '' src; do
+ dst="$builddir/Documentation/${src#$builddir/Documentation/output/}"
+ mkdir -p "${dst%/*}"
+ mv "$src" "$dst"
+ rmdir -p --ignore-fail-on-non-empty "${src%/*}"
+ done < <(find "$builddir/Documentation/output" -type f -print0)
+
msg2 "Adding symlink..."
mkdir -p "$pkgdir/usr/share/doc"
ln -sr "$builddir/Documentation" "$pkgdir/usr/share/doc/$pkgbase"