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 :)
This commit is contained in:
Minecrell 2020-02-29 17:17:04 +01:00 committed by Oliver Smith
parent 21b4e04c77
commit b0a664dc0e
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 6 additions and 12 deletions

View File

@ -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 <email> (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 + """