⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

sys_pkg_install

Function sys_pkg_install 

Source
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:

  1. Query configured repositories for the package and its metadata.
  2. Resolve dependencies (transitive closure) using the SAT solver.
  3. Download package archives (with delta updates when available).
  4. Verify Ed25519/ML-DSA signatures on each archive.
  5. Extract files into the target locations within the VFS.
  6. Update the package database with installation records.
  7. 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

§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");