# Contributor: A. Wilcox # Maintainer: Adelie Platform Group # KEEP THIS IN SYNC with the other easy-kernel packages. _kflavour="" _patchver=6 # must match 1000-version.patch _pkgname=easy-kernel$_kflavour pkgver=5.15.132 pkgrel=1 pkgname=$_pkgname-$pkgver-mc$_patchver pkgdesc="The Linux kernel, packaged for your convenience" url="https://kernel.org/" arch="all" options="!check !dbg !strip !tracedeps" license="GPL-2.0-only" depends="kernel-boot" makedepends="bc bison flex gzip kmod lzop openssl-dev xz" provides="easy-kernel$_kflavour=$pkgver-r$pkgrel" replaces="easy-kernel-power8 easy-kernel-power8-64k" subpackages="$_pkgname-modules-$pkgver-mc$_patchver:modules $_pkgname-src-$pkgver-mc$_patchver:src linux-headers:headers" _pkgmajver=${pkgver%%.*} _pkgminver=${pkgver%.*} source="https://cdn.kernel.org/pub/linux/kernel/v${_pkgmajver}.x/linux-${_pkgminver}.tar.xz config-aarch64 config-armv7 config-m68k config-pmmx config-ppc config-ppc64 config-sparc64 config-x86_64 kernel.h 0100-linux-5.15.132.patch 0120-XATTR_USER_PREFIX.patch 0122-link-security-restrictions.patch 0124-bluetooth-keysize-check.patch 0126-sign-file-libressl.patch 0200-x86-compile.patch 0202-fix-gcc13-build.patch 0210-fix-powerbook6-5-audio.patch 0255-ultra-ksm.patch 0260-reduce-swappiness.patch 0300-tmp513-regression-fix.patch 0500-print-fw-info.patch 0502-gcc9-kcflags.patch 1000-version.patch no-require-gnu-tar.patch no-require-lilo.patch no-autoload-fb.conf mkimage-missing-not-fatal.patch " builddir="$srcdir/linux-${_pkgminver}" prepare() { default_prepare cd "$srcdir" cp config-$CARCH linux-${_pkgminver}/.config cp -pr linux-${_pkgminver} linux-src if [ -f $HOME/kernel_key.pem ]; then cp $HOME/kernel_key.pem "$builddir"/certs/signing_key.pem fi } build() { make LDFLAGS="" cd "$srcdir/linux-src" make LDFLAGS="" modules_prepare clean cp "$builddir/Module.symvers" . # Kernel bug: crtsavres.o is required to build modules, but modules_prepare doesn't create it. if [ $CARCH = ppc ]; then cp "$builddir/arch/powerpc/lib/crtsavres.o" arch/powerpc/lib/ fi } package() { mkdir -p "$pkgdir"/boot make INSTALL_PATH="$pkgdir"/boot \ INSTALL_MOD_PATH="$pkgdir" \ install modules_install if [ -f "$pkgdir"/boot/vmlinuz ]; then mv "$pkgdir"/boot/vmlinuz \ "$pkgdir"/boot/vmlinuz-$pkgver-mc$_patchver-easy$_kflavour fi if [ -f "$pkgdir"/boot/vmlinux ]; then mv "$pkgdir"/boot/vmlinux \ "$pkgdir"/boot/vmlinux-$pkgver-mc$_patchver-easy$_kflavour fi if [ -f "$pkgdir"/boot/System.map ]; then mv "$pkgdir"/boot/System.map \ "$pkgdir"/boot/System.map-$pkgver-mc$_patchver-easy$_kflavour fi case $CARCH in aarch64|arm*) make INSTALL_PATH="$pkgdir"/boot dtbs_install ;; esac install -D "$builddir"/include/config/kernel.release \ "$pkgdir"/usr/share/kernel/easy-$pkgver-mc$_patchver$_kflavour/kernel.release } modules() { pkgdesc="Modules / device drivers for easy-kernel" provides="easy-kernel$_kflavour-modules=$pkgver-r$pkgrel" autodeps=0 # modules should not depend on src just for symlink mkdir -p "$subpkgdir"/lib mv "$pkgdir"/lib/modules "$subpkgdir"/lib rm "$subpkgdir"/lib/modules/$pkgver-mc$_patchver-easy$_kflavour/build rm "$subpkgdir"/lib/modules/$pkgver-mc$_patchver-easy$_kflavour/source ln -s "../../../usr/src/linux-$pkgver-mc$_patchver$_kflavour" \ "$subpkgdir"/lib/modules/$pkgver-mc$_patchver-easy$_kflavour/build ln -s "../../../usr/src/linux-$pkgver-mc$_patchver$_kflavour" \ "$subpkgdir"/lib/modules/$pkgver-mc$_patchver-easy$_kflavour/source mkdir -p "$subpkgdir"/etc/modprobe.d install -m644 "$srcdir"/no-autoload-fb.conf \ "$subpkgdir"/etc/modprobe.d/no-autoload-fb.conf } headers() { pkgdesc="System headers provided by the Linux kernel" mkdir -p "$subpkgdir"/usr make -C "$builddir" headers find "$builddir"/usr/include -name '.*' -delete rm "$builddir"/usr/include/Makefile cp -rv "$builddir"/usr/include "$subpkgdir/usr" find "$subpkgdir/usr" \( -name .install -o -name ..install.cmd \) -exec \ rm -f {} \; # provided by libdrm rm -rf "$subpkgdir"/usr/include/drm # needed for spl, VMware on x86, etc install -D -m644 "$builddir"/include/generated/utsrelease.h \ "$subpkgdir"/usr/include/linux/utsrelease.h install -m644 "$srcdir"/kernel.h "$subpkgdir"/usr/include/linux/kernel.h } src() { pkgdesc="Kernel source code used to build the kernel" provides="easy-kernel$_kflavour-src=$pkgver-r$pkgrel" mkdir -p "$subpkgdir"/usr/src mv "$srcdir"/linux-src "$subpkgdir"/usr/src/linux-$pkgver-mc$_patchver$_kflavour } sha512sums="d25ad40b5bcd6a4c6042fd0fd84e196e7a58024734c3e9a484fd0d5d54a0c1d87db8a3c784eff55e43b6f021709dc685eb0efa18d2aec327e4f88a79f405705a linux-5.15.tar.xz 1f11f9804070743b8d1b3f55a267c2c8da432e389fc45d2743978037c1f005dc8ec0e65e5c90fc4480f9750ff67e74b4fa8cdf2bb34bef767a2afe3699a8e158 config-aarch64 8e216a2dafeafdf10ec0f3387b7ca13a3809ff83906573d77ab703c6970e6ac3666d863c54e67b70368f2a111d2e9f8d09d4ba9a684fca902f1193a8d3fc2ccc config-armv7 f42f9931a0a31bf65781ffd1acd44f28c2b3f4966808c2a07983f1ffccf96167a31280c4e6f0eed4ad91643d85bd267eed3dc0603d14d47b4eceacf04f2222df config-m68k b440cbe7252aa55c2f80ad321d02371ecfdafc22e1e4f3fb72e1d398fb96fa90e2b811271b4d724d16696186000b8ee273b44f3446f763a89ed2c7e7f4b7703c config-pmmx 8f4b305cd8c81add318b88bb57c26d83dc1a6ed413dacc5b8c0bed7a11bc4149cba2a85085a96e8f61802dc210161f0cf87cee1826e64e4f224a7fd15fb3c326 config-ppc 9426c18b24889c18c051b3b88c68b958005e6c450047051fb25a8c0d2dd5ab5937e514b59da91a16ae9672e2ccc3b9ea62bd7d1fa0741732d52475f60fecbb9e config-ppc64 8401646537ff98382988b8e84b21d5ecf80b97587fd595c0dbb8848f7d0fe64fbaab4c8a949e12ef29a9b3d84be219d3eb3422848158c58f0797f2c4dfff352e config-sparc64 ccdf7575cf38fce07eda03c4ca85b650e2430a9c49337be0aa82d72867aa7c7708469c495efdd8caba0c965cc3bd606fbdbb84e97a8a9bacb50ef54bea1c91ad config-x86_64 1ca1bc094a8106b33176ab6cfb55c9514e7d69f1ed30c580eee419a3c422a2e6625d71c4581702e911f36c4bbac175010f46b7123bb81fda3303d4decdc57287 kernel.h a30efb8c4890d8be90c892cd73cf06e1701148888dcd729b1860b6bf519bca44690233197e6a8126fe51c522b9c0cb36030ff9dfe3ade7caf25d685e99333a7f 0100-linux-5.15.132.patch 3ed100909f9aed72836a3c712e45e0116cd3c4331961a76a27b867a7098d0df9458387b656c9ea01385c3c37585436e48168ac35666b0e46dca7da05e5e38a61 0120-XATTR_USER_PREFIX.patch 0cbe4d4fa685fff47c7b5a26630f6d34cae662ffc56066c75192452e3713bf15c43386d54d69564e4896e452efb95f1384565674253910bf6070b29aa1eff16b 0122-link-security-restrictions.patch dc47b18749d95a456f8bc47fd6a0618c286b646b38466c3d950dfbeb25adf3fc1a794e95552e4da1abb58e49f0bd841f7222e71c4d04cb0264ca23476ca9caef 0124-bluetooth-keysize-check.patch 79eaf814d76402a445efc961666a7c7c74207e552b0cb32d93d5cb828da580f7dbe93509dc9f53321c7844663205a8dce4e518ba047e4c57fc55f5c3498088ec 0126-sign-file-libressl.patch 16b8b8333fe89a68bc7f9a49b1bae263ab830692c12981640ac3dd9a0fb687f90b53783be05d47e5b38759ace4d99e82b59edd537a85a7ee27e21e65bbfa40a6 0200-x86-compile.patch 5361e374e1e7284ee6461a04dd60add55876b3b7e08c59adea3774716d3d7943b02f7c7684d8bba821f1cba36d59fb7e7f42f0bd3588c986c31508f1d703ce39 0202-fix-gcc13-build.patch 05376bf6307dc26d64f6cf7ee809deb81caf8b3040cb80170844505e3d5b10220d51879f047304bea4bde7c001c1924ae52dfc01f292890dab7f06dfb10264d9 0210-fix-powerbook6-5-audio.patch fbc6ae1ce30479b10b00915e7c5f80be9d5c75211c14c4cff3675712919cff47acc7a112327986b3bd47c025f4acf934688fe6dcc12c60e3253e572eae188705 0255-ultra-ksm.patch 9450d34f0a0efa6b11c5c84b4f8aed6a9095e8737673cdc731fd4c6ff9afa0b3e75e3d38a2542f72279a8be16aba8e8d4fd47535ca947302ed68a98e724c71b6 0260-reduce-swappiness.patch 4e637935c2f37cc18f347293e3c94b18f90e2caccca726304a95c4891257a5b2bb3093aee7a97571038b29c0c987cc60a9a80aefd0d4c9a063b33d102f03579e 0300-tmp513-regression-fix.patch dfd940af1d14e8a2cc1fcffbfa0fa8db52accf67cad3a7f435fc84047c945ba64dc3c45eb8dbbcc82715d8b8f2fbafa1e22b123158029016c5506cc134a7842c 0500-print-fw-info.patch f0e532539e93d19fc65b417b4a0663e3757823340b968f63bd3a2665f99524feebb843ecf88ccf6909f93a8e7e9290721677c8f43bc3a2a37d99a51c1281a469 0502-gcc9-kcflags.patch 1dd997cc66aa81d601485a27e74993ea398ae0dc4221b8791a65bbf602cca3527fa0faee2e3c7f693abd031209fe11840ec79cfa83d281de8af98e692c197343 1000-version.patch 03a73db9eda84a52315499cb511f730946939d2de1b3aa52c60f9bd3a364377a65ddf2b62f505689a84d3e2f0fc7da5ca90429629d93d9909360ee0c3c599bbe no-require-gnu-tar.patch aadf8a3cc46a08e3a396ebd45656aee235103db7a2155cc6980df20b750151a9938b8b73c9319c6cd1b5f8aba6ce707f857a47dabf69df8d91dd93d440cffcb5 no-require-lilo.patch 7bb07eb22002cc48caf0cd55d17ce4097aa583e0ca4048c11c92e1519761b2ae982ffe98311543d4b0dfc991c8bc411b2e1c7be9488b6c6f19ffaa08e69e2f47 no-autoload-fb.conf b0e0634c84440a480be208da5157b03cb914790faab08fd3fdc2faeceed2c0a03d52c0e029084190708190f80028648923c4fd6feb11ec68ab4f740488161b0a mkimage-missing-not-fatal.patch"