Andrew Scull | 2304204 | 2018-08-22 17:44:56 +0100 | [diff] [blame] | 1 | # Hafnium RAM disk |
| 2 | |
| 3 | Hafnium expects to find the following files in the root directory of its RAM |
| 4 | disk: |
| 5 | |
David Brazdil | a2358d4 | 2020-01-27 18:51:38 +0000 | [diff] [blame] | 6 | * `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 Scull | 2304204 | 2018-08-22 17:44:56 +0100 | [diff] [blame] | 9 | |
Dmitrii Martynov | 89190c9 | 2023-02-23 20:20:10 +0300 | [diff] [blame] | 10 | The `manifest.dtb` must be the first file in the RAM disk, to ensure that it is |
| 11 | properly aligned. Hafnium will not be able to read it if it is not aligned to a |
| 12 | 4 byte boundary. |
| 13 | |
Andrew Scull | 2304204 | 2018-08-22 17:44:56 +0100 | [diff] [blame] | 14 | Follow the [preparing Linux](PreparingLinux.md) instructions to produce |
| 15 | `vmlinuz` and `initrd.img` for a basic Linux primary VM. |
| 16 | |
Andrew Scull | 2304204 | 2018-08-22 17:44:56 +0100 | [diff] [blame] | 17 | ## Create a RAM disk for Hafnium |
| 18 | |
| 19 | Assuming that a subdirectory called `initrd` contains the files listed in the |
| 20 | previous section, we can build `initrd.img` with the following command: |
| 21 | |
| 22 | ```shell |
Dmitrii Martynov | 71b5010 | 2023-02-23 13:19:05 +0300 | [diff] [blame] | 23 | cd initrd; echo -e "./manifest.dtb\n$(find . -type f -not -name manifest.dtb)" | cpio -o -v > ../initrd.img; cd - |
Andrew Scull | 2304204 | 2018-08-22 17:44:56 +0100 | [diff] [blame] | 24 | ``` |