Adding boot-test-harness.img
In commit I30137c3caef91805d9143d404e5e4d06c0fccc30, we added
a boot-debug.img to allow adb root when using an user build GSI image.
However, to run automated tests, it requires additional properties,
which are not needed for GSI compliance:
ro.audio.silent=1
ro.test_harness=1
This CL adds an additional boot-test-harness.img for automated tests,
and keeps the original boot-debug.img for GSI compliance.
Note: boot-test-harness.img won't be built by default, it needs
explicit `make bootimage_test_harness`.
Bug: 140036184
Test: `m bootimage_test_harness`, flashes boot-test-harness.img and checks
adb root works and test harness props are set.
Test: `m bootimage_test_harness dist -j32`, checks both
boot-test-harness.img and ramdisk-test-harness.img are under ./out/dist/.
Test: `system/tools/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-test-harness.img --out ramdisk-test-harness`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-test-harness.img and $OUT/boot-debug.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk-test-harness ./ramdisk-debug`
Test: `m ramdisk_test_harness-nodeps` and `m bootimage_test_harness-nodeps`
Change-Id: Iadea0b5c933c3b7fa10dcf3d9e85596916b3333d
diff --git a/core/main.mk b/core/main.mk
index fa203ca..e9d4390 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -1490,6 +1490,9 @@
.PHONY: ramdisk_debug
ramdisk_debug: $(INSTALLED_DEBUG_RAMDISK_TARGET)
+.PHONY: ramdisk_test_harness
+ramdisk_test_harness: $(INSTALLED_TEST_HARNESS_RAMDISK_TARGET)
+
.PHONY: userdataimage
userdataimage: $(INSTALLED_USERDATAIMAGE_TARGET)
@@ -1530,6 +1533,9 @@
.PHONY: bootimage_debug
bootimage_debug: $(INSTALLED_DEBUG_BOOTIMAGE_TARGET)
+.PHONY: bootimage_test_harness
+bootimage_test_harness: $(INSTALLED_TEST_HARNESS_BOOTIMAGE_TARGET)
+
.PHONY: vbmetaimage
vbmetaimage: $(INSTALLED_VBMETAIMAGE_TARGET)
@@ -1697,6 +1703,10 @@
$(INSTALLED_DEBUG_RAMDISK_TARGET) \
$(INSTALLED_DEBUG_BOOTIMAGE_TARGET) \
)
+ $(call dist-for-goals, bootimage_test_harness, \
+ $(INSTALLED_TEST_HARNESS_RAMDISK_TARGET) \
+ $(INSTALLED_TEST_HARNESS_BOOTIMAGE_TARGET) \
+ )
endif
ifeq ($(EMMA_INSTRUMENT),true)