Core engine
Helper libraries
A map of the engine's helper files and where each one is documented.
Scripts never download a helper file themselves. The engine loads the right ones for the place a script runs in, and the functions are documented one page per file in the function reference.
What is loaded where
| Where | Loaded by | Files |
|---|---|---|
| Container script on the host | core/build.func | core/core.func, core/error_handler.func, the menu code in ui/, the backend in pve/ or incus/, and lib/tools.func at start |
| Install script in the container | source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" | lxc/install.func, which loads core/core.func and core/error_handler.func |
Install script, after update_os | update_os | lib/tools.func, or lib/alpine.func on Alpine |
update_script in the container | core/build.func, then start | the same as on the host; lib/tools.func is loaded on Alpine too |
lib/tools.func is only a loader. It sources five files, and those hold the
functions:
| File | Contains | Reference |
|---|---|---|
lib/system.func | downloads with retry, packages, repositories, services, create_backup and restore_backup, OS probes | System helpers |
lib/forge.func | check_for_gh_release, fetch_and_deploy_gh_release and the GitLab and Codeberg equivalents | Releases and downloads |
lib/runtime.func | setup_nodejs, setup_uv, setup_go, setup_rust, setup_php, setup_java, setup_docker and other installers | Runtimes and tools |
lib/db.func | setup_postgresql, setup_mariadb, setup_mysql, setup_mongodb, setup_clickhouse, setup_meilisearch and the *_db helpers | Databases |
lib/hwaccel.func | setup_hwaccel | Hardware acceleration |
The other files a script author meets:
| File | Contains | Reference |
|---|---|---|
core/core.func | msg_info, msg_ok, msg_error, $STD, prompts, header_info, cleanup_lxc, arch_resolve, the update entry point | core.func |
core/error_handler.func | catch_errors, the error handler and the signal traps | Error handling |
lib/alpine.func | the smaller helper set for Alpine install scripts | Alpine helpers |
lxc/install.func | setting_up_container, network_check, update_os, motd_ssh, customize, the pkg_* and svc_* wrappers | Install scripts |
Which names are public
Each loader has a generated list of the functions it exposes, and the engine's CI compares the list with the code on every change:
lib/API.txtfor the helper libraryui/API.txtfor the menu and build codeapi/API.txtfor telemetry
A function that appears there can be used in a script. Names starting with an underscore are internal and can change without notice.