Add support to update the DTB when flashing a vendor_boot ramdisk
When updating the vendor_boot ramdisk, there may be device tree
dependencies that require updating the device tree with the new ramdisk
which contains the first stage init kernel modules. This patch adds the
support to use the `--dtb /path/to/dtb` option to update the DTB when
updating the vendor_boot ramdisk. To do so, run the command:
fastboot flash --dtb /path/to/dtb.img \
vendor_boot:<RAMDISK_NAME> /path/to/ramdisk
Test: fastboot_vendor_boot_img_utils_test
Test: Verifed updating the dtb with the above command on r4
Bug: 368308832
Change-Id: Iaa1867fe64054971a698497a2e3486424fed19fe
diff --git a/fastboot/testdata/Android.bp b/fastboot/testdata/Android.bp
index a490fe2..47bf095 100644
--- a/fastboot/testdata/Android.bp
+++ b/fastboot/testdata/Android.bp
@@ -40,6 +40,14 @@
cmd: "$(location fastboot_gen_rand) --seed dtb --length 1024 > $(out)",
}
+// Fake dtb image for replacement.
+genrule {
+ name: "fastboot_test_dtb_replace",
+ defaults: ["fastboot_test_data_gen_defaults"],
+ out: ["dtb_replace.img"],
+ cmd: "$(location fastboot_gen_rand) --seed dtb --length 2048 > $(out)",
+}
+
// Fake bootconfig image.
genrule {
name: "fastboot_test_bootconfig",