diff options
author | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2020-01-15 14:56:57 +0100 |
---|---|---|
committer | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2020-01-21 14:12:10 +0100 |
commit | a08673fd3d3115de6c6067a72539cad30c41db61 (patch) | |
tree | 6452d611fd2336643ecfaca29c6475acb13f3a62 | |
parent | ba2321409bf750008ebb7b265cc2114209dae6a2 (diff) | |
download | abslibre-a08673fd3d3115de6c6067a72539cad30c41db61.tar.gz abslibre-a08673fd3d3115de6c6067a72539cad30c41db61.tar.bz2 abslibre-a08673fd3d3115de6c6067a72539cad30c41db61.zip |
linux-libre-aarch64: various fixes and reduce the diff with linux-libre
The chromebook package has also been disabled due to the following
error:
| ==> Starting package_linux-libre-aarch64-chromebook()...
| FATAL ERROR: Couldn't open "arch/arm/boot/zImage": No such file or directory
| mkimage: Can't read kernel.itb.tmp: Invalid argument
| ==> ERROR: A failure occurred in package_linux-libre-aarch64-chromebook().
| Aborting...
It could be fixed later on if there is some interest.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rw-r--r-- | kernels/linux-libre-aarch64/PKGBUILD | 49 |
1 files changed, 11 insertions, 38 deletions
diff --git a/kernels/linux-libre-aarch64/PKGBUILD b/kernels/linux-libre-aarch64/PKGBUILD index 45bf002ef..8d3093bc6 100644 --- a/kernels/linux-libre-aarch64/PKGBUILD +++ b/kernels/linux-libre-aarch64/PKGBUILD @@ -20,6 +20,7 @@ makedepends=( bc kmod libelf xmlto python-sphinx python-sphinx_rtd_theme graphviz imagemagick ) +makedepends_armv7h=(uboot-tools vboot-utils dtc) # required by linux-libre-chromebook makedepends+=('aarch64-linux-gnu-gcc-initial') options=('!strip') _srcname=linux-5.4 @@ -130,7 +131,7 @@ _replacesoldmodules=("${_replacesoldmodules[@]/\%/${pkgbase#linux-libre}}") case "$CARCH" in i686|x86_64) KARCH=x86;; - armv7h) KARCH=arm;; + armv7h) KARCH=arm64;; esac export KBUILD_BUILD_HOST=parabola @@ -184,7 +185,11 @@ prepare() { build() { cd $_srcname - make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- zImage modules htmldocs + if [ "$CARCH" = "armv7h" ]; then + make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image Image.gz modules htmldocs dtbs + else + make bzImage modules htmldocs + fi } _package() { @@ -202,17 +207,17 @@ _package() { msg2 "Installing boot image..." if [ "$CARCH" = "armv7h" ]; then - make INSTALL_DTBS_PATH="$pkgdir/boot/dtbs/$pkgbase" dtbs_install + make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- 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 "$(make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -s image_name)" "$modulesdir/vmlinuz" # 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 + make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- INSTALL_MOD_PATH="$pkgdir/usr" modules_install # remove build and source links rm "$modulesdir"/{source,build} @@ -291,7 +296,7 @@ _package-headers() { # # 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 + if [ "$KARCH" = "arm" ]; 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/" @@ -357,39 +362,7 @@ _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}") |