main/postmarketos-mkinitfs: add option to place DTB in Android boot image second area (!700)

Mainline U-Boot looks for the device tree blob in the "second" area
of the Android boot image (see https://patchwork.ozlabs.org/patch/1025211/).

Add an option "deviceinfo_bootimg_dtb_second" to place the device DTB there.
This commit is contained in:
lambdadroid 2019-10-21 17:30:04 +02:00 committed by Oliver Smith
parent 93d7dc419f
commit 74815e3312
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
2 changed files with 22 additions and 2 deletions

View file

@ -1,5 +1,5 @@
pkgname=postmarketos-mkinitfs pkgname=postmarketos-mkinitfs
pkgver=0.7.18 pkgver=0.7.19
pkgrel=0 pkgrel=0
pkgdesc="Tool to generate initramfs images for postmarketOS" pkgdesc="Tool to generate initramfs images for postmarketOS"
url="https://postmarketos.org" url="https://postmarketos.org"
@ -26,4 +26,4 @@ package() {
sha512sums="8be7f29394f8cd4e1c4b93f018f6314350f7e37e20d242c97284c1b112a106f882318a101bc0c70b391590b969023901580c677ee9f869850e90e69171a44e80 init.sh.in sha512sums="8be7f29394f8cd4e1c4b93f018f6314350f7e37e20d242c97284c1b112a106f882318a101bc0c70b391590b969023901580c677ee9f869850e90e69171a44e80 init.sh.in
0a74a5be08ecc0e07ea4f4e361865327bf1e56006da0aa1bc2c5716ea2951dcdc9c9fcb9f5a6205aeedfff08e027b2bb44913c891378144d0fe264b53257f359 init_functions.sh 0a74a5be08ecc0e07ea4f4e361865327bf1e56006da0aa1bc2c5716ea2951dcdc9c9fcb9f5a6205aeedfff08e027b2bb44913c891378144d0fe264b53257f359 init_functions.sh
c9151771ffed846e88618e59e19f5bf6a9aa7d923de1194f3a9cd9d18fa3ed0d1e45622ecb81ef2d23295a25114dacf5cbdde5a23f8b4a376bf1f73cd8f3f0b3 mkinitfs.sh" 3f918f8b5967b73e507c2ddf36dccc24fee98298f05ca23e22605400de95137f8877e09769616e7db388557c645fb45c03e1e6b5bab815ec9f853c318f0431f1 mkinitfs.sh"

View file

@ -261,6 +261,25 @@ create_bootimg()
if [ "${deviceinfo_append_dtb}" == "true" ]; then if [ "${deviceinfo_append_dtb}" == "true" ]; then
kernelfile="${kernelfile}-dtb" kernelfile="${kernelfile}-dtb"
fi fi
_second=""
if [ "${deviceinfo_bootimg_dtb_second}" == "true" ]; then
if [ -z "${deviceinfo_dtb}" ]; then
echo "ERROR: deviceinfo_bootimg_dtb_second is set, but"
echo "'deviceinfo_dtb' is missing. Set 'deviceinfo_dtb'"
echo "to the device tree blob for your device."
echo "See also: <https://postmarketos.org/deviceinfo>"
exit 1
fi
dtb="/usr/share/dtb/${deviceinfo_dtb}.dtb"
_second="--second $dtb"
if ! [ -e "$dtb" ]; then
echo "ERROR: File not found: $dtb. Please set 'deviceinfo_dtb'"
echo "to the relative path to the device tree blob for your"
echo "device (without .dtb)."
echo "See also: <https://postmarketos.org/deviceinfo>"
exit 1
fi
fi
_dt="" _dt=""
if [ "${deviceinfo_bootimg_qcdt}" == "true" ]; then if [ "${deviceinfo_bootimg_qcdt}" == "true" ]; then
_dt="--dt /boot/dt.img" _dt="--dt /boot/dt.img"
@ -285,6 +304,7 @@ create_bootimg()
--ramdisk_offset "${deviceinfo_flash_offset_ramdisk}" \ --ramdisk_offset "${deviceinfo_flash_offset_ramdisk}" \
--tags_offset "${deviceinfo_flash_offset_tags}" \ --tags_offset "${deviceinfo_flash_offset_tags}" \
--pagesize "${deviceinfo_flash_pagesize}" \ --pagesize "${deviceinfo_flash_pagesize}" \
${_second} \
${_dt} \ ${_dt} \
-o "${outfile/initramfs-/boot.img-}" || exit 1 -o "${outfile/initramfs-/boot.img-}" || exit 1
if [ "${deviceinfo_bootimg_blobpack}" == "true" ]; then if [ "${deviceinfo_bootimg_blobpack}" == "true" ]; then