From 2ca435f37ed599567c030cfd9455847465bd6990 Mon Sep 17 00:00:00 2001 From: BioTheWolff <47079795+BioTheWolff@users.noreply.github.com> Date: Wed, 17 Apr 2024 19:56:32 +0200 Subject: [PATCH] refactor: use subdirs for layers and overlay Signed-off-by: BioTheWolff <47079795+BioTheWolff@users.noreply.github.com> --- src/fs-gen/src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/fs-gen/src/main.rs b/src/fs-gen/src/main.rs index b7201b6..6394ce5 100644 --- a/src/fs-gen/src/main.rs +++ b/src/fs-gen/src/main.rs @@ -12,8 +12,11 @@ fn main() { let args = cli_args::CliArgs::get_args(); println!("Hello, world!, {:?}", args); + let layers_subdir = args.temp_directory.clone().join("layers/"); + let overlay_subdir = args.temp_directory.clone().join("overlay/"); + // TODO: better organise layers and OverlayFS build in the temp directory - match image_loader::download_image_fs(&args.image_name, args.temp_directory.clone()) { + match image_loader::download_image_fs(&args.image_name, layers_subdir) { Err(e) => { eprintln!("Error: {}", e); return; @@ -25,7 +28,7 @@ fn main() { } // FIXME: use a subdir of the temp directory instead - let path = Path::new("/tmp/cloudlet"); + let path = Path::new(overlay_subdir.as_path()); merge_layer(&layers_paths, path); create_init_file(path);