lanzatool: sync for every sign operation

This commit is contained in:
Raito Bezarius 2022-11-25 23:57:56 +01:00
parent a3ec2cfc15
commit f6930955a3
3 changed files with 23 additions and 1 deletions

View File

@ -19,6 +19,12 @@ dependencies = [
"winapi",
]
[[package]]
name = "autocfg"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
name = "bitflags"
version = "1.3.2"
@ -125,6 +131,7 @@ dependencies = [
"anyhow",
"clap",
"goblin",
"nix",
"serde",
"serde_json",
"tempfile",
@ -145,6 +152,18 @@ dependencies = [
"cfg-if",
]
[[package]]
name = "nix"
version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e322c04a9e3440c327fca7b6c8a63e6890a32fa2ad689db972425f07e0d22abb"
dependencies = [
"autocfg",
"bitflags",
"cfg-if",
"libc",
]
[[package]]
name = "once_cell"
version = "1.16.0"

View File

@ -9,6 +9,7 @@ edition = "2021"
anyhow = "1.0.66"
clap = { version = "4.0.26", features = ["derive"] }
goblin = "0.6.0"
nix = { version = "0.25.0", default-features = false, features = [ "fs" ] }
serde = { version = "1.0.147", features = ["derive"] }
serde_json = "1.0.89"
tempfile = "3.3.0"

View File

@ -1,6 +1,7 @@
use std::fs;
use std::os::unix::prelude::PermissionsExt;
use std::path::{Path, PathBuf};
use nix::unistd::sync;
use anyhow::{Context, Result};
@ -81,10 +82,11 @@ pub fn install(
signer
.sign_file(&file)
.with_context(|| format!("Failed to sign file {}", &file.display()))?;
sync();
}
println!(
"Succesfully installed lanzaboote to '{}'",
"Successfully installed lanzaboote to '{}'",
esp_paths.esp.display()
);