diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 140 |
1 files changed, 70 insertions, 70 deletions
@@ -1,9 +1,6 @@ # Maintainer: jc_gargma <jc_gargma@iserlohn-fortress.net> # Maintainer (Arch): Levente Polyak <anthraxx[at]archlinux[dot]org> # Contributor: Aqua-sama <aqua@iserlohn-fortress.net> -# Contributor (Arch): Daniel Micay <danielmicay@gmail.com> -# Contributor (Arch): Tobias Powalowski <tpowa@archlinux.org> -# Contributor (Arch): Thomas Baechler <thomas@archlinux.org> # # I maintain this because: # Parabola version patch script does not apply consistently @@ -16,66 +13,60 @@ # Parabola version enables ISDN and Infiniband # Parabola version enables VMware and HyperV +_pkgbase=linux-hardened pkgbase=linux-libre-hardened _supver=5 _majver=3 -_minver=7 +_minver=8 +_hardenedver=a +_gccpatchver='20190822' if [ "$_minver" == "0" ]; then _pkgver=${_supver}.${_majver} else _pkgver=${_supver}.${_majver}.${_minver} fi -_srcname=linux-${_supver}.${_majver} -_gnumajver=${_supver}.${_majver}-gnu -_gnupkgver=${_pkgver}-gnu -_hardenedver=b -_gccpatchver='20190822' pkgver=${_pkgver}.${_hardenedver} -pkgrel=2 +pkgrel=1 url='https://github.com/anthraxx/linux-hardened' -arch=('x86_64') -license=('GPL2') +arch=(x86_64) +license=(GPL2) makedepends=( - 'xmlto' 'kmod' 'inetutils' 'bc' 'libelf' - ) + xmlto kmod inetutils bc libelf + python-sphinx python-sphinx_rtd_theme graphviz imagemagick +) conflicts=('linux-hardened') options=('!strip') +_srcname=linux-${_supver}.${_majver} +_gnumajver=${_supver}.${_majver}-gnu +_gnupkgver=${_pkgver}-gnu source=( - https://linux-libre.fsfla.org/pub/linux-libre/releases/${_gnumajver}/linux-libre-${_gnumajver}.tar.xz{,.sign} - https://linux-libre.fsfla.org/pub/linux-libre/releases/${_gnupkgver}/patch-${_gnumajver}-${_gnupkgver}.xz{,.sign} - 0002-Bluetooth-hidp-Fix-assumptions-on-the-return-value-of-hidp_send_message.patch - https://github.com/anthraxx/linux-hardened/releases/download/${pkgver}/linux-hardened-${pkgver}.patch{,.sig} - graysky_bdver2-hotfix.patch - kernel_gcc_patch-${_gccpatchver}.tar.gz::https://github.com/graysky2/kernel_gcc_patch/archive/${_gccpatchver}.tar.gz - ath9k-regdom-hack.patch - raid6-default-algo.patch - config.x86_64 # the main kernel config files - 60-linux.hook # pacman hook for depmod - 90-linux.hook # pacman hook for initramfs regeneration - linux.preset # standard config files for mkinitcpio ramdisk - ) + https://linux-libre.fsfla.org/pub/linux-libre/releases/${_gnumajver}/linux-libre-${_gnumajver}.tar.xz{,.sign} + https://linux-libre.fsfla.org/pub/linux-libre/releases/${_gnupkgver}/patch-${_gnumajver}-${_gnupkgver}.xz{,.sign} + 0002-Bluetooth-hidp-Fix-assumptions-on-the-return-value-of-hidp_send_message.patch + https://github.com/anthraxx/${_pkgbase}/releases/download/${pkgver}/${_pkgbase}-${pkgver}.patch{,.sig} + graysky_bdver2-hotfix.patch + kernel_gcc_patch-${_gccpatchver}.tar.gz::https://github.com/graysky2/kernel_gcc_patch/archive/${_gccpatchver}.tar.gz + ath9k-regdom-hack.patch + raid6-default-algo.patch + config # the main kernel config file +) +validpgpkeys=( + '474402C8C582DAFBE389C427BCB7CF877E7D47A7' # Alexandre Oliva + 'E240B57E2C4630BA768E2F26FC1B547C8D8172C8' # Levente Polyak +) sha256sums=('c50879645e8f13a6a39a86748a8cd259b4ecd2191c88ef772b4432c993820c0a' 'SKIP' - '62a46a51f2f09ba0fa7f02ff812044542c3cb4fb169e2c66e91a614025b5606c' + '1741f9e31b882496addadb9bc6f212a32502ad0904a14b7b6c57ddd16b6258d0' 'SKIP' '9b92add42581aeb427a0c2cffc584815f0e4223a1a6bc27802ccd77eaf6e4bec' - '0dd90897d1857bf7b3f373c86174056a447774930c419fbc27db599da30dd51e' + '28fc2b18f1095131253bc82044c011048a30a4ec91d1ebdd0a9c5fc337fd523c' 'SKIP' 'c5405139aa0a90a6f68f6a13e066a2bd0600c970f9f525cd3aa114b044a7f73b' '8c11086809864b5cef7d079f930bd40da8d0869c091965fa62e95de9a0fe13b5' 'e7ebf050c22bcec0028c0b3c79fd6d3913b0370ecc6a23dfe78ce475630cf503' '0f81d6e4158b7beeb0eb514f1b9401f7e23699cb0f7b0d513e25dae1815daaeb' - 'f583241ecf1a12dca82f940b704a60da0f2ef203efab5b97d90263f7344d25ca' - '452b8d4d71e1565ca91b1bebb280693549222ef51c47ba8964e411b2d461699c' - '75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919' - 'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65') -validpgpkeys=( - '474402C8C582DAFBE389C427BCB7CF877E7D47A7' # Alexandre Oliva - 'E240B57E2C4630BA768E2F26FC1B547C8D8172C8' # Levente Polyak - ) + '47bfa5f3211d46bb1f0a289bd2f93fab862518c11c049ad38a500547135df817') -_kernelname=${pkgbase#linux-libre} -: ${_kernelname:=-hardened} #export KBUILD_BUILD_HOST=arc4linux export KBUILD_BUILD_USER=$pkgbase export KBUILD_BUILD_TIMESTAMP="@${SOURCE_DATE_EPOCH:-$(date +%s)}" @@ -122,7 +113,7 @@ prepare() { sed -e "/^EXTRAVERSION =/s/=.*/= .${_hardenedver}/" -i Makefile scripts/setlocalversion --save-scmversion echo "-$pkgrel" > localversion.10-pkgrel - echo "-libre$_kernelname" > localversion.20-pkgname + echo "${pkgbase#linux}" > localversion.20-pkgname msg2 "Setting config..." @@ -130,7 +121,7 @@ prepare() { # if [ -f ${SRCDEST}/config.libre-hardened.previous ]; then # cp ${SRCDEST}/config.libre-hardened.previous .config # else - cp ../config.x86_64 .config + cp ../config .config # fi make olddefconfig @@ -163,55 +154,34 @@ prepare() { build() { cd $_srcname - make bzImage modules + make bzImage modules htmldocs } _package() { pkgdesc="The ${pkgbase/linux/Linux} kernel and modules" - depends=(coreutils kmod mkinitcpio) + depends=(coreutils kmod initramfs) optdepends=('crda: to set the correct wireless channels of your country' 'linux-libre-firmware: firmware images needed for some devices' 'usbctl: deny_new_usb control') - backup=("etc/mkinitcpio.d/$pkgbase.preset") - install=linux.install cd $_srcname - local kernver="$(<version)" local modulesdir="$pkgdir/usr/lib/modules/$kernver" msg2 "Installing boot image..." - install -Dm644 "$(make -s image_name)" "$pkgdir/boot/vmlinuz-$pkgbase" + # 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" msg2 "Installing modules..." - mkdir -p "$modulesdir" make INSTALL_MOD_PATH="$pkgdir/usr" modules_install # 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 - " - - # 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" } @@ -220,11 +190,11 @@ _package-headers() { pkgdesc="Header files and scripts for building modules for ${pkgbase/linux/Linux} kernel" cd $_srcname - local builddir="$pkgdir/usr/lib/modules/$(<version)/build" msg2 "Installing build files..." - install -Dt "$builddir" -m644 .config Makefile Module.symvers System.map localversion.* version 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 @@ -296,7 +266,37 @@ _package-headers() { chmod -Rc u=rwX,go=rX "$pkgdir" } -pkgname=("$pkgbase" "$pkgbase-headers") +_package-docs() { + pkgdesc="Kernel hackers manual - HTML documentation that comes with the ${pkgbase/linux/Linux} kernel" + + 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" + + msg2 "Fixing permissions..." + chmod -Rc u=rwX,go=rX "$pkgdir" +} + +pkgname=("$pkgbase" "$pkgbase-headers" "$pkgbase-docs") for _p in "${pkgname[@]}"; do eval "package_$_p() { $(declare -f "_package${_p#$pkgbase}") |