vendor boot: support dts/dtb compiling in 'pack'

pull/94/head
cfig 3 years ago
parent 56b75a2610
commit 394bfc5f94
No known key found for this signature in database
GPG Key ID: B104C307F0FDABB7

@ -172,6 +172,35 @@ Please note that to use 'gradle flash', your host machine must be connectted to
</details>
<details>
<summary>edit device-tree blob(dtb) inside vendor_boot.img</summary>
If you want to edit the device-tree blob in place:
```bash
cp <your_vendor_boot_image> vendor_boot.img
cp <your_vbmeta_image> vbmeta.img
./gradlew unpack
==> now you can edit build/unzip_boot/dtb.src directly
./gradlew pack
```
During unpack stage, dtb will be dumped to file `build/unzip_boot/dtb`, dts will be decompiled to `build/unzip_boot/dtb.src`.
You can edit `dtb.src` directly, and it will be compiled to dtb duing repack stage.
If you just want to replace the dtb with the one that is compiled outside this tool, please
```bash
cp <your_vendor_boot_image> vendor_boot.img
cp <your_vbmeta_image> vbmeta.img
./gradlew unpack
rm build/unzip_boot/dtb.src
cp <your_dtb> build/unzip_boot/dtb
./gradlew pack
```
</details>
<details>
<summary>working with system.img</summary>

@ -23,6 +23,7 @@ import cfig.bootimg.Signer
import cfig.helper.Helper
import cfig.helper.Dumpling
import cfig.packable.VBMetaParser
import cfig.utils.DTC
import com.fasterxml.jackson.databind.ObjectMapper
import de.vandermeer.asciitable.AsciiTable
import org.apache.commons.exec.CommandLine
@ -264,6 +265,10 @@ data class VendorBoot(
this.ramdisk.size = this.ramdisk_table.ramdidks.sumOf { File(it.file).length() }.toInt()
}
}
//update dtb
if (File(this.dtb.file + ".src").exists()) {
check(DTC().compile(this.dtb.file + ".src", this.dtb.file)) { "fail to compile dts" }
}
this.dtb.size = File(this.dtb.file).length().toInt()
//header
FileOutputStream(this.info.output + ".clear", false).use { fos ->

@ -1 +1 @@
Subproject commit 9204d80a97535f5284f96f7f145edeae7d02cec4
Subproject commit 03c9b422e4cc418e2484b7bfeef97d8f3e920db9
Loading…
Cancel
Save