# Maintainer: David P. # Contributor: André Silva # Contributor: Márcio Silva # Based on linux-hardened package _replacesarchkernel=('linux%') # '%' gets replaced with kernel suffix _replacesoldkernels=() # '%' gets replaced with kernel suffix _replacesoldmodules=() # '%' gets replaced with kernel suffix pkgbase=linux-libre-hardened pkgver=5.17.9.hardened1 pkgrel=1 pkgdesc='Security-Hardened Linux-libre' url='https://linux-libre.fsfla.org/' arch=(x86_64) license=(GPL2) makedepends=( bc libelf pahole cpio perl tar xz xmlto python-sphinx python-sphinx_rtd_theme graphviz imagemagick texlive-latexextra ) options=('!strip') _srcname=linux-5.17 _srctag=${pkgver%.*}-${pkgver##*.} source=( "https://linux-libre.fsfla.org/pub/linux-libre/releases/${_srcname##*-}-gnu/linux-libre-${_srcname##*-}-gnu.tar.xz"{,.sign} "https://linux-libre.fsfla.org/pub/linux-libre/releases/${pkgver%.*}-gnu/patch-${_srcname##*-}-gnu-${pkgver%.*}-gnu.xz"{,.sign} "https://github.com/anthraxx/linux-hardened/releases/download/${_srctag}/linux-hardened-${_srctag}.patch"{,.sig} "https://repo.parabola.nu/other/linux-libre/logos/logo_linux_"{clut224.ppm,vga16.ppm,mono.pbm}{,.sig} config # the main kernel config file # maintain the TTY over USB disconnects # http://www.coreboot.org/EHCI_Gadget_Debug 0001-usb-serial-gadget-no-TTY-hangup-on-USB-disconnect-WI.patch # fix Atmel maXTouch touchscreen support # https://labs.parabola.nu/issues/877 # http://www.fsfla.org/pipermail/linux-libre/2015-November/003202.html 0002-fix-Atmel-maXTouch-touchscreen-support.patch ) validpgpkeys=( '474402C8C582DAFBE389C427BCB7CF877E7D47A7' # Alexandre Oliva '65EEFE022108E2B708CBFCF7F9E712E59AF5F22A' # Daniel Micay '6DB9C4B4F0D8C0DC432CF6E4227CA7C556B2BA78' # David P. 'E240B57E2C4630BA768E2F26FC1B547C8D8172C8' # Levente Polyak ) sha512sums=('565de7f956e40a931858cb29b61619f25fc57ce588b8762bef806e470d20bbbdf98a6e1c55eccae61a7365c0ecaae4825d81f7eec8689911710949ba5b34ce0c' 'SKIP' '921c4e1eca023c3a0f756ec788188e0d8c5b0622c832516c32e87f964e90769c7072f41785f1bfde1344fcd829332834a959313fd4db69cab20227eeba4141aa' 'SKIP' 'edc6e7759a3d8c254447426f963bd2e1dd26f056049188c46a857593142d5b2f21fffaccb42959a779223b9311b09635198e9fcf6b129fe3df95120597001b92' 'SKIP' '13cb5bc42542e7b8bb104d5f68253f6609e463b6799800418af33eb0272cc269aaa36163c3e6f0aacbdaaa1d05e2827a4a7c4a08a029238439ed08b89c564bb3' 'SKIP' '7a3716bfe3b9f546da309c7492f3e08f8f506813afeb1c737a474c83313d5c313cf4582b65215c2cfce3b74d9d1021c96e8badafe8f6e5b01fe28d2b5c61ae78' 'SKIP' '267295aa0cea65684968420c68b32f1a66a22d018b9d2b2c1ef14267bcf4cb68aaf7099d073cbfefe6c25c8608bdcbbd45f7ac8893fdcecbf1e621abdfe9ecc1' 'SKIP' 'a2d38c7dcd52483cd717c6482134f6fc8a9ce5d788a86afd5d9b3714c59b62540c858d07c79a85085fc6aed5a63282b35c71826b8affa35bdea77690cc0826e2' '02af4dd2a007e41db0c63822c8ab3b80b5d25646af1906dc85d0ad9bb8bbf5236f8e381d7f91cf99ed4b0978c50aee37cb9567cdeef65b7ec3d91b882852b1af' 'b8fe56e14006ab866970ddbd501c054ae37186ddc065bb869cf7d18db8c0d455118d5bda3255fb66a0dde38b544655cfe9040ffe46e41d19830b47959b2fb168') _replacesarchkernel=("${_replacesarchkernel[@]/\%/${pkgbase#linux-libre}}") _replacesoldkernels=("${_replacesoldkernels[@]/\%/${pkgbase#linux-libre}}") _replacesoldmodules=("${_replacesoldmodules[@]/\%/${pkgbase#linux-libre}}") export KBUILD_BUILD_HOST=parabola export KBUILD_BUILD_USER=$pkgbase export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})" prepare() { cd $_srcname if [ "${_srcname##*-}" != "${pkgver%.*}" ]; then echo "Applying upstream patch..." patch -Np1 < "../patch-${_srcname##*-}-gnu-${pkgver%.*}-gnu" fi echo "Adding freedo as boot logo..." install -m644 -t drivers/video/logo \ ../logo_linux_{clut224.ppm,vga16.ppm,mono.pbm} echo "Setting version..." sed -e "/^[-+]EXTRAVERSION =/s/= */= -gnu/" \ -i "../linux-hardened-$_srctag.patch" scripts/setlocalversion --save-scmversion echo "-$pkgrel" > localversion.10-pkgrel echo "${pkgbase#linux-libre}" > localversion.20-pkgname local src for src in "${source[@]}"; do src="${src%%::*}" src="${src##*/}" [[ $src = *.patch ]] || continue echo "Applying patch $src..." patch -Np1 < "../$src" done echo "Setting config..." cp ../config .config make olddefconfig diff -u ../config .config || : make -s kernelrelease > version echo "Prepared $pkgbase version $(