pub async fn patch_with_sandbox_scripts(
scripts_dir: &Path,
scripts: &HashMap<String, String>,
shell_path: impl AsRef<Path>,
) -> MicrosandboxResult<()>Expand description
Updates a rootfs by adding sandbox script files to a /.sandbox_scripts directory.
This function:
- Creates a
.sandbox_scriptsdirectory under the rootfs if it doesn’t exist - For each script in the provided HashMap, creates a file with the given name
- Adds a shebang line using the provided shell path
- Makes the script files executable (rwxr-x—)
- Creates a
shellscript containing just the shell path
§Arguments
root_path- Path to the root of the filesystem to patchscripts- HashMap containing script names and their contentsshell_path- Path to the shell binary within the rootfs (e.g. “/bin/sh”)