zpkg configuration
zpkg configuration lives in /etc/zpkg/ under the target root.
When working with ZPKG_ROOT=/mnt/zignos, it is /mnt/zignos/etc/zpkg/.
Every file is optional; when a file is absent, the defaults are used.
/etc/zpkg/├── use.conf # global USE flags├── package.use # per-package USE flags├── make.conf # CHANNEL / CFLAGS / MAKEOPTS├── binrepo.conf # binpkg repository├── sync.conf # default source for zpkg sync├── security.conf # signature verification policy├── sandbox.conf # build sandbox├── build.conf # reproducibility / logs / SBOM / cache retention└── trusted.d/ # trusted public keys (*.pub)Configuration files
Section titled “Configuration files”| File | Purpose | Format |
|---|---|---|
use.conf |
USE flags for all packages | Space-separated flags. # starts a comment through end of line |
package.use |
Per-package USE overrides | One line <package> flag -flag ... |
make.conf |
Channel and build flags | `CHANNEL=stable |
binrepo.conf |
binpkg repository | BINREPO=<URL or path> |
sync.conf |
Default source for recipe sync | RECIPEURL= / RECIPEGIT= / RECIPEBRANCH= / RECIPEALLOWUNSIGNED= |
security.conf |
Signature verification policy | TRUSTED_KEYS=... / `ALLOW_UNSIGNED=0 |
sandbox.conf |
Build sandbox | `SANDBOX=auto |
build.conf |
Reproducibility, records, build cache | SOURCE_DATE_EPOCH=<unix> / `BUILD_LOG=0 |
trusted.d/ |
Trusted public keys | <keyid>.pub (PKIX PEM) |
USE flags
Section titled “USE flags”Global (use.conf)
Section titled “Global (use.conf)”sslzlibThey can also be edited with zpkg use.
zpkg use # show the current global USEzpkg use ssl zlib # enablezpkg use -ssl # disablePer package (package.use)
Section titled “Per package (package.use)”grub uefi -biosThis enables uefi and disables bios for grub. To edit from the CLI:
zpkg use --package grub uefizpkg use --package grub -bioszpkg use --package grub # show effective values and tokensUSE flags are also used for conditional dependencies (flag?package). If a
conditional dependency uses a flag that is not in the recipe’s iuse, zpkg
raises an error.
Precedence
Section titled “Precedence”- Global flags in
use.conf - Per-package tokens in
package.use(later entries win) - The
ZPKG_USEenvironment variable — replaces the global configuration entirely (it is not additive)
package.use is unaffected by ZPKG_USE and is always applied on top of the
global values.
Changing USE flags does not rebuild installed packages automatically.
zpkg install -f <pkg> # force a rebuild of that packagezpkg upgrade --newuse # rebuild packages whose effective USE changedBuild flags (make.conf)
Section titled “Build flags (make.conf)”CHANNEL=stableCFLAGS="-O2 -pipe"MAKEOPTS="-j8"KEY=valueformat. Surrounding quotes around the value are stripped.- Shell command substitution is not performed. Write the actual number (such
as
-j8), notMAKEOPTS="-j$(nproc)". - The
ZPKG_CFLAGS/ZPKG_MAKEOPTSenvironment variables take precedence over the file. Setting them explicitly to an empty string clears that setting.
The values are passed to the build script as ZPKG_CFLAGS / ZPKG_MAKEOPTS.
Whether they reach the compiler depends on each recipe’s build.
Release channel (make.conf)
Section titled “Release channel (make.conf)”CHANNEL=stable # stable (default) / testing / unstable- The
ZPKG_CHANNELenvironment variable overrides it for a single run zpkg upgrade --channel <ch>also overrides it once- To switch permanently, use
zpkg channel <ch>(other lines are preserved) - After switching, check the differences with
zpkg upgrade -pbefore runningzpkg upgrade. upgrade shows the list of changes, dependency differences and warnings, installs after all builds succeed, and runs a consistency check when done --pruneremoves dependencies that are no longer needed,--allow-downgradepermits downgrades, and--verifychecks the sha256 of every file
The recipe tree is at $ZPKG_ROOT/usr/share/zignos/recipes/<channel>/.
stage3 ships only stable, so to use testing / unstable, import the recipe
tarball containing all channels with zpkg sync first, then switch. See
Release channels for details.
binpkg repository (binrepo.conf)
Section titled “binpkg repository (binrepo.conf)”BINREPO=https://example.com/zignos/binpkgszpkg install looks in this repository when a package is not in the local
binpkg cache. The repository needs a signed index.json.
zpkg mkindex --key ~/zignos-signing.key /path/to/binpkgsWith --key, index.json.sig and keys/<keyid>.pub are also generated. On
the client side, trust the public key.
zpkg key import /path/to/binrepo/keys/<keyid>.pubA match requires name, architecture, version+revision, the hash of the
effective USE/build flags, channel and recipe digest. The ZPKG_BINREPO
environment variable takes precedence over this file.
If verification of the signature, expiry, generation or sha256 fails, it is an
error and there is no fallback to a source build.
To skip binpkgs temporarily:
ZPKG_NO_BINPKG=1 zpkg install <pkg>Recipe sync (sync.conf)
Section titled “Recipe sync (sync.conf)”RECIPEURL=https://github.com/studio-nosa-tech/zignos-recipesRECIPEGIT=1RECIPEBRANCH=mainRECIPEALLOWUNSIGNED=1This is the default source for zpkg sync. If --from is given, it takes
precedence. In git mode, the commit is recorded in .zpkg-git in the replaced
tree and compared against the remote HEAD from git ls-remote. If they match,
nothing is fetched; on change, it shallow clones, verifies, then replaces.
zpkg sync # use sync.conf / ZPKG_RECIPE_URLzpkg sync --git --from https://github.com/studio-nosa-tech/zignos-recipeszpkg sync --from ./zignos-recipes # tar.xz or a directory also workszpkg sync --from zignos-stage3.tar.xzzpkg sync --from ./zignos-recipes -n # verify onlyThe ZPKG_RECIPE_URL / ZPKG_RECIPE_GIT / ZPKG_RECIPE_BRANCH environment
variables take precedence over sync.conf. The default repository is public
and can be fetched without authentication. A private repository needs a git
credential helper or an SSH key. sync only replaces the recipe tree; it does
not update installed packages. Run zpkg upgrade afterwards if needed.
sync verifies the tree’s recipes.manifest with a trusted key. Unsigned
trees are rejected by default. --allow-unsigned (or
ZPKG_ALLOW_UNSIGNED=1) is only for unsigned development trees. If a
signature exists but is broken, it is rejected even with --allow-unsigned.
Signing and trusted keys (security.conf)
Section titled “Signing and trusted keys (security.conf)”TRUSTED_KEYS=/etc/zpkg/trusted.dALLOW_UNSIGNED=0ALLOW_EXPIRED=0TRUSTED_KEYSis the directory holding*.pubfiles. Add keys withzpkg key import <pubkey>and list them withzpkg key listALLOW_UNSIGNED=1only permits repositories/recipe trees with no signature. It is not a loophole for accepting a broken signatureALLOW_EXPIRED=1only permits expired signatures. Signature and rollback verification remain in place- The last accepted generation and SHA-256 are stored in
$ZPKG_DB/.security.json, which rejects swapping in an older signed index / manifest - The
ZPKG_TRUSTED_KEYS/ZPKG_ALLOW_UNSIGNED/ZPKG_ALLOW_EXPIREDenvironment variables take precedence over this file
For key generation, repository signing and recipe tree signing, see Package signing and verification.
Build sandbox (sandbox.conf)
Section titled “Build sandbox (sandbox.conf)”SANDBOX=autoBUILD_NET=1#BWRAP=/usr/bin/bwrapSANDBOX=auto(the default) isolates the build when bubblewrap is available and warns and builds directly if it is missing or unusable.requirefails,offdisables the sandboxBUILD_NET=1allows network access during the build.0isolates it in a network namespace- A recipe’s
build_network(1/0) overrides the global setting - The
ZPKG_SANDBOX/ZPKG_BUILD_NET/ZPKG_BWRAPenvironment variables take precedence - Use
zpkg build --no-sandbox/zpkg install --no-sandboxto disable it temporarily
For the contents of the sandbox and notes on chroot, see Build environment isolation.
Reproducibility (build.conf)
Section titled “Reproducibility (build.conf)”SOURCE_DATE_EPOCH=946684800BUILD_LOG=1SBOM=1SOURCE_DATE_EPOCHis the fixed build time. The default is946684800(2000-01-01T00:00:00Z). Precedence isZPKG_SOURCE_DATE_EPOCH, then theSOURCE_DATE_EPOCHenvironment variable, then this fileBUILD_LOG=1(the default) saves build logs to$ZPKG_CACHE/logs/SBOM=1(the default) generates an SPDX 2.3 SBOM- The
ZPKG_BUILD_LOG/ZPKG_SBOMenvironment variables take precedence over this file
Changing the value changes the tar/gzip mtime in binpkgs, and therefore the artifact SHA-256. See Reproducible builds for details.
Build cache (build.conf)
Section titled “Build cache (build.conf)”By default, working data from successful builds is not kept, to limit disk usage.
KEEP_WORKDIR=0 # remove the work directory after a successful installBUILD_BINPKG=0 # do not create local binpkgsKEEP_SOURCES=0 # remove source archives used for the build| Key | Default | When 1 |
|---|---|---|
KEEP_WORKDIR |
0 |
Keep $ZPKG_CACHE/build/<base>/ |
BUILD_BINPKG |
0 |
Create a binpkg in $ZPKG_CACHE/binpkgs/ on success |
KEEP_SOURCES |
0 |
Keep downloaded source archives |
- When a new build succeeds, the old work directory and old binpkg for the same package are removed. Old data does not accumulate as versions rise
- A created binpkg is reused by the next
zpkg installwhen the recipe digest and channel match - Source archives: only the archives used by that build are removed. Bundled files such as patches remain
zpkg buildreturns the destroot as its result, so it keeps the work directory while running. Removal happens after a successfulzpkg install--repro-checkcreates a binpkg for comparison. WithBUILD_BINPKG=0it is removed after the comparison- The
ZPKG_KEEP_WORKDIR/ZPKG_BUILD_BINPKG/ZPKG_KEEP_SOURCESenvironment variables take precedence overbuild.conf - Work directories created by 0.3.2 and earlier do not record the package
name, so they are not removed automatically. Remove
/var/cache/zpkg/buildmanually
The cache locations and contents are:
/var/cache/zpkg/├── build/ # work directories (removed after success by default)├── binpkgs/ # local binpkgs and sidecars (not created by default)├── logs/ # build logs└── *.tar.* # source archives (removed after success by default)If the cache can be discarded entirely, deleting /var/cache/zpkg does not
affect installed packages. It is fetched and regenerated on the next build.
Paths and environment variables
Section titled “Paths and environment variables”| Variable | Default | Description |
|---|---|---|
ZPKG_ROOT |
/ |
Target root. /etc/zpkg/ is also under it |
ZPKG_REPOS |
Bundled tree | Recipe repositories. Separate multiple with the path separator (Unix : / Windows ;). Earlier entries win |
ZPKG_CACHE |
$ZPKG_ROOT/var/cache/zpkg |
Source cache, build work area, binpkgs |
ZPKG_DB |
$ZPKG_ROOT/var/lib/zpkg |
Installed package DB |
ZPKG_FORCE |
None | 1 allows removing modified packages |
ZPKG_NO_BINPKG |
None | 1 ignores local and repository binpkgs |
ZPKG_BINREPO |
None | binpkg repository (takes precedence over binrepo.conf) |
ZPKG_RECIPE_URL |
None | Default source for zpkg sync (takes precedence over sync.conf) |
ZPKG_RECIPE_GIT |
0 |
1 fetches it as a git repository |
ZPKG_RECIPE_BRANCH |
main |
git branch |
ZPKG_TRUSTED_KEYS |
$ZPKG_ROOT/etc/zpkg/trusted.d |
Directory of trusted *.pub files |
ZPKG_ALLOW_UNSIGNED |
None | 1 permits unsigned index/recipe trees (for development) |
ZPKG_ALLOW_EXPIRED |
None | 1 permits only expired signatures (for recovery) |
ZPKG_CHANNEL |
stable |
stable / testing / unstable (takes precedence over make.conf) |
ZPKG_SANDBOX |
auto |
auto / require / off |
ZPKG_BUILD_NET |
1 |
0 isolates the build from the network |
ZPKG_BWRAP |
bwrap |
bubblewrap executable |
ZPKG_SOURCE_DATE_EPOCH |
946684800 |
Fixed build time (the standard SOURCE_DATE_EPOCH also works) |
ZPKG_BUILD_LOG |
1 |
0 disables build log saving |
ZPKG_SBOM |
1 |
0 disables SPDX SBOM generation |
ZPKG_KEEP_WORKDIR |
0 |
1 keeps the work directory after a successful install |
ZPKG_BUILD_BINPKG |
0 |
1 creates a local binpkg after a source build |
ZPKG_KEEP_SOURCES |
0 |
1 keeps downloaded source archives |
ZPKG_USE |
None | Overrides the global USE entirely |
ZPKG_CFLAGS |
None | Overrides CFLAGS (an empty string is valid) |
ZPKG_MAKEOPTS |
None | Overrides MAKEOPTS (an empty string is valid) |
If ZPKG_REPOS is omitted, core / main / desktop under
$ZPKG_ROOT/usr/share/zignos/recipes are used. When the same package exists
in multiple repositories, the repository listed first wins.
Example configuration
Section titled “Example configuration”An example that configures GRUB for UEFI and the build flags on a minimal base:
grub uefi -biosCHANNEL=stableCFLAGS="-O2 -pipe"MAKEOPTS="-j8"BINREPO=https://example.com/zignos/binpkgsRECIPEURL=https://example.com/zignos-recipes.tar.xzAfter changing the configuration, rebuild as needed.
zpkg use --package grub uefizpkg install -f grub