pub fn sys_pkg_install(_name: &str) -> SyscallResult<()>Expand description
Install a package by name from the configured repositories.
Initiates a transactional package installation. The package manager resolves all dependencies using the DPLL-based SAT solver, downloads the package and its dependencies from the configured repository mirrors, verifies cryptographic signatures, and installs the files into the system sysroot. The entire operation is atomic: if any step fails, all changes are rolled back.
The installation process follows these steps:
- Query configured repositories for the package and its metadata.
- Resolve dependencies (transitive closure) using the SAT solver.
- Download package archives (with delta updates when available).
- Verify Ed25519/ML-DSA signatures on each archive.
- Extract files into the target locations within the VFS.
- Update the package database with installation records.
- Run post-install hooks if defined in the package manifest.
§Arguments
name- Name of the package to install. Must match a package name in at least one configured repository. Version constraints can be appended (e.g.,"foo>=1.2.0") or the latest available version is selected.
§Returns
Ok(())on successful installation of the package and all its dependencies.
§Errors
SyscallError::NotFound- The package name was not found in any configured repository.SyscallError::PermissionDenied- The caller lacks the package management capability.SyscallError::InvalidArgument- The package name is empty or contains invalid characters.SyscallError::AlreadyExists- The exact version of the package is already installed.SyscallError::IoError- A network or disk I/O error occurred during download or extraction.SyscallError::OutOfMemory- Insufficient disk space to install the package.SyscallError::InternalError- Dependency resolution failed (e.g., unsatisfiable constraints) or signature verification failed.
§Examples
use veridian_kernel::pkg::sdk::syscall_api::sys_pkg_install;
// Install a package by name (latest version)
sys_pkg_install("libveridian-dev").expect("install failed");
// Install with version constraint
sys_pkg_install("openssl>=3.0.0").expect("install failed");