diff options
Diffstat (limited to 'kernels/linux-libre-x86_64/PKGBUILD')
-rw-r--r-- | kernels/linux-libre-x86_64/PKGBUILD | 298 |
1 files changed, 192 insertions, 106 deletions
diff --git a/kernels/linux-libre-x86_64/PKGBUILD b/kernels/linux-libre-x86_64/PKGBUILD index a562151c6..6d36591d7 100644 --- a/kernels/linux-libre-x86_64/PKGBUILD +++ b/kernels/linux-libre-x86_64/PKGBUILD @@ -3,37 +3,34 @@ # Based on the linux-libre package -pkgbase=linux-libre-x86_64 # Build stock kernel -#pkgbase=linux-libre-custom # Build kernel with a different name -_srcbasever=5.3-gnu -_srcver=5.3.1-gnu - -_replacesarchkernel=('linux%') # '%' gets replaced with _kernelname -_replacesoldkernels=() # '%' gets replaced with _kernelname -_replacesoldmodules=() # '%' gets replaced with _kernelname - -_srcname=linux-${_srcbasever%-*} -_archpkgver=${_srcver%-*} -pkgver=${_srcver//-/_} +_replacesarchkernel=('linux%') # '%' gets replaced with kernel suffix +_replacesoldkernels=() # '%' gets replaced with kernel suffix +_replacesoldmodules=() # '%' gets replaced with kernel suffix + +pkgbase=linux-libre-x86_64 +pkgver=5.4.8 pkgrel=1 -rcnver=5.3 -arch=(i686) +pkgdesc='Linux-libre-x86_64' +rcnver=5.4.5 +rcnrel=armv7-x13 url='https://linux-libre.fsfla.org/' +arch=(i686) license=(GPL2) makedepends=( - xmlto kmod inetutils bc libelf python-sphinx python-sphinx_rtd_theme - graphviz imagemagick + bc kmod libelf + xmlto python-sphinx python-sphinx_rtd_theme graphviz imagemagick ) makedepends+=('x86_64-pc-linux-gnu-gcc') options=('!strip') +_srcname=linux-5.4 source=( - "https://linux-libre.fsfla.org/pub/linux-libre/releases/$_srcbasever/linux-libre-$_srcbasever.tar.xz"{,.sign} - "https://linux-libre.fsfla.org/pub/linux-libre/releases/$_srcver/patch-$_srcbasever-$_srcver.xz"{,.sign} + "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.x86_64 # the kernel configuration for the x86_64 architecture - 60-linux.hook # pacman hook for depmod - 90-linux.hook # pacman hook for initramfs regeneration - linux.preset # standard config files for mkinitcpio ramdisk + 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 @@ -41,18 +38,42 @@ source=( # https://labs.parabola.nu/issues/877 # http://www.fsfla.org/pipermail/linux-libre/2015-November/003202.html 0002-fix-Atmel-maXTouch-touchscreen-support.patch - - # Arch's custom linux patches + # extracted patches from Arch Linux kernel sources 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch + 0002-lib-devres-add-a-helper-function-for-ioremap_uc.patch + 0003-mfd-intel-lpss-Use-devm_ioremap_uc-for-MMIO.patch + 0004-PCI-pciehp-Do-not-disable-interrupt-twice-on-suspend.patch + 0005-PCI-pciehp-Prevent-deadlock-on-disconnect.patch + 0006-ACPI-PM-s2idle-Rework-ACPI-events-synchronization.patch + 0007-iwlwifi-pcie-restore-support-for-Killer-Qu-C0-NICs.patch + 0008-x86-intel-Disable-HPET-on-Intel-Ice-Lake-platforms.patch + 0009-drm-i915-save-AUD_FREQ_CNTRL-state-at-audio-domain-s.patch + 0010-drm-i915-Fix-audio-power-up-sequence-for-gen10-displ.patch + 0011-drm-i915-extend-audio-CDCLK-2-BCLK-constraint-to-mor.patch + 0012-drm-i915-gt-Detect-if-we-miss-WaIdleLiteRestore.patch + 0013-pinctrl-sunrisepoint-Add-missing-Interrupt-Status-re.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 ) - validpgpkeys=( '474402C8C582DAFBE389C427BCB7CF877E7D47A7' # Alexandre Oliva '6DB9C4B4F0D8C0DC432CF6E4227CA7C556B2BA78' # David P. ) -sha512sums=('85d83c973ef96ab414354414da70ab3e1c3df19c3088458498cec1594952878b7967a8988bd9e36d4e728cc573a36e6eac056dbcab2f9aa742f18cbb4fb3164f' +sha512sums=('0d0915133864eb031adfc6700066147dcf3e768a50a31c39754950c95ef4fd322dc701cd50af49c403ef0325adfcb07e354d5e46c1be3dcdd719a7a55c963f37' 'SKIP' - 'f58ba041868ef3475ca3b4ad2943ed2df3da17e4eadb6597131e9903a95b734d4df22d096e7cf66d30778e88c9e799512b2e3f51119c997dc2b7a766c104bcc2' + '6cf4a01741eec4763e6bbb9762aafad815716f61d43b522da294cf8b2d2a1fc5228fffd710aa5e19aa4ffaa8e59b4ea37cfb987cb49d2cff064b8899b0558fba' 'SKIP' '13cb5bc42542e7b8bb104d5f68253f6609e463b6799800418af33eb0272cc269aaa36163c3e6f0aacbdaaa1d05e2827a4a7c4a08a029238439ed08b89c564bb3' 'SKIP' @@ -60,36 +81,80 @@ sha512sums=('85d83c973ef96ab414354414da70ab3e1c3df19c3088458498cec1594952878b796 'SKIP' '267295aa0cea65684968420c68b32f1a66a22d018b9d2b2c1ef14267bcf4cb68aaf7099d073cbfefe6c25c8608bdcbbd45f7ac8893fdcecbf1e621abdfe9ecc1' 'SKIP' - 'd2612290da75f07351af713518280ebd03f7b539120a4c7690ea721787254c6cd0f26f3b5ed2c316fdf4864378bc57f7979a89c799f8be1efff5b2cdfb1d3d94' - '7ad5be75ee422dda3b80edd2eb614d8a9181e2c8228cd68b3881e2fb95953bf2dea6cbe7900ce1013c9de89b2802574b7b24869fc5d7a95d3cc3112c4d27063a' - '2718b58dbbb15063bacb2bde6489e5b3c59afac4c0e0435b97fe720d42c711b6bcba926f67a8687878bd51373c9cf3adb1915a11666d79ccb220bf36e0788ab7' - '2dc6b0ba8f7dbf19d2446c5c5f1823587de89f4e28e9595937dd51a87755099656f2acec50e3e2546ea633ad1bfd1c722e0c2b91eef1d609103d8abdc0a7cbaf' + '4f0c8068f2532a60f3368ecc2147f6c33b19f934540655390751629b0981b1bf208f2ec563f5fcfbcf3537140bafd9ed0993cdc8f5b0b71914939d601afc4c29' + 'a923bb36ff24d3f2326b0b6bccb8cdfe2ed2ab2acdae17dfcaf9beb269995a52bfba751ad7e616544ef4b98dd9487a66fe04dae2ec2e7d724f8ac47382ee71bd' + 'b0dbc53ec688eae4ea92181fb7658361c2647b8f6271f145e35b36a93e5170ddc285ebd78c1218e239b4f551b8a4c75b6a9a8beff7367250b302d5900ad0cff5' + 'f01e7925b262d2874a8a991b1f27d057356a2a384d2012b61be5a631d4e4d7cf87461c8fb9e7f183831f5a829ad204897f1f0545a52df6288a0e04a5c2e31b96' + '167bc73c6c1c63931806238905dc44c7d87c5a5c0f6293159f2133dfe717fb44081018d810675716d1605ec7dff5e8333b87b19e09e2de21d0448e447437873b' + 'bb6718984a7357c9b00c37e4788480e5b8b75018c172ecc1441bc3fc5d2d42444eb5d8c7f9d2e3a7d6fed6d03acb565e3c0559486e494c40a7fe6bd0570c9ede' + '143dea30c6da00e504c99984a98a0eb2411f558fcdd9dfa7f607d6c14e9e7dffff9cb00121d9317044b07e3e210808286598c785ee854084b993ec9cb14d8232' '02af4dd2a007e41db0c63822c8ab3b80b5d25646af1906dc85d0ad9bb8bbf5236f8e381d7f91cf99ed4b0978c50aee37cb9567cdeef65b7ec3d91b882852b1af' 'b8fe56e14006ab866970ddbd501c054ae37186ddc065bb869cf7d18db8c0d455118d5bda3255fb66a0dde38b544655cfe9040ffe46e41d19830b47959b2fb168' - '2ff49b3e5ee3ca61494cfcd6e3ba5dc31d8b625a193f5c5f24aca55d91cbd60a91897bbf6953e172acc596e72b033b3eeb6041380efd52d90a3c832db563cbf4') -_kernelname=${pkgbase#linux-libre} -_replacesarchkernel=("${_replacesarchkernel[@]/\%/${_kernelname}}") -_replacesoldkernels=("${_replacesoldkernels[@]/\%/${_kernelname}}") -_replacesoldmodules=("${_replacesoldmodules[@]/\%/${_kernelname}}") - -KARCH=x86 + '19084ed74a127eaed636309d142fbac122a6593b2f10f42c70ef79663e318edd7d433fd268a88c036ce38545f7d2fb14a94fb903040ecbf16287b28073a59d32' + '1c5e6e98dbfc2ec9512967aa9c746d7396df0dcc3b8dff38106a6097528b4bfdb60dd9aee7cd189fb710780fb3593dc173e4c348076dd1ae25c7870d41d53286' + 'dbd1a0dff6ac0f481b4879b44aef5cf6ca9d37383c95ec664094138261bcaab689b873f688f77a6df4f11145a4fb27a4b0676fae5eae16e0f3cbe1392acf1266' + '51b47890987eca1def8019464eb41d3c32038fc4158f6a8e4f06adc2cb6567599fadd1835cb35d5edc7b144749ccafed0ad4f8ce4996edf2cf60fa5a46725f20' + 'a79a8900aae9ee2587cc7989b7e77215c63c0fc3bc75eb5ab0b50d378f6bb4072d46821514a97f81bd79498c6fb6ce97183110ccf7baa9b8434e560857f61611' + 'c94cfe2b0c9e02c020955f0315b6b61be51125f612ce50dff15d8a3bd8de2976a98df56283d0198f977570974c12b15219c457d2682927f8a0fd9344b3e324b6' + '629012611c1100cc832121c1d53da9a414abfe638a8273488ca319229a66a706ad15d88cdfe3b1769a6176ba7df24fe585f794a502e20e9134730fcfe0341dc3' + '809461f3c3e3ec6019b0cde26cf69dfb8f171c49cf8a95c59d4bc84cc331aad0c7f5c313844fb7c655cc54381d2737fb9cbedd4cd047c68b0bd217c480d6f7b0' + '2165f7e671c61d43b7bb89c3edcf3cd4bf16a4e57eccd44f18eabeadeae250ed57fe0fd20efc101e11d49444edb3956db05f6fe7038b0ce1c3cca37f96795e1c' + 'ff457ff06c3ea8e2a67346eb728540985f8a0dc172e818d381e88a97917b9c34d5b7938e49b08ce76692123c623f941714b31bd07c1b65e60beaa7e2b7ae5af9' + '277a8f3e9b0b015690ac82ef4e9c531d8e1a1ef2cb173ec73f807c649844623d1505f7f82d6b97134d1398e4a197586126d3df6c4925f40aaed7a60ed10c7986' + '3499d257cce45e9abc6ae040bb8f38c76dce6f23c1986c4b753a44f32528671d7d24ddd230ab639eb23f9081624f986697c604e1bdb12a0e4b91ea60ce91ea01' + 'b17d58ea538af2f250dd3587323cb36e96fbd8c0d406792e5b7dc828c6bce25fdf5834185cb42e327450b74cd0821260d1f53a84057a3d72b004394d9393e19d') +sha512sums_armv7h=('bc449032f904b5ef5c4506124871230587dd72849f7fed1d7e9f6ab6f530c24415dfa0f29b27fa98191a671c9646b6066fbf163b5533774307dc68f610e3958f' + 'SKIP' + 'b576a9c40ba59485c350f71b9234d9e71f245e25b26382bd2f67019f3309c3b5705a6020eae0a9dfccacc763fb2056a5937c0a8ff4e64f99ba1d60f0b2acb03f' + '85a13a274d4cbaca3ddbe8eaf883f1a1184765f8d09d6d40bb32defbe0876cb0153513e8db8671d7fc053e383ced793b74245ff29364a760e1a52bb36ebc8e85' + 'f9ce0bb4f06be6f742d8a31384e90fdab1a4686f14d5a8845e0c341dcfa62ae59db933237174223de9b32f9d91f99125c20ede7dff664755f1d42ea0cecdefdb' + 'b32623904f984118ebdd8ec31816885d73776ed80a68fa23925e67451f28a8f080dd8545307bb2f857435894adfa8b3db7c8a99aa02b8b3f2b5f8e3223d98a47' + 'd114f1e69504413e81dd67684f5b1ce69aa09d5bc768c7eee96a7d6b7ec47b32cd8f02593c878b0e9091475467de36a3d7c478e34a39148fa849548f53637b84' + 'bc0c6b1726679498393be8d4c417c62e1f356fe5c617c71ff23532652fdd5f314e5bfc6172eaca79cd4806b81031bf2f879d7d1a6050ad4c616c04e6bdf93c2a' + 'b13bea6412580325dba0d02cf0dc712e860f659569ffcb968aa4836fdb2882448cfee4659a675a70affccae02c8d2589d80b7239eef5ae7b615162aeaa76f3bb' + 'cff59f974651614587313674455a968ae5390a5ca825d204f0e2f8de2b422d577b007f5297a398e2afeb33ed0d324d34ad58ff4cd56e645bd4ca9a6bdc1354c5' + '54adbec4b6b85cda901df7d2b3eb1f517f10d3528326e60c7afa4b49ccc7cfb43b0d1f574ceb5d7d03c94a0fbcc97c0ef785258292dd26ed46728355da27332c') + +_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 - # add upstream patch - if [ "$_srcbasever" != "$_srcver" ]; then - patch -p1 -i ../patch-$_srcbasever-$_srcver + if [ "${_srcname##*-}" != "$pkgver" ]; then + msg2 "Applying upstream patch..." + patch -Np1 -i ../patch-${_srcname##*-}-gnu-$pkgver-gnu fi - # add freedo as boot logo + msg2 "Adding freedo as boot logo..." install -m644 -t drivers/video/logo \ ../logo_linux_{clut224.ppm,vga16.ppm,mono.pbm} msg2 "Setting version..." scripts/setlocalversion --save-scmversion echo "-$pkgrel" > localversion.10-pkgrel - echo "$_kernelname" > localversion.20-pkgname + 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 + msg2 "Applying patch $src_armv7h..." + patch -Np1 < "../$src_armv7h" + done + fi local src for src in "${source[@]}"; do @@ -104,8 +169,8 @@ prepare() { cp ../config.x86_64 .config make CROSS_COMPILE=x86_64-pc-linux-gnu- olddefconfig - make CROSS_COMPILE=x86_64-pc-linux-gnu- -s kernelrelease > ../version - msg2 "Prepared %s version %s" "$pkgbase" "$(<../version)" + make CROSS_COMPILE=x86_64-pc-linux-gnu- -s kernelrelease > version + msg2 "Prepared %s version %s" "$pkgbase" "$(<version)" } build() { @@ -114,78 +179,63 @@ build() { } _package() { - pkgdesc="The ${pkgbase^} kernel and modules" - [[ $pkgbase = linux-libre ]] && groups=(base base-openrc) - depends=(coreutils linux-libre-firmware kmod mkinitcpio) - optdepends=('crda: to set the correct wireless channels of your country') - provides=("${_replacesarchkernel[@]/%/=${_archpkgver}}" "LINUX-ABI_VERSION=${_srcver%%-*}") + pkgdesc="The $pkgdesc kernel and modules" + depends=(coreutils kmod initramfs) + optdepends=('crda: to set the correct wireless channels of your country' + 'linux-libre-firmware: firmware images needed for some devices') + provides=("${_replacesarchkernel[@]/%/=$pkgver}" "LINUX-ABI_VERSION=$pkgver") conflicts=("${_replacesarchkernel[@]}" "${_replacesoldkernels[@]}" "${_replacesoldmodules[@]}") replaces=("${_replacesarchkernel[@]}" "${_replacesoldkernels[@]}" "${_replacesoldmodules[@]}") - backup=("etc/mkinitcpio.d/$pkgbase.preset") - install=linux.install + cd $_srcname local kernver="$(<version)" local modulesdir="$pkgdir/usr/lib/modules/$kernver" - cd $_srcname - msg2 "Installing boot image..." + if [ "$CARCH" = "armv7h" ]; then + make INSTALL_DTBS_PATH="$pkgdir/boot/dtbs/$pkgbase" dtbs_install + fi # systemd expects to find the kernel here to allow hibernation # https://github.com/systemd/systemd/commit/edda44605f06a41fb86b7ab8128dcf99161d2344 install -Dm644 "$(make -s image_name)" "$modulesdir/vmlinuz" - install -Dm644 "$modulesdir/vmlinuz" "$pkgdir/boot/vmlinuz-$pkgbase" + + # Used by mkinitcpio to name the kernel + echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase" msg2 "Installing modules..." make INSTALL_MOD_PATH="$pkgdir/usr" modules_install - # a place for external modules, - # with version file for building modules and running depmod from hook - local extramodules="extramodules$_kernelname" - local extradir="$pkgdir/usr/lib/modules/$extramodules" - install -Dt "$extradir" -m644 ../version - ln -sr "$extradir" "$modulesdir/extramodules" - # remove build and source links rm "$modulesdir"/{source,build} - msg2 "Installing hooks..." - # sed expression for following substitutions - local subst=" - s|%PKGBASE%|$pkgbase|g - s|%KERNVER%|$kernver|g - s|%EXTRAMODULES%|$extramodules|g - " - - # hack to allow specifying an initially nonexisting install file - sed "$subst" "$startdir/$install" > "$startdir/$install.pkg" - true && install=$install.pkg - - # fill in mkinitcpio preset and pacman hooks - sed "$subst" ../linux.preset | install -Dm644 /dev/stdin \ - "$pkgdir/etc/mkinitcpio.d/$pkgbase.preset" - sed "$subst" ../60-linux.hook | install -Dm644 /dev/stdin \ - "$pkgdir/usr/share/libalpm/hooks/60-$pkgbase.hook" - sed "$subst" ../90-linux.hook | install -Dm644 /dev/stdin \ - "$pkgdir/usr/share/libalpm/hooks/90-$pkgbase.hook" + # armv7h presets only work with ALL_kver=$kernver + if [ "$CARCH" = "armv7h" ]; then + backup=("etc/mkinitcpio.d/$pkgbase.preset") + + msg2 "Installing mkinitcpio preset..." + sed "s|%PKGBASE%|$pkgbase|g;s|%KERNVER%|$kernver|g" ../linux-armv7h.preset \ + | install -Dm644 /dev/stdin "$pkgdir/etc/mkinitcpio.d/$pkgbase.preset" + fi msg2 "Fixing permissions..." chmod -Rc u=rwX,go=rX "$pkgdir" } _package-headers() { - pkgdesc="Header files and scripts for building modules for ${pkgbase^} kernel" - provides=("${_replacesarchkernel[@]/%/-headers=${_archpkgver}}") + pkgdesc="Headers and scripts for building modules for the $pkgdesc kernel" + provides=("${_replacesarchkernel[@]/%/-headers=$pkgver}") conflicts=("${_replacesarchkernel[@]/%/-headers}" "${_replacesoldkernels[@]/%/-headers}") replaces=("${_replacesarchkernel[@]/%/-headers}" "${_replacesoldkernels[@]/%/-headers}") - local builddir="$pkgdir/usr/lib/modules/$(<version)/build" - cd $_srcname + local builddir="$pkgdir/usr/lib/modules/$(<version)/build" msg2 "Installing build files..." - install -Dt "$builddir" -m644 Makefile .config Module.symvers System.map vmlinux + install -Dt "$builddir" -m644 .config Makefile Module.symvers System.map \ + localversion.* version vmlinux install -Dt "$builddir/kernel" -m644 kernel/Makefile install -Dt "$builddir/arch/$KARCH" -m644 arch/$KARCH/Makefile + install -Dt "$builddir/arch/$KARCH" -m644 arch/$KARCH/Makefile_32.cpu cp -t "$builddir" -a scripts # add objtool for external module building and enabled VALIDATION_STACK option @@ -196,9 +246,6 @@ _package-headers() { # add xfs and shmem for aufs building mkdir -p "$builddir"/{fs/xfs,mm} - # ??? - mkdir "$builddir/.tmp_versions" - msg2 "Installing headers..." cp -t "$builddir" -a include cp -t "$builddir/arch/$KARCH" -a arch/$KARCH/include @@ -229,6 +276,22 @@ _package-headers() { msg2 "Removing documentation..." rm -r "$builddir/Documentation" + # Parabola changes + # + # since we don't want to diverge too much from Arch's PKGBUILD, we'll + # start marking our changes as such + if [ "$CARCH" = "armv7h" ]; then + for i in dove exynos omap2; do + mkdir -p "$pkgdir/usr/lib/modules/$kernver/build/arch/$KARCH/mach-$i" + cp -a arch/$KARCH/mach-$i/include "$pkgdir/usr/lib/modules/$kernver/build/arch/$KARCH/mach-$i/" + done + for i in omap orion samsung versatile; do + mkdir -p "$pkgdir/usr/lib/modules/$kernver/build/arch/$KARCH/plat-$i" + cp -a arch/$KARCH/plat-$i/include "$pkgdir/usr/lib/modules/$kernver/build/arch/$KARCH/plat-$i/" + done + fi + # end of Parabola changes + msg2 "Removing broken symlinks..." find -L "$builddir" -type l -printf 'Removing %P\n' -delete @@ -252,37 +315,28 @@ _package-headers() { msg2 "Adding symlink..." mkdir -p "$pkgdir/usr/src" - ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase-$pkgver" + ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase" msg2 "Fixing permissions..." chmod -Rc u=rwX,go=rX "$pkgdir" } _package-docs() { - pkgdesc="Kernel hackers manual - HTML documentation that comes with the ${pkgbase^} kernel" - provides=("${_replacesarchkernel[@]/%/-docs=${_archpkgver}}") + pkgdesc="Documentation for the $pkgdesc kernel" + provides=("${_replacesarchkernel[@]/%/-docs=$pkgver}") conflicts=("${_replacesarchkernel[@]/%/-docs}" "${_replacesoldkernels[@]/%/-docs}") replaces=("${_replacesarchkernel[@]/%/-docs}" "${_replacesoldkernels[@]/%/-docs}") - - local builddir="$pkgdir/usr/lib/modules/$(<version)/build" cd $_srcname + local builddir="$pkgdir/usr/lib/modules/$(<version)/build" msg2 "Installing documentation..." - mkdir -p "$builddir" - cp -t "$builddir" -a Documentation - - msg2 "Removing doctrees..." - rm -r "$builddir/Documentation/output/.doctrees" - - msg2 "Moving HTML docs..." local src dst while read -rd '' src; do - dst="$builddir/Documentation/${src#$builddir/Documentation/output/}" - mkdir -p "${dst%/*}" - mv "$src" "$dst" - rmdir -p --ignore-fail-on-non-empty "${src%/*}" - done < <(find "$builddir/Documentation/output" -type f -print0) + dst="${src#Documentation/}" + dst="$builddir/Documentation/${dst#output/}" + install -Dm644 "$src" "$dst" + done < <(find Documentation -name '.*' -prune -o ! -type d -print0) msg2 "Adding symlink..." mkdir -p "$pkgdir/usr/share/doc" @@ -292,7 +346,39 @@ _package-docs() { chmod -Rc u=rwX,go=rX "$pkgdir" } +_package-chromebook() { + pkgdesc="Kernel image sign for $pkgdesc - Chromebooks" + depends=(linux-libre=$pkgver) + provides=("${_replacesarchkernel[@]/%/-armv7-chromebook=$pkgver}") + conflicts=("${_replacesarchkernel[@]/%/-armv7-chromebook}" "${_replacesoldkernels[@]/%/-armv7-chromebook}") + replaces=("${_replacesarchkernel[@]/%/-armv7-chromebook}" "${_replacesoldkernels[@]/%/-armv7-chromebook}") + install=linux-chromebook.install + + cd $_srcname + + cp ../kernel.its . + mkimage -D "-I dts -O dtb -p 2048" -f kernel.its kernel.itb + dd if=/dev/zero of=bootloader.bin bs=512 count=1 + echo 'console=tty0 init=/sbin/init root=PARTUUID=%U/PARTNROFF=1 rootwait rw noinitrd' > cmdline + + msg2 "Creating kernel sign..." + vbutil_kernel \ + --pack vmlinux.kpart \ + --version 1 \ + --vmlinuz kernel.itb \ + --arch arm \ + --keyblock ../kernel.keyblock \ + --signprivate ../kernel_data_key.vbprivk \ + --config cmdline \ + --bootloader bootloader.bin + + msg2 "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}") |