From 2bab6a438ff88032de9fea6ad756196d4943e967 Mon Sep 17 00:00:00 2001 From: Bruce Leidl Date: Sat, 5 Jan 2019 20:15:37 -0500 Subject: [PATCH] When generating initial hashtree, use $PATH to find veritysetup The initial hashtree is generated during the yocto build, so we want to use veritysetup from the path (to use cryptsetup-native) rather than try to find veritysetup on the build host. --- libcitadel/src/verity.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libcitadel/src/verity.rs b/libcitadel/src/verity.rs index bf9e611..d9c6aaf 100644 --- a/libcitadel/src/verity.rs +++ b/libcitadel/src/verity.rs @@ -12,11 +12,13 @@ const LOSETUP: &str = "/sbin/losetup"; /// Parse output from veritysetup command and return as `VerityOutput`. pub fn generate_initial_hashtree, Q:AsRef>(source: P, hashtree: Q) -> Result { let args = format!("format {} {}", source.as_ref().display(), hashtree.as_ref().display()); - let output = util::exec_cmdline_with_output(VERITYSETUP, args) + // Don't use absolute path to veritysetup so that the build will correctly find the version from cryptsetup-native + let output = util::exec_cmdline_with_output("veritysetup", args) .context("creating initial hashtree with veritysetup format failed")?; Ok(VerityOutput::parse(&output)) } + pub fn generate_image_hashtree>(image: P, metainfo: &MetaInfo) -> Result { let args = format!("--hash-offset={} --data-blocks={} --salt={} format {} {}", metainfo.nblocks() * 4096, metainfo.nblocks(), metainfo.verity_salt(),