forked from Mirror/pmbootstrap
pmb/aportgen/linux.py: add different QCDT implementations (MR 1992)
Adds QCDT templates for Spreadtrum and Exynos SoCs When "pmbootstrap init" is executed, after the boot image analysis, if the device is QCDT, then the user is asked about the SoC vendor. Example: [HH:MM:SS] SoC vendor (spreadtrum/exynos/other) [other]: exynos After that, the corresponding template is picked.
This commit is contained in:
parent
5ff0bbe4b2
commit
6793612a7e
1 changed files with 31 additions and 10 deletions
|
@ -12,16 +12,40 @@ def generate_apkbuild(args, pkgname, deviceinfo, patches):
|
|||
|
||||
makedepends = "bash bc bison devicepkg-dev flex openssl-dev perl"
|
||||
|
||||
build = """
|
||||
unset LDFLAGS
|
||||
make O="$_outdir" ARCH="$_carch" CC="${{CC:-gcc}}" \\
|
||||
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS\""""
|
||||
|
||||
package = """
|
||||
downstreamkernel_package "$builddir" "$pkgdir" "$_carch" "$_flavor" "$_outdir\""""
|
||||
|
||||
if deviceinfo["bootimg_qcdt"] == "true":
|
||||
makedepends += " dtbtool"
|
||||
|
||||
package += """\n
|
||||
# Master DTB (deviceinfo_bootimg_qcdt)
|
||||
dtbTool -p scripts/dtc/ -o "$_outdir/arch/$_carch/boot"/dt.img "$_outdir/arch/$_carch/boot/"
|
||||
install -Dm644 "$_outdir/arch/$_carch/boot"/dt.img "$pkgdir"/boot/dt.img"""
|
||||
build += """\n
|
||||
# Master DTB (deviceinfo_bootimg_qcdt)"""
|
||||
vendors = ["spreadtrum", "exynos", "other"]
|
||||
soc_vendor = pmb.helpers.cli.ask(args, "SoC vendor", vendors,
|
||||
vendors[-1], complete=vendors)
|
||||
if soc_vendor == "spreadtrum":
|
||||
makedepends += " dtbtool-sprd"
|
||||
build += """
|
||||
dtbTool-sprd -p scripts/dtc/ \\
|
||||
-o "$_outdir/arch/$_carch/boot"/dt.img \\
|
||||
"$_outdir/arch/$_carch/boot/dts/\""""
|
||||
elif soc_vendor == "exynos":
|
||||
codename = "-".join(pkgname.split("-")[2:])
|
||||
makedepends += " dtbtool-exynos"
|
||||
build += f"""
|
||||
dtbTool-exynos -o "$_outdir/arch/$_carch/boot"/dt.img \\
|
||||
$(find "$_outdir/arch/$_carch/boot/dts/" -name *{codename}*.dtb)"""
|
||||
else:
|
||||
makedepends += " dtbtool"
|
||||
build += """
|
||||
dtbTool -p scripts/dtc/ -o "$_outdir/arch/$_carch/boot"/dt.img \\
|
||||
"$_outdir/arch/$_carch/boot/\""""
|
||||
package += """
|
||||
install -Dm644 "$_outdir/arch/$_carch/boot"/dt.img \\
|
||||
"$pkgdir"/boot/dt.img"""
|
||||
|
||||
patches = ("\n" + " " * 12).join(patches)
|
||||
content = f"""\
|
||||
|
@ -57,10 +81,7 @@ def generate_apkbuild(args, pkgname, deviceinfo, patches):
|
|||
. downstreamkernel_prepare
|
||||
}}
|
||||
|
||||
build() {{
|
||||
unset LDFLAGS
|
||||
make O="$_outdir" ARCH="$_carch" CC="${{CC:-gcc}}" \\
|
||||
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
|
||||
build() {{{build}
|
||||
}}
|
||||
|
||||
package() {{{package}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue