Skip to content

Commit

Permalink
Merge pull request #34 from OSInside/make_sure_mnt_mountpoint_exists
Browse files Browse the repository at this point in the history
Make sure /mnt mountpoint exists for firecracker
  • Loading branch information
schaefi authored Jan 19, 2024
2 parents 8f89ddb + af6883e commit d64ff0b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions flake-ctl/src/firecracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ pub async fn pull_component_image(
let dev_pts_in_image = format!(
"{}/{}", tmp_dir_path, "/dev/pts"
);
// required for overlay root allocation
let mnt_in_image = format!(
"{}/{}", tmp_dir_path, "/mnt"
);
if ! Path::new(&sci_in_image).exists() {
info!("Copying sci to rootfs...");
if ! copy(
Expand Down Expand Up @@ -219,6 +223,10 @@ pub async fn pull_component_image(
umount(&tmp_dir_path, "root");
return result
}
if ! Path::new(&mnt_in_image).exists() && ! mkdir(&mnt_in_image, "root") {
umount(&tmp_dir_path, "root");
return result
}
umount(&tmp_dir_path, "root");
}

Expand Down

0 comments on commit d64ff0b

Please sign in to comment.