Skip to content

dmverity: use dedicated command-line argument for the root device#30

Open
michaelolbrich wants to merge 1 commit intopengutronix:mainfrom
michaelolbrich:dmverity-root-param
Open

dmverity: use dedicated command-line argument for the root device#30
michaelolbrich wants to merge 1 commit intopengutronix:mainfrom
michaelolbrich:dmverity-root-param

Conversation

@michaelolbrich
Copy link
Member

Using root= is problematic. If for some reason the verity-params or the entire initramfs are lost during build, then rsinit or the kernel will happily mount the rootfs without dm-verity.

Instead, use rsinit.verity_root= as command-line option to specify the root device. The case above will now trigger a kernel panic because no rootfs is found.

This makes it less likely to accidentally mount the rootfs without dm-verity.

If the old behaviour is desired, then a custom init can copy CmdlineOptions.root to CmdlineOptions.verity_root after the command-line is parsed but before the rootfs is mounted.

Using root= is problematic. If for some reason the verity-params or the
entire initramfs are lost during build, then rsinit or the kernel will
happily mount the rootfs without dm-verity.

Instead, use rsinit.verity_root= as command-line option to specify the
root device. The case above will now trigger a kernel panic because no
rootfs is found.

This makes it less likely to accidentally mount the rootfs without
dm-verity.

If the old behaviour is desired, then a custom init can copy
CmdlineOptions.root to CmdlineOptions.verity_root after the command-line
is parsed but before the rootfs is mounted.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
@michaelolbrich michaelolbrich requested a review from KarlK90 March 10, 2026 08:59
Copy link
Member

@KarlK90 KarlK90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! But could you add some more documentation how this option is supposed to be used? ATM integrators have to read the source to figure that out.

Copy link
Member

@gumulka gumulka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested-by: Fabian Pflug f.pflug@pengutronix.de

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants