Skip to content

Commit

Permalink
refactor: use a subfolder by default
Browse files Browse the repository at this point in the history
Signed-off-by: Mathias-Boulay <mathiasboulay@free.fr>
  • Loading branch information
Mathias-Boulay authored and BioTheWolff committed Apr 26, 2024
1 parent a6c14c7 commit 67bd32e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/fs-gen/src/image_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fn new_passthroughfs_layer(rootdir: &str) -> Result<BoxedLayer> {

/// Ensure a destination folder is created
fn ensure_folder_created(output_folder: &Path) -> Result<()> {
let result = fs::create_dir(output_folder);
let result = fs::create_dir_all(output_folder);

// If the file already exists, we're fine
if result.is_err() {
Expand Down
6 changes: 3 additions & 3 deletions src/fs-gen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ fn main() {
println!("Hello, world!, {:?}", args);

let layers_subdir = args.temp_directory.clone().join("layers/");
let output_subdir = args.temp_directory.clone().join("output/");
let overlay_subdir = args.temp_directory.clone().join("overlay/");

// TODO: better organise layers and OverlayFS build in the temp directory
Expand All @@ -28,10 +29,9 @@ fn main() {
}

// FIXME: use a subdir of the temp directory instead
let path = Path::new(overlay_subdir.as_path());
let path = Path::new(output_subdir.as_path());

merge_layer(&layers_paths, path, &args.temp_directory.clone())
.expect("Merging layers failed");
merge_layer(&layers_paths, path, &overlay_subdir).expect("Merging layers failed");
create_init_file(path);
generate_initramfs(path, Path::new(args.output_file.as_path()));
}
Expand Down

0 comments on commit 67bd32e

Please sign in to comment.