From 64b92cb119b41736ea6b1c3f500c705525fcb670 Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Tue, 17 May 2022 17:36:03 +0200 Subject: libre: Add linux-libre-vanilla This new kernel enables to test if maintaining a kernel without additional patches is easier and faster: - Not having to refresh patches makes it faster to update the kernel. And the procedure to liberate the Arch Linux patches is also not documented (though with trial and errors someone can relatively easy manage to do it, but that's time consuming). - Some of the patches are never upstreamed so they stay there for years. This also means that what work in Parabola is broken in other FSDG compliant distributions because they don't use these patches. In addition this kernel also enable users to test their hardware with a stock linux-libre kernel. In the past the armv7h Parabola kernel carried out patches to make capes work on the Beaglebone Single Board Computers. This made me think that this feature was upstream because it worked in Parabola. The patches to do that were removed at some point so it stopped working. So if I started relying on it it would have been a very bad idea as it would have stopped working without even a warning. Signed-off-by: Denis 'GNUtoo' Carikli --- libre/linux-libre-vanilla/PKGBUILD | 344 +++++++++++++++++++++++++++++++++++++ 1 file changed, 344 insertions(+) create mode 100644 libre/linux-libre-vanilla/PKGBUILD (limited to 'libre/linux-libre-vanilla/PKGBUILD') diff --git a/libre/linux-libre-vanilla/PKGBUILD b/libre/linux-libre-vanilla/PKGBUILD new file mode 100644 index 000000000..e59c9f09a --- /dev/null +++ b/libre/linux-libre-vanilla/PKGBUILD @@ -0,0 +1,344 @@ +# 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 +# Maintainers: 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.3 +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 + git +) +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' + 'dac91c125a65ae7843206eda3d6cc7aaf6e3e8e07ef9348f336c0feb846a1285ea34d9cc3e547430a872da1064dcf22dbb1e2a0ed616de8c36c5da73fca790a2' + 'SKIP' + '13cb5bc42542e7b8bb104d5f68253f6609e463b6799800418af33eb0272cc269aaa36163c3e6f0aacbdaaa1d05e2827a4a7c4a08a029238439ed08b89c564bb3' + 'SKIP' + '7a3716bfe3b9f546da309c7492f3e08f8f506813afeb1c737a474c83313d5c313cf4582b65215c2cfce3b74d9d1021c96e8badafe8f6e5b01fe28d2b5c61ae78' + 'SKIP' + '267295aa0cea65684968420c68b32f1a66a22d018b9d2b2c1ef14267bcf4cb68aaf7099d073cbfefe6c25c8608bdcbbd45f7ac8893fdcecbf1e621abdfe9ecc1' + 'SKIP' + '4d20c1d0eed64bc64ac04e41e10288259212e00bc0967887e20e5ae277735d3a036c0a5ded08276455d2748af5787ebcf910329491eb43e84c204d6a9d76065f' + 'cf8aa9f4071f74f6cbd0314c8193f75b7e8bbb2caecb4b5b4c07d94eb61d9a70ed98ed0fc2db92ce9b4a796598b098e7cd0d171a660584e4da419870b329a599' + '51e8b4da770067e8257d292622d865cb16ac57fdfd8967bdfb74efec197dae9eab958e5637a728640ae60885bdde41c06c8076227a4f83db0b752215f91f3a87' + '53103bf55b957b657039510527df0df01279dec59cda115a4d6454e4135025d4546167fa30bdc99107f232561c1e096d8328609ab5a876cf7017176f92ad3e0b' + '167bc73c6c1c63931806238905dc44c7d87c5a5c0f6293159f2133dfe717fb44081018d810675716d1605ec7dff5e8333b87b19e09e2de21d0448e447437873b' + '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: -- cgit v1.2.3