blob: fecdc803e332fad05da33992271f30982c0f3114 [file] [log] [blame] [view]
Andrew Scull23042042018-08-22 17:44:56 +01001# Hafnium RAM disk
2
3Hafnium expects to find the following files in the root directory of its RAM
4disk:
5
David Brazdila2358d42020-01-27 18:51:38 +00006* `manifest.dtb` -- configuration file in DeviceTree format (required)
7* kernels for the VMs, whose names are described in the manifest (optional)
8* initrd of the primary VM, whose name is described in the manifest (optional)
Andrew Scull23042042018-08-22 17:44:56 +01009
Dmitrii Martynov89190c92023-02-23 20:20:10 +030010The `manifest.dtb` must be the first file in the RAM disk, to ensure that it is
11properly aligned. Hafnium will not be able to read it if it is not aligned to a
124 byte boundary.
13
Andrew Scull23042042018-08-22 17:44:56 +010014Follow the [preparing Linux](PreparingLinux.md) instructions to produce
15`vmlinuz` and `initrd.img` for a basic Linux primary VM.
16
Andrew Scull23042042018-08-22 17:44:56 +010017## Create a RAM disk for Hafnium
18
19Assuming that a subdirectory called `initrd` contains the files listed in the
20previous section, we can build `initrd.img` with the following command:
21
22```shell
Dmitrii Martynov71b50102023-02-23 13:19:05 +030023cd initrd; echo -e "./manifest.dtb\n$(find . -type f -not -name manifest.dtb)" | cpio -o -v > ../initrd.img; cd -
Andrew Scull23042042018-08-22 17:44:56 +010024```