MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / create_rootfs_image_from_dir

Function create_rootfs_image_from_dir

crates/openshell-driver-vm/src/rootfs.rs:83–91  ·  view source on GitHub ↗
(source: &Path, image_path: &Path)

Source from the content-addressed store, hash-verified

81}
82
83pub fn create_rootfs_image_from_dir(source: &Path, image_path: &Path) -> Result<(), String> {
84 let image_size = rootfs_image_size_bytes(source)?;
85 create_ext4_image_from_dir_with_size(source, image_path, image_size)?;
86 if let Err(err) = normalize_sandbox_owner_in_rootfs_image(source, image_path) {
87 let _ = fs::remove_file(image_path);
88 return Err(err);
89 }
90 Ok(())
91}
92
93pub fn create_ext4_image_from_dir_with_size(
94 source: &Path,

Tested by

no test coverage detected