# Maintainer: David P. # Contributor: André Silva # Contributor: Márcio Silva # Contributor: fauno # Contributor: Sorin-Mihai Vârgolici # Contributor: Michał Masłowski # Contributor: Luke R. # Contributor: Andreas Grapentin # Based on linux package _replacesarchkernel=('linux%') # '%' gets replaced with kernel suffix _replacesoldkernels=() # '%' gets replaced with kernel suffix _replacesoldmodules=() # '%' gets replaced with kernel suffix pkgbase=linux-libre pkgver=5.8.3 pkgrel=1 pkgdesc='Linux-libre' rcnver=5.8.3 rcnrel=armv7-x10 url='https://linux-libre.fsfla.org/' arch=(i686 x86_64 armv7h) license=(GPL2) makedepends=( bc kmod libelf pahole xmlto python-sphinx python-sphinx_rtd_theme graphviz imagemagick ) makedepends_armv7h=(uboot-tools vboot-utils dtc) # required by linux-libre-chromebook options=('!strip') _srcname=linux-5.8 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://repo.parabola.nu/other/linux-libre/logos/logo_linux_"{clut224.ppm,vga16.ppm,mono.pbm}{,.sig} config.i686 config.x86_64 config.armv7h # the main kernel config files linux-armv7h.preset # armv7h preset file for mkinitcpio ramdisk "kernel"{.its,.keyblock,_data_key.vbprivk} # files for signing Chromebooks kernels # 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 # extracted patches from Arch Linux kernel sources 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch 0002-virt-vbox-Add-support-for-the-new-VBG_IOCTL_ACQUIRE_.patch sphinx-workaround.patch ) source_armv7h=( # RCN patch (CM3 firmware deblobbed and bloatware removed) "https://repo.parabola.nu/other/rcn-libre/patches/$rcnver/rcn-libre-$rcnver-$rcnrel.patch"{,.sig} # Arch Linux ARM patches 0001-ARM-atags-add-support-for-Marvell-s-u-boot.patch 0002-ARM-atags-fdt-retrieve-MAC-addresses-from-Marvell-bo.patch 0003-SMILE-Plug-device-tree-file.patch 0004-fix-mvsdio-eMMC-timing.patch 0005-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch 0006-set-default-cubietruck-led-triggers.patch 0007-exynos4412-odroid-set-higher-minimum-buck2-regulator.patch 0008-ARM-dove-enable-ethernet-on-D3Plug.patch 0009-USB-Armory-MkII-support.patch # ChromiumOS patches 0001-CHROMIUM-block-partitions-efi-Add-support-for-IGNORE.patch ) validpgpkeys=( '474402C8C582DAFBE389C427BCB7CF877E7D47A7' # Alexandre Oliva '6DB9C4B4F0D8C0DC432CF6E4227CA7C556B2BA78' # David P. ) sha512sums=('ee31b02ebb50fb061f58c9d6011c2fcda93931b2b443adb19916928a4ea1c8e60a953781f627d4fc25d0f095fa54ff78cd75850ed3a2128bbb42c6e4246af0d6' 'SKIP' '81b00b5455e242208cb12dea4af5eaedde09c3bca229611cc44b3cab67fe5440e154412fee471d639efcc78f3a152907b46df7751a444e5a5c94e70e0d6e4424' 'SKIP' '13cb5bc42542e7b8bb104d5f68253f6609e463b6799800418af33eb0272cc269aaa36163c3e6f0aacbdaaa1d05e2827a4a7c4a08a029238439ed08b89c564bb3' 'SKIP' '7a3716bfe3b9f546da309c7492f3e08f8f506813afeb1c737a474c83313d5c313cf4582b65215c2cfce3b74d9d1021c96e8badafe8f6e5b01fe28d2b5c61ae78' 'SKIP' '267295aa0cea65684968420c68b32f1a66a22d018b9d2b2c1ef14267bcf4cb68aaf7099d073cbfefe6c25c8608bdcbbd45f7ac8893fdcecbf1e621abdfe9ecc1' 'SKIP' '454a3435c7396767fee679a0132318c3259cb071cf4fda1dff68051204e731bc9ddae7f00b9b089ad264244acf830c141986ca831021c45a95a63bb53f478e86' 'd3954572bb951b624b48033a1fa82c7669060fe86b6436f7cef5f9fc98865c24d55ed7ea100004611e98abd7620ff59009bf0424326ec18f01554209cfb60c99' 'd064e3968591767d42f468e9d31a40b432969f97cbabda4d5b29dedbbc460a10fd20d15dbac7f077adbdb62c985cbee23aecfcd4128159f52d82edb51962298c' '53103bf55b957b657039510527df0df01279dec59cda115a4d6454e4135025d4546167fa30bdc99107f232561c1e096d8328609ab5a876cf7017176f92ad3e0b' '167bc73c6c1c63931806238905dc44c7d87c5a5c0f6293159f2133dfe717fb44081018d810675716d1605ec7dff5e8333b87b19e09e2de21d0448e447437873b' 'bb6718984a7357c9b00c37e4788480e5b8b75018c172ecc1441bc3fc5d2d42444eb5d8c7f9d2e3a7d6fed6d03acb565e3c0559486e494c40a7fe6bd0570c9ede' '143dea30c6da00e504c99984a98a0eb2411f558fcdd9dfa7f607d6c14e9e7dffff9cb00121d9317044b07e3e210808286598c785ee854084b993ec9cb14d8232' '02af4dd2a007e41db0c63822c8ab3b80b5d25646af1906dc85d0ad9bb8bbf5236f8e381d7f91cf99ed4b0978c50aee37cb9567cdeef65b7ec3d91b882852b1af' 'b8fe56e14006ab866970ddbd501c054ae37186ddc065bb869cf7d18db8c0d455118d5bda3255fb66a0dde38b544655cfe9040ffe46e41d19830b47959b2fb168' '0dc489140a17ff872c799f025b35cce6e61dc7c711047fd5faaa40bf3b6e31ba64c84f2fae6830d238412f1976f4c087db80ac59389be99bb7e24c72e4eec7fd' '61e3d6fb673397b745609942b8127fe27345f8ce06c4282644a9d231a902e1fb7b3672a94bf879bfebea260845aa72e5588df22be3d2cea2a6b194d4e6a7691d' '98e97155f86bbe837d43f27ec1018b5b6fdc6c372d6f7f2a0fe29da117d53979d9f9c262f886850d92002898682781029b80d4ee923633fc068f979e6c8254be') sha512sums_armv7h=('b472ea2a626bb841c6a330ca74945411ec49a1c1abb624cd09e0f88bd007362d5369bdf66cd9ca9aa9ddeb3e5662f457783fba52b59a1f36c0399833f9d5af03' 'SKIP' 'ac5a06427905c33b48817eef0c335d6787b6d1440751450977faf41c649677a7ccb9ec32d0e5bbefcc6cd0fab7ab5920d7dd4e5a29b96f8915e636aca1ec7efd' '7561561e6d1da2f383ac408384ffebe3490f14bcc8f797cf126d0bec5c6c774ebb6de7922c7538991ab70371aacc7fa65be647b17a691aba1a0eb604fdc7d1a7' '589e9d9331aa8417e607b73c5ff8f6a9396476076c649933b8a72c88acb8f53b425131b402600224fe4d8070d2ab80530627da404880ebbce42a89c37f94d8fc' '9f7f75d3ffdeff2f8af34105b3c3aed992086850e4d4e67e5c43f5a0d64181b6d28c5b170edac9b6c21c267e3326a5f1e9b4e00af2f2dbd238d0d1a883d10d48' 'c05c4728c3927be64eb6d9a1122708c1007fc621723ac5092ab23535a687b18bf10c84d0a3286f69a19b5a5439d1b397d3b3a6b44fe3f77574b19e2a20bc087a' '92e6cc3f32efe5e6fc76f9ab67848ce85d4ba26fc6ee08d5248ad1aad6f796f120ec50058a98ad790787e7923ba1f125f293efe0d94d38e29c46143f766b832f' '0b94865faace5c3f83bc5fc9cc92d537de310873c1c842f4b29e13c7b3a5dbca0fb56c6b0e1aaa1d86a9a3f999a1cd50f8b419b7fa9046b91c390e5938e7b71e' '34a065eb8f95690c59c8669ed3d2676f3ab8a7c5af9c9bbfae38df1be1c870182050fb899f15edcca46a988795f0579ba9208a22de68bdb4cf6687635cb86526' '9c786e6b2d10960367f8f81c8a259f22311e6494d7ead5473398fdcec3e24ad3d68d28bb24d7a9f374ebe46f3760405d05a03f425bcadb9470cf4b54f13a5b4d' '7bda2ad7eb81af802873cb6764cb9c675ec50ceeb5adc487881ebc8c316cf55f836e56c2cc67494a2920e86494861db2eb924b7ff9b151ae3c5b0e493c373bf9') _replacesarchkernel=("${_replacesarchkernel[@]/\%/${pkgbase#linux-libre}}") _replacesoldkernels=("${_replacesoldkernels[@]/\%/${pkgbase#linux-libre}}") _replacesoldmodules=("${_replacesoldmodules[@]/\%/${pkgbase#linux-libre}}") case "$CARCH" in i686|x86_64) KARCH=x86;; armv7h) KARCH=arm;; esac 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..." scripts/setlocalversion --save-scmversion echo "-$pkgrel" > localversion.10-pkgrel echo "${pkgbase#linux-libre}" > localversion.20-pkgname if [ "$CARCH" = "armv7h" ]; then local src_armv7h for src_armv7h in "${source_armv7h[@]}"; do src_armv7h="${src_armv7h%%::*}" src_armv7h="${src_armv7h##*/}" [[ $src_armv7h = *.patch ]] || continue echo "Applying patch $src_armv7h..." patch -Np1 < "../$src_armv7h" done fi 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.$CARCH .config make olddefconfig make -s kernelrelease > version echo "Prepared $pkgbase version $( cmdline echo "Creating kernel sign..." vbutil_kernel \ --pack vmlinux.kpart \ --version 1 \ --vmlinuz kernel.signed \ --arch arm \ --keyblock ../kernel.keyblock \ --signprivate ../kernel_data_key.vbprivk \ --config cmdline \ --bootloader bootloader.bin echo "Installing kernel sign..." mkdir -p "$pkgdir/boot" cp vmlinux.kpart "$pkgdir/boot" } pkgname=("$pkgbase" "$pkgbase-headers" "$pkgbase-docs") [[ $CARCH = armv7h ]] && pkgname+=("$pkgbase-chromebook") for _p in "${pkgname[@]}"; do eval "package_$_p() { $(declare -f "_package${_p#$pkgbase}") _package${_p#$pkgbase} }" done # vim:set ts=8 sts=2 sw=2 et: