summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kernels/linux-libre-aarch64/PKGBUILD49
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}")