From b0a664dc0e3510c8681b175787c652222f35af43 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Sat, 29 Feb 2020 17:17:04 +0100 Subject: [PATCH] pmb.aportgen.linux: build qcdt in package() (!1880) Building the QCDT image in build() complicates use of envkernel.sh - in that case, make is done independently of the APKBUILD, and only the package() function is run to assemble the kernel package. Building it entirely in package() allows using envkernel.sh without having to set up some "post make script" (see https://wiki.postmarketos.org/wiki/Compiling_kernels_with_envkernel.sh#Post_make_scripts). package() might actually fit better in general, since QCDT is only a special "package" format for (multiple) DTB files at the end :) --- pmb/aportgen/linux.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/pmb/aportgen/linux.py b/pmb/aportgen/linux.py index dbe11ed0..a3e33c5f 100644 --- a/pmb/aportgen/linux.py +++ b/pmb/aportgen/linux.py @@ -15,22 +15,13 @@ def generate_apkbuild(args, pkgname, deviceinfo, patches): package = """ downstreamkernel_package "$builddir" "$pkgdir" "$_carch" "$_flavor\"""" - build = """ - unset LDFLAGS - make ARCH="$_carch" CC="${CC:-gcc}" \\ - KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS\"""" - if deviceinfo["bootimg_qcdt"] == "true": makedepends += " dtbtool" - build += """\n - # Generate master DTB (deviceinfo_bootimg_qcdt) - dtbTool -s 2048 -p "scripts/dtc/" -o "arch/""" + carch + "/boot/dt.img\" \"arch/" + carch + "/boot/\"" - package += """\n # Master DTB (deviceinfo_bootimg_qcdt) - install -Dm644 "$builddir/arch/""" + carch + """/boot/dt.img" \\ - "$pkgdir/boot/dt.img\"""" + dtbTool -p scripts/dtc/ -o "arch/$_carch/boot"/dt.img "arch/$_carch/boot/" + install -Dm644 "arch/$_carch/boot"/dt.img "$pkgdir"/boot/dt.img""" content = """\ # Contributor: Firstname Lastname (CHANGEME!) @@ -65,7 +56,10 @@ def generate_apkbuild(args, pkgname, deviceinfo, patches): downstreamkernel_prepare "$srcdir" "$builddir" "$_config" "$_carch" "$HOSTCC" } - build() {""" + build + """ + build() { + unset LDFLAGS + make ARCH="$_carch" CC="${CC:-gcc}" \\ + KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS" } package() {""" + package + """