Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dracut: Insert dm_verity kernel module for veritysetup #97

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions dracut/10verity-generator/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ install() {
inst_simple "$moddir/no-job-timeout.conf" \
"$systemdsystemunitdir/dev-mapper-usr.device.d/no-job-timeout.conf"
}

installkernel() {
# required by cryptsetup, it seems like it stopped being implicitly inserted
instmods -c dm_verity
}
3 changes: 3 additions & 0 deletions dracut/10verity-generator/verity-generator
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ if [[ -n "${usr}" && -n "${usrhash}" ]]; then
[Service]
Type=oneshot
RemainAfterExit=yes
# Explicitly load dm_verity module - for some reason it stopped being
# loaded earlier in the boot, and cryptsetup needs it.
ExecStart=/bin/modprobe dm_verity
# Try to query the filesystem size dynamically but otherwise fall back to the expected value from the image GPT layout
ExecStart=/bin/sh -c '/sbin/veritysetup --panic-on-corruption --hash-offset="\$(e2size ${usr} || echo 1065345024)" open "${usr}" usr "${usr}" "${usrhash}"'
# If there's a hash mismatch during table initialization,
Expand Down