Specify initrd image contents as a list of files
The init RAM disk is just a container for various files, and
should be agnostic about their contents (e.g., primary manifest,
kernel, etc...).
Change the build so that a list of files is specified instead of
having the image creator handle different types differently.
This facilitates adding other types of files later, e.g., an FDT
for secondary VMs.
Change-Id: I5ca79dcc5c8810fce0c248201c24f00dd439e392
diff --git a/test/linux/BUILD.gn b/test/linux/BUILD.gn
index 282d6c0..8ef7381 100644
--- a/test/linux/BUILD.gn
+++ b/test/linux/BUILD.gn
@@ -37,28 +37,49 @@
# Always use the aarch64_linux_clang toolchain to build test_binary
test_binary_target = ":test_binary(//build/toolchain:aarch64_linux_clang)"
- sources = [
- get_label_info(test_binary_target, "root_out_dir") + "/test_binary",
- get_label_info("//driver/linux", "target_out_dir") + "/hafnium.ko",
+
+ files = [
+ [
+ get_label_info(test_binary_target, "root_out_dir") + "/test_binary",
+ test_binary_target,
+ ],
+ [
+ get_label_info("//driver/linux", "target_out_dir") + "/hafnium.ko",
+ "//driver/linux",
+ ],
]
- deps = [
- "//driver/linux",
- test_binary_target,
- ]
+}
+
+manifest("linux_test_manifest") {
+ source = "manifest.dts"
+ overlay = hftest_manifest_overlay
}
initrd("linux_test") {
testonly = true
- manifest = "manifest.dts"
- manifest_overlay = hftest_manifest_overlay
- primary_name = "vmlinuz"
- primary_vm = "//third_party/linux:linux__prebuilt"
- primary_initrd = ":linux_test_initrd"
- secondary_vms = [ [
- "socket0",
- ":socket_vm1",
- ] ]
+ files = [
+ [
+ "manifest.dtb",
+ ":linux_test_manifest",
+ "manifest.dtb",
+ ],
+ [
+ "vmlinuz",
+ "//third_party/linux:linux__prebuilt",
+ "linux__prebuilt.bin",
+ ],
+ [
+ "initrd.img",
+ ":linux_test_initrd",
+ "linux_test_initrd/initrd.img",
+ ],
+ [
+ "socket0",
+ ":socket_vm1",
+ "socket_vm1.bin",
+ ],
+ ]
}
group("linux") {