Move manifest to initrd
Supporting the manifest as part of FDT is problematic for testing
under the Android boot flow because it requires compiling and flashing
a different Hafnium image per test suite. Moving it back to the initrd
allows us to run different test suites against the same Hafnium image,
only by swapping the RAM disks.
Hafnium's one_time_init() routine will now expect to find the manifest
under "manifest.dtb".
Change-Id: Ifabffb50b06ffaba786046733d575adc9d43f4ad
diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md
index bc090c7..e997ecb 100644
--- a/docs/GettingStarted.md
+++ b/docs/GettingStarted.md
@@ -50,16 +50,14 @@
```
Though it is admittedly not very useful because it doesn't have any virtual
-machines to run. Follow the [Hafnium RAM disk](HafniumRamDisk.md) instructions
-to create an initial RAM disk for Hafnium with Linux as the primary VM.
+machines to run.
Next, you need to create a manifest which will describe the VM to Hafnium.
-Follow the [Manifest](Manifest.md) instructions and build a DTBO with:
+Follow the [Manifest](Manifest.md) instructions and build a DTB with:
```
/dts-v1/;
-/plugin/;
-&{/} {
+/ {
hypervisor {
compatible = "hafnium,hafnium";
vm1 {
@@ -71,17 +69,14 @@
};
```
-Dump the DTB used by QEMU:
-```shell
-qemu-system-aarch64 -M virt,gic_version=3 -cpu cortex-a57 -nographic -machine virtualization=true -kernel out/reference/qemu_aarch64_clang/hafnium.bin -initrd initrd.img -append "rdinit=/sbin/init" -machine dumpdtb=qemu.dtb
-```
-and follow instructions in [Manifest](Manifest.md) to overlay it with the manifest.
+Follow the [Hafnium RAM disk](HafniumRamDisk.md) instructions
+to create an initial RAM disk for Hafnium with Linux as the primary VM.
The following command line will run Hafnium, with the RAM disk just created,
which will then boot into the primary Linux VM:
```shell
-qemu-system-aarch64 -M virt,gic_version=3 -cpu cortex-a57 -nographic -machine virtualization=true -kernel out/reference/qemu_aarch64_clang/hafnium.bin -initrd initrd.img -append "rdinit=/sbin/init" -dtb qemu_with_manifest.dtb
+qemu-system-aarch64 -M virt,gic_version=3 -cpu cortex-a57 -nographic -machine virtualization=true -kernel out/reference/qemu_aarch64_clang/hafnium.bin -initrd initrd.img -append "rdinit=/sbin/init"
```
## Running tests
diff --git a/docs/HafniumRamDisk.md b/docs/HafniumRamDisk.md
index c09568d..6bd9c4f 100644
--- a/docs/HafniumRamDisk.md
+++ b/docs/HafniumRamDisk.md
@@ -3,9 +3,9 @@
Hafnium expects to find the following files in the root directory of its RAM
disk:
-* `vmlinuz` -- the kernel of the primary VM.
-* `initrd.img` -- the initial ramdisk of the primary VM.
-* kernels for the secondary VMs, whose names are described in the manifest.
+* `manifest.dtb` -- configuration file in DeviceTree format (required)
+* kernels for the VMs, whose names are described in the manifest (optional)
+* initrd of the primary VM, whose name is described in the manifest (optional)
Follow the [preparing Linux](PreparingLinux.md) instructions to produce
`vmlinuz` and `initrd.img` for a basic Linux primary VM.
diff --git a/docs/Manifest.md b/docs/Manifest.md
index 8552fb1..0d9d16e 100644
--- a/docs/Manifest.md
+++ b/docs/Manifest.md
@@ -8,9 +8,8 @@
```
/dts-v1/;
-/plugin/;
-&{/} {
+/ {
hypervisor {
compatible = "hafnium,hafnium";
@@ -31,10 +30,6 @@
};
```
-Note: `&{/}` is a syntactic sugar expanded by the DTC compiler. Make sure to
-use the DTC in `prebuilts/` as the version packaged with your OS may not support
-it yet.
-
## Example
The following manifest defines a primary VM with two secondary VMs. The first
@@ -47,9 +42,8 @@
```
/dts-v1/;
-/plugin/;
-&{/} {
+/ {
hypervisor {
compatible = "hafnium,hafnium";
@@ -84,15 +78,10 @@
## Compiling
-Hafnium expects the manifest as part of the board FDT, i.e. DeviceTree in binary
-format (DTB).
+Hafnium expects the manifest inside its [RAM disk](HafniumRamDisk.md),
+in DeviceTree's binary format (DTB).
-First, compile the manifest into a DTBO (binary overlay):
+Compile the manifest's source file into a DTB with:
```shell
-prebuilts/linux-x64/dtc/dtc -I dts -O dtb --out-version 17 -o manifest.dtbo <manifest_source_file>
-```
-
-Then overlay it with the DTB of your board:
-```shell
-prebuilts/linux-x64/dtc/fdtoverlay -i <board DTB> -o <output DTB> manifest.dtbo
+prebuilts/linux-x64/dtc/dtc -I dts -O dtb --out-version 17 -o manifest.dtb <manifest_source_file>
```