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

Function validate_sandbox_rootfs

crates/openshell-driver-vm/src/rootfs.rs:394–415  ·  view source on GitHub ↗
(rootfs: &Path)

Source from the content-addressed store, hash-verified

392}
393
394pub fn validate_sandbox_rootfs(rootfs: &Path) -> Result<(), String> {
395 require_rootfs_path(rootfs, SANDBOX_GUEST_INIT_PATH)?;
396 require_rootfs_path(rootfs, SANDBOX_SUPERVISOR_PATH)?;
397 require_rootfs_path(rootfs, SANDBOX_UMOCI_PATH)?;
398 require_any_rootfs_path(rootfs, &["/bin/bash"])?;
399 require_any_rootfs_path(rootfs, &["/bin/mount", "/usr/bin/mount"])?;
400 require_any_rootfs_path(
401 rootfs,
402 &[
403 "/usr/sbin/chroot",
404 "/usr/bin/chroot",
405 "/sbin/chroot",
406 "/bin/chroot",
407 ],
408 )?;
409 require_any_rootfs_path(
410 rootfs,
411 &["/sbin/ip", "/usr/sbin/ip", "/bin/ip", "/usr/bin/ip"],
412 )?;
413 require_any_rootfs_path(rootfs, &["/bin/sed", "/usr/bin/sed"])?;
414 Ok(())
415}
416
417fn create_sandbox_mountpoint(path: &Path) -> Result<(), String> {
418 fs::create_dir_all(path).map_err(|e| format!("create {}: {e}", path.display()))?;

Calls 2

require_rootfs_pathFunction · 0.85
require_any_rootfs_pathFunction · 0.85