bottlerocket-os / bottlerocket-os/twoliter
UKI dm-verity uses `PARTNROFF=1/2` — hardcodes BOOT-A / ROOT-A / HASH-A partition adjacency.
- Dominant language
- Rust
- Stars
- 34
- Forks
- 43
- Avg merge
- 11h 13m
- Merged PRs (30d)
- 16
Description
**[P2] UKI dm-verity uses `PARTNROFF=1/2` — hardcodes BOOT-A / ROOT-A / HASH-A partition adjacency.**
The `PARTUUID=${boot_partuuid}/PARTNROFF=1` (ROOT-A) and `.../PARTNROFF=2` (HASH-A) references on L530-531 rely on the current on-disk order (BIOS, EFI-A, BOOT-A, ROOT-A, HASH-A). This is fine today, but `sgdisk --sort` (rpm2img:205) reorders by start sector, so any future layout change that inserts a partition between BOOT-A and ROOT-A (or between ROOT-A and HASH-A) — e.g. a LUKS keyslot partition as this feature series grows — silently breaks the UKI verity table. The failure appears at boot as a dm-verity setup error.
**Robust fix:** resolve the real PARTUUIDs of ROOT-A and HASH-A via `get_partition_uuid` and pass them into `generate_verity_root` directly, replacing the offset arithmetic entirely.
_Originally posted by @jmt-lab in https://github.com/bottlerocket-os/twoliter/pull/701#discussion_r3762546124_
Contributor guide
Research direction
Read the UKI generation code around L530-L531 and the rpm2img flow around line 205, then trace get_partition_uuid and generate_verity_root. Done when the generated UKI verity table uses the actual ROOT-A and HASH-A PARTUUIDs rather than PARTNROFF offsets.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100