Turned out that dev nodes for SCSI devices may not be
determenistic, where the hash device and rootfs may end
up appearing under /dev/sda and /dev/sdb respectively.
Instead of mounting a separate hash device, append the
verity Merkle tree to rootfs ext4 filesystem, similarly
to how it's done for layer VHDs and mount single VHD.
Remove redundant hash device code.
The default GuestStateFile filename was changed to kernel.vmgs.
Update the IVGM kernel init to reflect the changes.
The support for booting non-SNP UVMs with dm-verity has also been added
as part of this PR. A new annotation can be used to pass the dm-mod.create
parameters to kernel. The assumption that the rootfs VHD will also have Merkle
tree appended after ext4 filesystem still holds. The new annotation is
"io.microsoft.virtualmachine.lcow.dmverity-create-args" and must be used
in conjunction with an existing "io.microsoft.virtualmachine.lcow.dmverity-mode"
annotation.
Add an internal "io.microsoft.virtualmachine.console.pipe" annotation, which
can be used to set the serial for the UVM for debugging purposes.
Note that dm-verity boot has a dependency on CONFIG_DM_INIT kernel config.
Turned out that dev nodes for SCSI devices may not be determenistic, where the hash device and rootfs may end up appearing under /dev/sda and /dev/sdb respectively.
Instead of mounting a separate hash device, append the verity Merkle tree to rootfs ext4 filesystem, similarly to how it's done for layer VHDs and mount single VHD. Remove redundant hash device code.
The default
GuestStateFile
filename was changed tokernel.vmgs
.Update the IVGM kernel init to reflect the changes.
The kernel command looks something like this:
To break this down a little further:
With the example above we get:
The support for booting non-SNP UVMs with dm-verity has also been added as part of this PR. A new annotation can be used to pass the
dm-mod.create
parameters to kernel. The assumption that the rootfs VHD will also have Merkle tree appended after ext4 filesystem still holds. The new annotation is "io.microsoft.virtualmachine.lcow.dmverity-create-args" and must be used in conjunction with an existing "io.microsoft.virtualmachine.lcow.dmverity-mode" annotation.Add an internal "io.microsoft.virtualmachine.console.pipe" annotation, which can be used to set the serial for the UVM for debugging purposes.
Note that dm-verity boot has a dependency on
CONFIG_DM_INIT
kernel config.Signed-off-by: Maksim An maksiman@microsoft.com