Skip to content

Commit b1e724d

Browse files
committed
context: retry looking for firmware in parent
In addition of searching for the firmware in "../../share", look for it in "../share" too. This simplifies packaging krunkit for podman. Signed-off-by: Sergio Lopez <slp@redhat.com>
1 parent f0e8bcc commit b1e724d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/context.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ fn get_firmware_path() -> Option<PathBuf> {
6161
if fw_path.exists() {
6262
return Some(fw_path);
6363
}
64+
// Try again on the parent.
65+
let base_dir = exec_path.parent()?;
66+
let fw_path = base_dir.join("share/krunkit/KRUN_EFI.silent.fd");
67+
if fw_path.exists() {
68+
return Some(fw_path);
69+
}
6470
// This is useful for testing directly from a cloned repo.
6571
let base_dir = base_dir.parent()?;
6672
let fw_path = base_dir.join("edk2/KRUN_EFI.silent.fd");

0 commit comments

Comments
 (0)