Skip to content

Commit 1dcc313

Browse files
authored
Image Customizer: Fix verity docs. (#10852)
1 parent 9255c23 commit 1dcc313

2 files changed

Lines changed: 75 additions & 47 deletions

File tree

toolkit/tools/imagecustomizer/docs/configuration.md

Lines changed: 68 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ The Azure Linux Image Customizer is configured using a YAML (or JSON) file.
5050
13. If ([overlays](#overlay-type)) are specified, then add the overlay driver
5151
and update the fstab file with the overlay mount information.
5252

53-
14. If ([verity](#verity-type)) is specified, then add the dm-verity dracut driver
54-
and update the grub config.
53+
14. If a ([verity](#verity-type)) device is specified, then add the dm-verity dracut
54+
driver and update the grub config.
5555

5656
15. Regenerate the initramfs file (if needed).
5757

@@ -66,8 +66,8 @@ The Azure Linux Image Customizer is configured using a YAML (or JSON) file.
6666
20. If [--shrink-filesystems](./cli.md#shrink-filesystems) is specified, then shrink
6767
the file systems.
6868

69-
21. If ([verity](#verity-type)) is specified, then create the hash tree and update the
70-
grub config.
69+
21. If a ([verity](#verity-type)) device is specified, then create the hash tree and
70+
update the grub config.
7171

7272
22. If the output format is set to `iso`, copy additional iso media files.
7373
([iso](#iso-type))
@@ -125,6 +125,13 @@ os:
125125
- [end](#end-uint64)
126126
- [size](#size-uint64)
127127
- [type](#partition-type-string)
128+
- [verity](#verity-verity)
129+
- [verity type](#verity-type)
130+
- [id](#verity-id)
131+
- [name](#verity-name)
132+
- [dataDeviceId](#datadeviceid-string)
133+
- [hashDeviceId](#hashdeviceid-string)
134+
- [corruptionOption](#corruptionoption-string)
128135
- [filesystems](#filesystems-filesystem)
129136
- [filesystem type](#filesystem-type)
130137
- [deviceId](#deviceid-string)
@@ -198,8 +205,8 @@ os:
198205
- [name](#module-name)
199206
- [loadMode](#loadmode-string)
200207
- [options](#options-mapstring-string)
201-
- [overlay type](#overlay-type)
202-
- [verity type](#verity-type)
208+
- [overlays](#overlays-overlay)
209+
- [overlay type](#overlay-type)
203210
- [scripts type](#scripts-type)
204211
- [postCustomization](#postcustomization-script)
205212
- [script type](#script-type)
@@ -483,45 +490,58 @@ Example: `noatime,nodiratime`
483490

484491
## verity type
485492

486-
Specifies the configuration for dm-verity root integrity verification.
493+
Specifies the configuration for dm-verity integrity verification.
487494

488-
- `dataPartition`: A partition configured with dm-verity, which verifies integrity
489-
at each system boot.
495+
Note: Currently only root partition (`/`) is supported. Support for other partitions
496+
(e.g. `/usr`) may be added in the future.
490497

491-
- `idType`: Specifies the type of id for the partition. The options are
492-
`id` (partition [id](#id-string)), `part-label` (partition label),
493-
`uuid` (filesystem UUID), and `part-uuid` (partition UUID).
498+
There are multiple ways to configure a verity enabled image. For
499+
recommendations, see [Verity Image Recommendations](./verity.md).
494500

495-
- `id`: The unique identifier value of the partition, corresponding to the
496-
specified IdType.
501+
<div id="verity-id"></div>
497502

498-
- `hashPartition`: A partition used exclusively for storing a calculated hash
499-
tree.
503+
### id [string]
500504

501-
- `corruptionOption`: Optional. Specifies the behavior in case of detected
502-
corruption. This is configurable with the following options:
503-
- `io-error`: Default setting. Fails the I/O operation with an I/O error.
504-
- `ignore`: ignores the corruption and continues operation.
505-
- `panic`: causes the system to panic (print errors) and then try restarting
506-
if corruption is detected.
507-
- `restart`: attempts to restart the system upon detecting corruption.
505+
Required.
508506

509-
Example:
507+
The ID of the verity object.
508+
This is used to correlate verity objects with [filesystem](#filesystem-type)
509+
objects.
510510

511-
```yaml
512-
os:
513-
verity:
514-
dataPartition:
515-
idType: part-uuid
516-
id: 00000000-0000-0000-0000-000000000000
517-
hashPartition:
518-
idType: part-label
519-
Id: hash_partition
520-
corruptionOption: panic
521-
```
511+
<div id="verity-name"></div>
522512

523-
There are multiple ways to configure a verity enabled image. For
524-
recommendations, see [Verity Image Recommendations](./verity.md).
513+
### name [string]
514+
515+
Required.
516+
517+
The name of the device mapper block device.
518+
519+
The value must be:
520+
521+
- `root` for root partition (i.e. `/`)
522+
523+
### dataDeviceId [string]
524+
525+
The ID of the [partition](#partition-type) to use as the verity data partition.
526+
527+
### hashDeviceId [string]
528+
529+
The ID of the [partition](#partition-type) to use as the verity hash partition.
530+
531+
### corruptionOption [string]
532+
533+
Optional.
534+
535+
Specifies how a mismatch between the hash and the data partition is handled.
536+
537+
Supported values:
538+
539+
- `io-error`: Fails the I/O operation with an I/O error.
540+
- `ignore`: Ignores the corruption and continues operation.
541+
- `panic`: Causes the system to panic (print errors) and then try restarting.
542+
- `restart`: Attempts to restart the system.
543+
544+
Default value: `io-error`.
525545

526546
## additionalFile type
527547

@@ -654,8 +674,7 @@ Specifies the mount options for a partition.
654674

655675
Required.
656676

657-
The ID of the partition.
658-
This is used correlate [partition](#partition-type) objects with filesystem objects.
677+
The ID of the [partition](#partition-type) or [verity](#verity-type) object.
659678

660679
### type [string]
661680

@@ -885,6 +904,8 @@ os:
885904

886905
## partition type
887906

907+
<div id="partition-id"></div>
908+
888909
### id [string]
889910

890911
Required.
@@ -1350,6 +1371,10 @@ os:
13501371
- name: vfio
13511372
```
13521373

1374+
### overlays [[overlay](#overlay-type)[]]
1375+
1376+
Used to add filesystem overlays.
1377+
13531378
### selinux [[selinux](#selinux-type)]
13541379

13551380
Options for configuring SELinux.
@@ -1591,6 +1616,10 @@ Supported options:
15911616

15921617
Contains the options for provisioning disks and their partitions.
15931618

1619+
### verity [[verity](#verity-type)[]]
1620+
1621+
Configure verity block devices.
1622+
15941623
### filesystems [[filesystem](#filesystem-type)[]]
15951624

15961625
Specifies the mount options of the partitions.

toolkit/tools/imagecustomizer/docs/verity.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,18 @@ storage:
145145
end: 3200M
146146
- id: var
147147
start: 3200M
148+
verity:
149+
- id: verityroot
150+
name: root
151+
dataDeviceId: root
152+
hashDeviceId: roothash
153+
corruptionOption: panic
148154
filesystems:
149155
- deviceId: boot
150156
type: ext4
151157
mountPoint:
152158
path: /boot
153-
- deviceId: root
159+
- deviceId: verityroot
154160
type: ext4
155161
mountPoint:
156162
path: /
@@ -159,13 +165,6 @@ storage:
159165
mountPoint:
160166
path: /var
161167
os:
162-
verity:
163-
dataPartition:
164-
idType: id
165-
id: root
166-
hashPartition:
167-
idType: id
168-
id: roothash
169168
additionalFiles:
170169
# Change the directory that the sshd-keygen service writes the SSH host keys to.
171170
- content: |

0 commit comments

Comments
 (0)