# Contributor: 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 # Maintainer: Parabola Hackers # 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-vanilla pkgver=5.17.8 pkgrel=1 pkgdesc='Linux-libre without additional patches' url='https://linux-libre.fsfla.org/' arch=(i686 x86_64 armv7h) license=(GPL2) makedepends=( bc libelf pahole cpio perl tar xz xmlto python-sphinx python-sphinx_rtd_theme graphviz imagemagick texlive-latexextra ) makedepends=( ${makedepends[*]/git/} ) makedepends_armv7h=(uboot-tools vboot-utils dtc) # required by linux-libre-chromebook options=('!strip') _srcname=linux-5.17 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 ) validpgpkeys=( '474402C8C582DAFBE389C427BCB7CF877E7D47A7' # Alexandre Oliva '6DB9C4B4F0D8C0DC432CF6E4227CA7C556B2BA78' # David P. ) sha512sums=('565de7f956e40a931858cb29b61619f25fc57ce588b8762bef806e470d20bbbdf98a6e1c55eccae61a7365c0ecaae4825d81f7eec8689911710949ba5b34ce0c' 'SKIP' '71ba9ae3f75d72d2d86cc8cab1df463725e00088fb93b09553066a9b968d3a32abed77fac6011433377ac2970c8149a28e85ed25429da7dec56b47ba871cd4ae' 'SKIP' '13cb5bc42542e7b8bb104d5f68253f6609e463b6799800418af33eb0272cc269aaa36163c3e6f0aacbdaaa1d05e2827a4a7c4a08a029238439ed08b89c564bb3' 'SKIP' '7a3716bfe3b9f546da309c7492f3e08f8f506813afeb1c737a474c83313d5c313cf4582b65215c2cfce3b74d9d1021c96e8badafe8f6e5b01fe28d2b5c61ae78' 'SKIP' '267295aa0cea65684968420c68b32f1a66a22d018b9d2b2c1ef14267bcf4cb68aaf7099d073cbfefe6c25c8608bdcbbd45f7ac8893fdcecbf1e621abdfe9ecc1' 'SKIP' 'b1f013835dcf521dcadb58ed22f271f7f01b3b15403924bd0076eb9ef4e8aa31f98b1b99d47ae726f8e981b3da44f1c484ce14e2030e31a67ad7c8eea55848d9' '5a955a795f9f49d8617897300d3d03c431b1a6fa2bc9ed4106606617e4f16b28f94906498b13c24fd5c186c76a685e5f877013093184ae80435e7b86f52e8755' '47d16ffc94510d4a8773146a46cfb35aca8cfdae38d17283334cd62d92de36250fbec90e9892357033398ecc7d970127b1a41b703a8372972422ca4af7c90c70' '53103bf55b957b657039510527df0df01279dec59cda115a4d6454e4135025d4546167fa30bdc99107f232561c1e096d8328609ab5a876cf7017176f92ad3e0b' 'f10af02f0cb2d31259d9633e1ba845f555f525789f750fc2ddc51bd18c5ff64fcdd242dae801623887f5ce5cdb5528bce890459f0fab9fd31a28868bb7f6bba5' 'bb6718984a7357c9b00c37e4788480e5b8b75018c172ecc1441bc3fc5d2d42444eb5d8c7f9d2e3a7d6fed6d03acb565e3c0559486e494c40a7fe6bd0570c9ede' '143dea30c6da00e504c99984a98a0eb2411f558fcdd9dfa7f607d6c14e9e7dffff9cb00121d9317044b07e3e210808286598c785ee854084b993ec9cb14d8232') _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 if [ "$CARCH" = "i686" ]; then local src_i686 for src_i686 in "${source_i686[@]}"; do src_i686="${src_i686%%::*}" src_i686="${src_i686##*/}" [[ $src_i686 = *.patch ]] || continue echo "Applying patch $src_i686..." patch -Np1 < "../$src_i686" 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 diff -u ../config .config || : 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: