PKGBUILD 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  1. # Maintainer: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
  2. # Feel free to push modifications or take over maintainership
  3. # Based on the linux-libre package
  4. _replacesarchkernel=('linux%') # '%' gets replaced with kernel suffix
  5. _replacesoldkernels=() # '%' gets replaced with kernel suffix
  6. _replacesoldmodules=() # '%' gets replaced with kernel suffix
  7. pkgbase=linux-libre-64
  8. pkgver=5.11.11
  9. pkgrel=3
  10. pkgdesc="64bit Linux-libre for Parabola $CARCH"
  11. rcnver=5.11.11
  12. rcnrel=armv7-x14
  13. url='https://linux-libre.fsfla.org/'
  14. arch=(armv7h i686)
  15. license=(GPL2)
  16. conflicts_armv7h=('linux-libre-aarch64')
  17. replaces_armv7h=('linux-libre-aarch64')
  18. conflicts_i686=('linux-libre-x86_64')
  19. replaces_i686=('linux-libre-x86_64')
  20. makedepends=(
  21. bc kmod libelf pahole cpio perl tar xz
  22. xmlto python-sphinx python-sphinx_rtd_theme graphviz imagemagick
  23. )
  24. makedepends_i686+=('x86_64-pc-linux-gnu-gcc')
  25. makedepends_armv7h=(uboot-tools vboot-utils dtc) # required by linux-libre-chromebook
  26. makedepends_armv7h+=('aarch64-linux-gnu-gcc-initial')
  27. options=('!strip')
  28. _srcname=linux-5.11
  29. source=(
  30. "https://linux-libre.fsfla.org/pub/linux-libre/releases/${_srcname##*-}-gnu/linux-libre-${_srcname##*-}-gnu.tar.xz"{,.sign}
  31. "https://linux-libre.fsfla.org/pub/linux-libre/releases/$pkgver-gnu/patch-${_srcname##*-}-gnu-$pkgver-gnu.xz"{,.sign}
  32. "https://repo.parabola.nu/other/linux-libre/logos/logo_linux_"{clut224.ppm,vga16.ppm,mono.pbm}{,.sig}
  33. config.i686 config.x86_64 config.armv7h # the main kernel config files
  34. linux-armv7h.preset # armv7h preset file for mkinitcpio ramdisk
  35. "kernel"{.its,.keyblock,_data_key.vbprivk} # files for signing Chromebooks kernels
  36. # maintain the TTY over USB disconnects
  37. # http://www.coreboot.org/EHCI_Gadget_Debug
  38. 0001-usb-serial-gadget-no-TTY-hangup-on-USB-disconnect-WI.patch
  39. # fix Atmel maXTouch touchscreen support
  40. # https://labs.parabola.nu/issues/877
  41. # http://www.fsfla.org/pipermail/linux-libre/2015-November/003202.html
  42. 0002-fix-Atmel-maXTouch-touchscreen-support.patch
  43. # Arch Linux patches
  44. 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch
  45. 0002-iommu-amd-Don-t-initialise-remapping-irqdomain-if-IO.patch
  46. )
  47. source_i686=(
  48. # avoid using zstd compression in ultra mode (exhausts virtual memory)
  49. no-ultra-zstd.patch
  50. )
  51. source_armv7h=(
  52. # RCN patch (CM3 firmware deblobbed and bloatware removed)
  53. "https://repo.parabola.nu/other/rcn-libre/patches/$rcnver/rcn-libre-$rcnver-$rcnrel.patch"{,.sig}
  54. # Arch Linux ARM patches
  55. 0001-ARM-atags-add-support-for-Marvell-s-u-boot.patch
  56. 0002-ARM-atags-fdt-retrieve-MAC-addresses-from-Marvell-bo.patch
  57. 0003-SMILE-Plug-device-tree-file.patch
  58. 0004-fix-mvsdio-eMMC-timing.patch
  59. 0005-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch
  60. 0006-set-default-cubietruck-led-triggers.patch
  61. 0007-exynos4412-odroid-set-higher-minimum-buck2-regulator.patch
  62. 0008-ARM-dove-enable-ethernet-on-D3Plug.patch
  63. 0009-USB-Armory-MkII-support.patch
  64. # ChromiumOS patches
  65. 0001-CHROMIUM-block-partitions-efi-Add-support-for-IGNORE.patch
  66. )
  67. source_armv7h+=(config.aarch64)
  68. validpgpkeys=(
  69. '474402C8C582DAFBE389C427BCB7CF877E7D47A7' # Alexandre Oliva
  70. '6DB9C4B4F0D8C0DC432CF6E4227CA7C556B2BA78' # David P.
  71. )
  72. sha512sums=('3a34006add9ea318b0c2863388925ba34d57d342535b00c9ebc61fbfc69ef206b64af21c35b101466508c4308b5da310743c8add74dd703e259612953104ae43'
  73. 'SKIP'
  74. 'b35fc1d243fa3fdfa2b50b8f01ccab297f958f497e58a104da18631fafe3923216f3f1e97b9c2bb9e719c8a7ae8cabe8198a1a82cb5e8e50488b64d7af4dc940'
  75. 'SKIP'
  76. '13cb5bc42542e7b8bb104d5f68253f6609e463b6799800418af33eb0272cc269aaa36163c3e6f0aacbdaaa1d05e2827a4a7c4a08a029238439ed08b89c564bb3'
  77. 'SKIP'
  78. '7a3716bfe3b9f546da309c7492f3e08f8f506813afeb1c737a474c83313d5c313cf4582b65215c2cfce3b74d9d1021c96e8badafe8f6e5b01fe28d2b5c61ae78'
  79. 'SKIP'
  80. '267295aa0cea65684968420c68b32f1a66a22d018b9d2b2c1ef14267bcf4cb68aaf7099d073cbfefe6c25c8608bdcbbd45f7ac8893fdcecbf1e621abdfe9ecc1'
  81. 'SKIP'
  82. '8a617e10ca40401d89e5a1c78b0936a47d340d56c438d04499df626743799ed2835c2ebb246905c2b5b8842d9622157f80b93f3b0f97575334c81ce68882fa2b'
  83. 'f3b148250fd8a393c6998c50331da811bc56127cce7cd13c887e60ad8327d0c991022b09c0e02743bd9086ad200c4957c7de5699bbeb7dfb042f603e4776e0d4'
  84. '51e8b4da770067e8257d292622d865cb16ac57fdfd8967bdfb74efec197dae9eab958e5637a728640ae60885bdde41c06c8076227a4f83db0b752215f91f3a87'
  85. '53103bf55b957b657039510527df0df01279dec59cda115a4d6454e4135025d4546167fa30bdc99107f232561c1e096d8328609ab5a876cf7017176f92ad3e0b'
  86. '167bc73c6c1c63931806238905dc44c7d87c5a5c0f6293159f2133dfe717fb44081018d810675716d1605ec7dff5e8333b87b19e09e2de21d0448e447437873b'
  87. 'bb6718984a7357c9b00c37e4788480e5b8b75018c172ecc1441bc3fc5d2d42444eb5d8c7f9d2e3a7d6fed6d03acb565e3c0559486e494c40a7fe6bd0570c9ede'
  88. '143dea30c6da00e504c99984a98a0eb2411f558fcdd9dfa7f607d6c14e9e7dffff9cb00121d9317044b07e3e210808286598c785ee854084b993ec9cb14d8232'
  89. '02af4dd2a007e41db0c63822c8ab3b80b5d25646af1906dc85d0ad9bb8bbf5236f8e381d7f91cf99ed4b0978c50aee37cb9567cdeef65b7ec3d91b882852b1af'
  90. 'b8fe56e14006ab866970ddbd501c054ae37186ddc065bb869cf7d18db8c0d455118d5bda3255fb66a0dde38b544655cfe9040ffe46e41d19830b47959b2fb168'
  91. '748d98aef69e93959eab6a7f20a7972aff50c577a079bba807b10fe9b3b98799b47215d76797360d336ba4c3c656d7eafe3e81f2a59a2b6888d1884071db6e95'
  92. 'da919328f8f7efd2c177a68ff864fdf1a76d777c142af4c90d3efc4a8419599e3479f8e0de0e8282599b9030c33a9e3b46548005d36c058ab08b51c03732bb45')
  93. sha512sums_i686=('3a346ff5e0fdefafd28bc3dd0e4b6cd68e3f0014e59d1611d99f2edb8d074fd32649eeb0894a7e340e4f907b5cfc0e08e0753e0427a68dc113bb22835a892968')
  94. sha512sums_armv7h=('a4aa00ca3f03d524d3fb6379116c4e4e7908e7c30f6347f55be256c44d806d8db5f04c96369d5a725e45b7390e9fde842f388cdc5d5699d80ec5d1519f7367f4'
  95. 'SKIP'
  96. 'b832287560c841e292d71be01c65045ee2ee6ac41f05176ebe349d730b5b79887bb629d176d5fd16a3e7ebb5e51de30b6d6fad6fad53821063188248bd1415bb'
  97. 'f997a0afaaffb66533168f5d9cc341871eb54feb88d6ce578e816add82596bedf4dc242510e171e1e5b56464cf701384a32ed916176ea0c2db24209d754d3c58'
  98. '96b97f6e721d179d88e7b4084ebb62ce30ddd13cbbcb367147e6646c8487107af36b3610d10e53abffae3a83736cdd7734e5dbcadb1909ced278f40a20302861'
  99. '14f3ef9f2211e98198e96bd4f91978720acd703ee778698b85916cef73c1aea648d1d08a075f2ed334f5c27b9933274fa0651401e0baa3570f389a20aaec54e8'
  100. 'b464e9af459c37c929ba30cdb7eb575038e970c9d91ff98fa37c0bc6161538b42a802dde34882772cf665130038158cb985fe06d65313f7c584c6c63045199d8'
  101. '9d8019b8f525d5614d476ac34a35a40e8e1994f444a686b561c57b8ae488fcc44ffca9d034cea7b2271a2b7a7fa3a2ba2fcaa452504c320eff0bc3fc4de64ed2'
  102. 'b3cf13c44b8b35bb7610206161a251cbf90299b0533e8e23465b9ae566feed510c5722aceadb7e2097de439362d0689de5692a091cbe8bec2994ef5290622095'
  103. '463d68de99f434fd3409ee620eaa7b648d6627c5a04cfeab65b91053129e71bf906db817fd9770297ae1e38f8a5a84be4d20a1d1717e6821478f2c1bbc416cb2'
  104. '813fbfb17659e4e7512367f03b06f9bc54070886f5e7206548deced60032f92d3ca0beb78416706662bf713cb0f7a5d8d81f8f08b911ca8254b417e82306d829'
  105. '7bda2ad7eb81af802873cb6764cb9c675ec50ceeb5adc487881ebc8c316cf55f836e56c2cc67494a2920e86494861db2eb924b7ff9b151ae3c5b0e493c373bf9')
  106. sha512sums_armv7h+=('65bcfcb2cd5515ffe0dde33bfc6ec07cc42a41647a6d28fe88ea7020f69f8ffac4f599a77909b14171b5efd82c06276f2910c384dbce100ac662080938d44552')
  107. _replacesarchkernel=("${_replacesarchkernel[@]/\%/${pkgbase#linux-libre}}")
  108. _replacesoldkernels=("${_replacesoldkernels[@]/\%/${pkgbase#linux-libre}}")
  109. _replacesoldmodules=("${_replacesoldmodules[@]/\%/${pkgbase#linux-libre}}")
  110. case "$CARCH" in
  111. i686) KARCH=x86;CROSS_COMPILE=x86_64-pc-linux-gnu-;;
  112. armv7h) KARCH=arm64;CROSS_COMPILE=aarch64-linux-gnu-;;
  113. esac
  114. export STRIP=${CROSS_COMPILE}strip
  115. export KBUILD_BUILD_HOST=parabola
  116. export KBUILD_BUILD_USER=$pkgbase
  117. export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})"
  118. prepare() {
  119. cd $_srcname
  120. if [ "${_srcname##*-}" != "$pkgver" ]; then
  121. echo "Applying upstream patch..."
  122. patch -Np1 < "../patch-${_srcname##*-}-gnu-$pkgver-gnu"
  123. fi
  124. echo "Adding freedo as boot logo..."
  125. install -m644 -t drivers/video/logo \
  126. ../logo_linux_{clut224.ppm,vga16.ppm,mono.pbm}
  127. echo "Setting version..."
  128. scripts/setlocalversion --save-scmversion
  129. echo "-$pkgrel" > localversion.10-pkgrel
  130. echo "${pkgbase#linux-libre}" > localversion.20-pkgname
  131. if [ "$CARCH" = "armv7h" ]; then
  132. local src_armv7h
  133. for src_armv7h in "${source_armv7h[@]}"; do
  134. src_armv7h="${src_armv7h%%::*}"
  135. src_armv7h="${src_armv7h##*/}"
  136. [[ $src_armv7h = *.patch ]] || continue
  137. echo "Applying patch $src_armv7h..."
  138. patch -Np1 < "../$src_armv7h"
  139. done
  140. fi
  141. if [ "$CARCH" = "i686" ]; then
  142. local src_i686
  143. for src_i686 in "${source_i686[@]}"; do
  144. src_i686="${src_i686%%::*}"
  145. src_i686="${src_i686##*/}"
  146. [[ $src_i686 = *.patch ]] || continue
  147. echo "Applying patch $src_i686..."
  148. patch -Np1 < "../$src_i686"
  149. done
  150. fi
  151. local src
  152. for src in "${source[@]}"; do
  153. src="${src%%::*}"
  154. src="${src##*/}"
  155. [[ $src = *.patch ]] || continue
  156. echo "Applying patch $src..."
  157. patch -Np1 < "../$src"
  158. done
  159. echo "Setting config..."
  160. case "$CARCH" in
  161. i686) cp ../config.x86_64 .config;;
  162. # config.aarch64 comes straight from Arch Linux ARM and doesn't have the
  163. # compatibility for 32bit rootfs enabled. This makes maintenance faster than
  164. # having to modify the configuration file by hand at each new kernel release.
  165. armv7h) cp ../config.aarch64 .config;echo 'CONFIG_COMPAT=y' >> .config;;
  166. esac
  167. make ARCH=$KARCH CROSS_COMPILE=$CROSS_COMPILE olddefconfig
  168. make ARCH=$KARCH CROSS_COMPILE=$CROSS_COMPILE -s kernelrelease > version
  169. echo "Prepared $pkgbase version $(<version)"
  170. }
  171. build() {
  172. cd $_srcname
  173. make ARCH=$KARCH CROSS_COMPILE=$CROSS_COMPILE all
  174. make ARCH=$KARCH CROSS_COMPILE=$CROSS_COMPILE htmldocs
  175. }
  176. _package() {
  177. pkgdesc="The $pkgdesc kernel and modules"
  178. depends=(coreutils kmod initramfs)
  179. optdepends=('crda: to set the correct wireless channels of your country'
  180. 'linux-libre-firmware: firmware images needed for some devices')
  181. provides=(VIRTUALBOX-GUEST-MODULES WIREGUARD-MODULE)
  182. replaces=(virtualbox-guest-modules-arch wireguard-arch)
  183. provides+=("${_replacesarchkernel[@]/%/=$pkgver}" "LINUX-ABI_VERSION=$pkgver")
  184. conflicts+=("${_replacesarchkernel[@]}" "${_replacesoldkernels[@]}" "${_replacesoldmodules[@]}")
  185. replaces+=("${_replacesarchkernel[@]}" "${_replacesoldkernels[@]}" "${_replacesoldmodules[@]}")
  186. cd $_srcname
  187. local kernver="$(<version)"
  188. local modulesdir="$pkgdir/usr/lib/modules/$kernver"
  189. echo "Installing boot image..."
  190. # systemd expects to find the kernel here to allow hibernation
  191. # https://github.com/systemd/systemd/commit/edda44605f06a41fb86b7ab8128dcf99161d2344
  192. # The default image target is Image.gz on arm64 but some u-boot
  193. # configurations and/or versions don't support that, so we use Image instead.
  194. if [ "$KARCH" = "arm64" ]; then
  195. install -Dm644 arch/$KARCH/boot/Image "$modulesdir/vmlinuz"
  196. else
  197. install -Dm644 "$(make ARCH=$KARCH CROSS_COMPILE=$CROSS_COMPILE -s image_name)" "$modulesdir/vmlinuz"
  198. fi
  199. # Used by mkinitcpio to name the kernel
  200. echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase"
  201. echo "Installing modules..."
  202. make ARCH=$KARCH CROSS_COMPILE=$CROSS_COMPILE INSTALL_MOD_PATH="$pkgdir/usr" INSTALL_MOD_STRIP=1 modules_install
  203. # remove build and source links
  204. rm "$modulesdir"/{source,build}
  205. if [ "$CARCH" = "armv7h" ]; then
  206. echo "Installing device tree binaries..."
  207. make ARCH=$KARCH CROSS_COMPILE=$CROSS_COMPILE INSTALL_DTBS_PATH="$pkgdir/boot/dtbs/$pkgbase" dtbs_install
  208. # armv7h presets only work with ALL_kver=$kernver
  209. backup=("etc/mkinitcpio.d/$pkgbase.preset")
  210. echo "Installing mkinitcpio preset..."
  211. sed "s|%PKGBASE%|$pkgbase|g;s|%KERNVER%|$kernver|g" ../linux-armv7h.preset \
  212. | install -Dm644 /dev/stdin "$pkgdir/etc/mkinitcpio.d/$pkgbase.preset"
  213. fi
  214. }
  215. _package-headers() {
  216. pkgdesc="Headers and scripts for building modules for the $pkgdesc kernel"
  217. depends=(pahole)
  218. provides=("${_replacesarchkernel[@]/%/-headers=$pkgver}")
  219. conflicts=("${_replacesarchkernel[@]/%/-headers}" "${_replacesoldkernels[@]/%/-headers}")
  220. replaces=("${_replacesarchkernel[@]/%/-headers}" "${_replacesoldkernels[@]/%/-headers}")
  221. cd $_srcname
  222. local builddir="$pkgdir/usr/lib/modules/$(<version)/build"
  223. echo "Installing build files..."
  224. install -Dt "$builddir" -m644 .config Makefile Module.symvers System.map \
  225. localversion.* version vmlinux
  226. install -Dt "$builddir/kernel" -m644 kernel/Makefile
  227. install -Dt "$builddir/arch/$KARCH" -m644 arch/$KARCH/Makefile
  228. if [[ $CARCH = i686 ]]; then
  229. install -Dt "$builddir/arch/$KARCH" -m644 arch/$KARCH/Makefile_32.cpu
  230. fi
  231. cp -t "$builddir" -a scripts
  232. # add objtool for external module building and enabled VALIDATION_STACK option
  233. if [[ -e tools/objtool/objtool ]]; then
  234. install -Dt "$builddir/tools/objtool" tools/objtool/objtool
  235. fi
  236. # add xfs and shmem for aufs building
  237. mkdir -p "$builddir"/{fs/xfs,mm}
  238. echo "Installing headers..."
  239. cp -t "$builddir" -a include
  240. cp -t "$builddir/arch/$KARCH" -a arch/$KARCH/include
  241. install -Dt "$builddir/arch/$KARCH/kernel" -m644 arch/$KARCH/kernel/asm-offsets.s
  242. install -Dt "$builddir/drivers/md" -m644 drivers/md/*.h
  243. install -Dt "$builddir/net/mac80211" -m644 net/mac80211/*.h
  244. # http://bugs.archlinux.org/task/13146
  245. install -Dt "$builddir/drivers/media/i2c" -m644 drivers/media/i2c/msp3400-driver.h
  246. # http://bugs.archlinux.org/task/20402
  247. install -Dt "$builddir/drivers/media/usb/dvb-usb" -m644 drivers/media/usb/dvb-usb/*.h
  248. install -Dt "$builddir/drivers/media/dvb-frontends" -m644 drivers/media/dvb-frontends/*.h
  249. install -Dt "$builddir/drivers/media/tuners" -m644 drivers/media/tuners/*.h
  250. echo "Installing KConfig files..."
  251. find . -name 'Kconfig*' -exec install -Dm644 {} "$builddir/{}" \;
  252. echo "Removing unneeded architectures..."
  253. local arch
  254. for arch in "$builddir"/arch/*/; do
  255. [[ $arch = */$KARCH/ ]] && continue
  256. echo "Removing $(basename "$arch")"
  257. rm -r "$arch"
  258. done
  259. echo "Removing documentation..."
  260. rm -r "$builddir/Documentation"
  261. echo "Removing broken symlinks..."
  262. find -L "$builddir" -type l -printf 'Removing %P\n' -delete
  263. echo "Removing loose objects..."
  264. find "$builddir" -type f -name '*.o' -printf 'Removing %P\n' -delete
  265. echo "Stripping build tools..."
  266. local file
  267. while read -rd '' file; do
  268. case "$(file -bi "$file")" in
  269. application/x-sharedlib\;*) # Libraries (.so)
  270. ${STRIP} -v $STRIP_SHARED "$file" ;;
  271. application/x-archive\;*) # Libraries (.a)
  272. ${STRIP} -v $STRIP_STATIC "$file" ;;
  273. application/x-executable\;*) # Binaries
  274. ${STRIP} -v $STRIP_BINARIES "$file" ;;
  275. application/x-pie-executable\;*) # Relocatable binaries
  276. ${STRIP} -v $STRIP_SHARED "$file" ;;
  277. esac
  278. done < <(find "$builddir" -type f -perm -u+x ! -name vmlinux -print0)
  279. echo "Stripping vmlinux..."
  280. ${STRIP} -v $STRIP_STATIC "$builddir/vmlinux"
  281. echo "Adding symlink..."
  282. mkdir -p "$pkgdir/usr/src"
  283. ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase"
  284. }
  285. _package-docs() {
  286. pkgdesc="Documentation for the $pkgdesc kernel"
  287. provides=("${_replacesarchkernel[@]/%/-docs=$pkgver}")
  288. conflicts=("${_replacesarchkernel[@]/%/-docs}" "${_replacesoldkernels[@]/%/-docs}")
  289. replaces=("${_replacesarchkernel[@]/%/-docs}" "${_replacesoldkernels[@]/%/-docs}")
  290. cd $_srcname
  291. local builddir="$pkgdir/usr/lib/modules/$(<version)/build"
  292. echo "Installing documentation..."
  293. local src dst
  294. while read -rd '' src; do
  295. dst="${src#Documentation/}"
  296. dst="$builddir/Documentation/${dst#output/}"
  297. install -Dm644 "$src" "$dst"
  298. done < <(find Documentation -name '.*' -prune -o ! -type d -print0)
  299. echo "Adding symlink..."
  300. mkdir -p "$pkgdir/usr/share/doc"
  301. ln -sr "$builddir/Documentation" "$pkgdir/usr/share/doc/$pkgbase"
  302. }
  303. _package-chromebook() {
  304. pkgdesc="Experimental $pkgdesc kernel sign for Veyron Chromebooks"
  305. depends=(linux-libre-64=$pkgver)
  306. provides+=("linux-libre-chromebook=$pkgver")
  307. conflicts+=('linux-libre-chromebook')
  308. replaces+=('linux-libre-chromebook')
  309. install=linux-libre-chromebook.install
  310. cd $_srcname
  311. cp ../kernel.its .
  312. mkimage -D "-I dts -O dtb -p 2048" -f kernel.its kernel.signed
  313. dd if=/dev/zero of=bootloader.bin bs=512 count=1
  314. echo 'console=tty0 init=/sbin/init root=PARTUUID=%U/PARTNROFF=1 rootwait rw noinitrd' > cmdline
  315. echo "Creating kernel sign..."
  316. vbutil_kernel \
  317. --pack vmlinux.kpart \
  318. --version 1 \
  319. --vmlinuz kernel.signed \
  320. --arch aarch64 \
  321. --keyblock ../kernel.keyblock \
  322. --signprivate ../kernel_data_key.vbprivk \
  323. --config cmdline \
  324. --bootloader bootloader.bin
  325. echo "Installing kernel sign..."
  326. mkdir -p "$pkgdir/boot"
  327. cp vmlinux.kpart "$pkgdir/boot"
  328. }
  329. pkgname=("$pkgbase" "$pkgbase-headers" "$pkgbase-docs")
  330. # The chromebook package is disabled until the following error is fixed:
  331. # | ==> Starting package_linux-libre-64-chromebook()...
  332. # | FATAL ERROR: Couldn't open "arch/arm/boot/zImage": No such file or directory
  333. # | mkimage: Can't read kernel.signed.tmp: Invalid argument
  334. # [[ $CARCH = armv7h ]] && pkgname+=("$pkgbase-chromebook")
  335. for _p in "${pkgname[@]}"; do
  336. eval "package_$_p() {
  337. $(declare -f "_package${_p#$pkgbase}")
  338. _package${_p#$pkgbase}
  339. }"
  340. done
  341. # vim:set ts=8 sts=2 sw=2 et: