Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
image-builder: re-implement image builder script
Re-implement image builder script to generate an image with a double MBR + a DAX metadata. The DAX metadata is read by the NVDIMM driver to know the beginning of the data in the pmem device. This new image format is required to enable DAX in the kernels and hypervisors that support NVDIMM, without breaking the compatibility with the kernels and hypervisors that don't support it. Following diagram shows how the resulting image will look like ``` .-----------.----------.---------------.-----------. | 0 - 512 B | 4 - 8 Kb | 2M - 2M+512B | 3M | |-----------+----------+---------------+-----------+ | MBR kata-containers#1 | DAX | MBR kata-containers#2 | Rootfs | '-----------'----------'---------------'-----------+ | | ^ | ^ | '-data-' '--------' | | '--------rootfs-partition---------' ``` MBR: Master boot record. DAX: Metadata required by the NVDIMM driver to enable DAX in the guest [1][2] (struct nd_pfn_sb). Rootfs: partition that contains the root filesystem (/usr, /bin, etc). Kernels and hypervisors that support DAX/NVDIMM read the MBR kata-containers#2, otherwise MBR kata-containers#1 is read. [1] - https://github.com/kata-containers/osbuilder/blob/master/image-builder/\ nsdax.gpl.c [2] - https://github.com/torvalds/linux/blob/master/drivers/nvdimm/pfn.h fixes kata-containers#263 Signed-off-by: Julio Montes <[email protected]>
- Loading branch information