Skip to content
Merged
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
3 changes: 2 additions & 1 deletion .cci.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ parallel build: {
""")
}
shwrap("""
make install install-grub-static install-systemd-unit DESTDIR=\$(pwd)/insttree/
make install-all DESTDIR=\$(pwd)/insttree/
tar -c -C insttree/ -zvf insttree.tar.gz .
""")
stash includes: 'insttree.tar.gz', name: 'build'
Expand Down Expand Up @@ -55,6 +55,7 @@ cosaPod(runAsUser: 0, memory: "4608Mi", cpu: "4") {
rmdir insttree
cosa fetch
cosa build
cosa osbuild metal4k
""")
}
// The e2e-adopt test will use the ostree commit we just generated above
Expand Down
22 changes: 15 additions & 7 deletions src/efi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,14 +345,22 @@ impl Component for Efi {
let srcdir_name = component_updatedirname(self);
let ft = crate::filetree::FileTree::new_from_dir(&src_root.sub_dir(&srcdir_name)?)?;

// Using `blockdev` to find the partition instead of partlabel because
// we know the target install toplevel device already.
let esp_device = blockdev::get_esp_partition(device)?
.ok_or_else(|| anyhow::anyhow!("Failed to find ESP device"))?;

let destpath = &self.ensure_mounted_esp(Path::new(dest_root), Path::new(&esp_device))?;
// Let's attempt to use an already mounted ESP at the target
// dest_root if one is already mounted there in a known ESP location.
let destpath = if let Some(destdir) = self.get_mounted_esp(Path::new(dest_root))? {
destdir
} else {
// Using `blockdev` to find the partition instead of partlabel because
// we know the target install toplevel device already.
if device.is_empty() {
anyhow::bail!("Device value not provided");
}
let esp_device = blockdev::get_esp_partition(device)?
.ok_or_else(|| anyhow::anyhow!("Failed to find ESP device"))?;
self.mount_esp_device(Path::new(dest_root), Path::new(&esp_device))?
};

let destd = &openat::Dir::open(destpath)
let destd = &openat::Dir::open(&destpath)
.with_context(|| format!("opening dest dir {}", destpath.display()))?;
validate_esp_fstype(destd)?;

Expand Down