blob: 673b8105de2406aedb3db4041e3ada55ff04fdc3 [file] [log] [blame]
Patrick Williams520786c2023-06-25 16:20:36 -05001dm-verity and x86-64 and systemd - separate hash device
2-------------------------------------------------------
3
4Everything said in "dm-verity-systemd-x86-64.txt" applies here.
5However booting under QEMU is not tested - only on real hardware.
6So for your MACHINE you need to choose "genericx86-64".
7
8Also, you'll need to point at the hash specific WKS file:
9
10WKS_FILES += " systemd-bootdisk-dmverity-hash.wks.in"
11
12The fundamental difference is to use a separate device/partition for
13storage of the hash data -- instead of "hiding" it beyond the filesystem
14in what is essentially a 5-10% oversized partition. This takes any manual
15math calculations of size/offset out of the picture, and uses the kernel's
16natural behaviour of compartmentalizing devices to ensure they are separate.
17
18The example hash.wks file added here essentially adds a hash-only partition
19directly after the filesystem partition. So the filesystem partition is
20no longer "oversized" and no offsets are needed/used.
21
22Since we are now using multiple partitions, we make a better effort to use
23accepted GPT partition types and UUIDs based on the roothash. This means
24easier sysadmin level use/debugging based on cfdisk output etc.
25
26Generating the separate root hash image is driven off enabling this:
27 DM_VERITY_SEPARATE_HASH = "1"
28
29Two other variables control the GPT UUIDs - set to x86-64 defaults:
30
31 DM_VERITY_ROOT_GUID ?= "4f68bce3-e8cd-4db1-96e7-fbcaf984b709"
32 DM_VERITY_RHASH_GUID ?= "2c7357ed-ebd2-46d9-aec1-23d437ec2bf5"
33
34See: https://uapi-group.org/specifications/specs/discoverable_partitions_specification/
35
36Finally, the UUIDs (not the "partition types" above) are based off of
37the root node hash value as per the systemd "autodetect" proposed standard.
38These will obviously change with every update/rebuild of the root image.
39
40While not strictly coupled to any functionality at this point in time, it
41does aid in easier debugging, and puts us in alignment with using systemd
42inside the initramfs to replace manual veritysetup like configuration we
43currently do in the initramfs today, should we decide to do so later on.