Releases: systemd/mkosi
Releases · systemd/mkosi
v25.3
What's Changed
- Use become_root_cmd() when running systemd-repart in run_shell() as well by @DaanDeMeyer in #3425
- Use shutil.copy() to copy ovmf variables by @DaanDeMeyer in #3426
- The dpkg architecture name for loongarch64 is loong64 by @bluca in #3428
- mkosi-initrd: Add two more modules by @DaanDeMeyer in #3430
- Check if list matches are empty if empty string is matched against by @DaanDeMeyer in #3429
- opensuse: fix package name: btrfs-progs -> btrfsprogs by @aafeijoo-suse in #3432
- Log command line for abnormal signals by @DaanDeMeyer in #3433
- zypper: set $releasever variable by @aafeijoo-suse in #3434
- Tools tree improvements by @DaanDeMeyer in #3436
- mkosi-initrd: handle PermissionError when reading /etc/crypttab by @aafeijoo-suse in #3438
- Move want_uki() check out of build_uki_profiles() by @DaanDeMeyer in #3441
- mkosi-sandbox: Improve formatting of error messages by @DaanDeMeyer in #3443
- Fix verity signature check in case keys are configured by @hundeboll in #3447
- Treat terminal as dumb if either stdout or stderr is not a tty by @DaanDeMeyer in #3448
- Various cache fixes by @DaanDeMeyer in #3446
- config: add mkosi-addon by @bluca in #3449
- Calculate PE section size correctly by @DaanDeMeyer in #3450
- Use directory in user's home as output directory if possible by @DaanDeMeyer in #3453
- Fix condition when removing duplicate files from the overlay by @DaanDeMeyer in #3451
- Make secure boot keys/crts/source config universal by @labichn in #3455
Full Changelog: v25.2...v25.3
v25.2
What's Changed
- Only parse profiles from subimages and includes if those are dirs by @DaanDeMeyer in #3423
- Use all threads when relabelling files with setfiles by @DaanDeMeyer in #3424
Full Changelog: v25.1...v25.2
v25.1
What's Changed
- Remove depmod check in check_tools() by @DaanDeMeyer in #3413
- news: fix typo detected by Lintian by @bluca in #3414
- Create zipapp for mkosi sandbox like we do in generate-zipapp.sh by @DaanDeMeyer in #3415
- man: document kernel baseline for mkosi by @behrmann in #3416
- sandbox: Show better error on ENOSYS by @DaanDeMeyer in #3417
- Add fallback to sudo if run0 is not available by @DaanDeMeyer in #3418
- Do not check uid in have_cache() for default tools tree by @DaanDeMeyer in #3419
- Use resource_path() to access files in our own module by @DaanDeMeyer in #3420
- Fix accessing "name" field in busctl json output by @DaanDeMeyer in #3422
Full Changelog: v25...v25.1
v25
- Instead of using bubblewrap, sandboxing is now done with a new tool
mkosi-sandbox. This tool has a public API and can be used
independently of mkosi. - Image builds are now done in a user namespace with a single user when
running unprivileged instead of using newuidmap/newgidmap. When
running unprivileged, all files and directories in the image will be
owned by the invoking user (and by root inside any produced archives).
Any attempt to chown files to other users in scripts will fail unless
the new environment variable$MKOSI_CHROOT_SUPPRESS_CHOWNis set to
a true value. mkosidoes not drop privileges anymore to the invoking user when
running as root for various steps.- A new
cat-configverb will show all configuration files that were
included for each configured image. - Added support for Azure Linux
- Added support for Kali Linux
- If
mkosi.versionis executable, we now execute it and read the
version from stdout. - Added
--wipe-build-dirto wipe the build directory before rebuilding
the image. - Introduced
RepositoryKeyFetch=to control whether to fetch
distribution GPG keys remotely. This setting is disabled by
default for security reasons except when building rpm based
or Arch Linux images on Ubuntu. - We now handle
SIGHUPgracefully - Universal settings that take a collection of values cannot be
appended to anymore in subimages. Usage of package manager trees in
subimages will have to be moved to the top level image. Similarly,
repositories will have to be enabled in the top level image. - Repository metadata is not copied into images anymore.
- Repository metadata from base trees is not used anymore.
- Package manager trees are now named sandbox trees.
- Package manager trees (sandbox trees) do not use the skeleton trees as
their default anymore if unset. - Note to packagers: The manual pages have been moved to resources/man
and now include man pages for mkosi-initrd and mkosi-sandbox as
well. InitrdInclude=was removed. If you're usingInitrdInclude=, please
build your initrd via a subimage inmkosi.imagescontaining
Include=mkosi-initrdand any customizations you wish to add and use
theInitrds=setting to use it as the initrd for the main image
instead of the default initrd.- Added
History=to have mkosi save the config used to build the image
and reuse it when verbs such asqemu,boot, … are invoked
without-f. - Introduced new
[Build]section and moved various settings to it. - Moved
Include=to[Include]section - Added
sysupdateverb as a wrapper aroundsystemd-sysupdatewhich
invokes it with definitions frommkosi.sysupdate. - Added
RuntimeHome=to mount the current home directory to/root
when running a command that boots the image - More directories aside from
/etcand/usrare now picked up from
sandbox trees (formerly known as package manager trees). - Profile configuration from
mkosi.profilesis now parsed after
mkosi.conf.dinstead of before it. To set defaults for use inmkosi.conf.d
based on the configured profile, use an early dropin inmkosi.conf.dthat
matches on the configured profile instead. Profile=is renamed toProfiles=and takes a comma separated list of
profiles now. Scripts now receive$PROFILESwith a space-separated list
of profiles instead of$PROFILE. The%pspecifier for profiles is
removed.- Multiple sync, prepare, build, postinst, finalize, postoutput and clean scripts are now picked up from
mkosi.$SCRIPT.d. run0is now automatically used to escalate privileges for commands that need it, like theburnverb./usr/share/keyringsand/usr/share/distribution-gpg-keysare no longer automatically picked up from the
tools tree whenToolsTreeCertificates=is set, since they aren't certificates, use a sandbox tree
instead. This allows to overrideSignedBy=keys for APT repositories.- The
agetty.autologinandlogin.noauthcredentials are no longer set unconditionally. - Access to the output directory in build scripts was removed. To put artifacts
from the build directory into the output directory, copy them from the build directory
to the output directory in a post-installation script which does have access to the build
directory and the output directory. BuildDirectory=is no longer available inPrepareScripts=. If you
need to acquire some files for the build process place them somewhere
sensible within$BUILDROOTso that they can be cached when building
incrementally.- When using a tools tree and a relaxed sandbox is used to run a command
(qemu, nspawn, ...), we now keep all entries from$PATHoutside of
/usrintact. Note that this may cause issues if a$PATHentry
contains binaries linked against libraries in/usrfrom the host. - Introduced a new specifier
%Iwhich resolves to the name of the current
subimage when used in a config undermkosi.images/. This differs to%o
as it is always the name of the config file without extension (or the name
of the directory). - If
/dev/fuseis found in the host context, it is made available in the
sandbox context too. - Added a
sandboxverb to run a command within a relaxed mkosi sandbox
(the same sandbox thatmkosi vm,mkosi boot, ... run in). - OpenSSL providers are now supported as key sources for the various key
settings if a recent enough systemd version (257 or newer) is used. - Added support for loading X.509 certificates from OpenSSL providers if
a recent enough systemd version (257 or newer) is used. - Added
ToolsTreePackageDirectories= - Added
--kernel-image=tomkosi-initrdto specify the kernel image to
use when building a UKI. - Setting a collection based setting to the empty string via the CLI and
then appending to the same setting will now override the settings
coming from configuration files, whereas previously the CLI values
would be appended to the values from configuration files. - The
mkosi-initrddefault config now includes various extra kernel
modules by default. - The
coredumpctlandjournalctlverbs will now always operate on
the image, even ifForwardJournal=is configured. - Bumped default Fedora release to
41. - Added
addonoutput format to build UKI addons. - Renamed
[Host]section to[Runtime]section. - Renamed various settings from
[Host]. - Binaries coming from
ExtraSearchPaths=are now executed with the
tools tree mounted if one is configured (unlike before where the tools
tree was not mounted). This means that any binaries coming from
ExtraSearchPaths=have to be linked against libraries from the tools
tree (or have to be statically linked). Alternatively, the tools tree
distribution and release have to match the host. - Binaries from
ExtraSearchPaths=are not used anymore when building
the default tools tree. - Dropped support for
pesignas a secure boot signing tool. - Added support for
systemd-sbsignas a secure boot signing tool. - Added
--register=to control whether to register containers and VMs
with systemd-machined or not. mkosi.profilesis now parsed in subimages as well.mkosi-initrdnow usesdnf5on systems where it is the default.- Added various packages to the default tools tree.
- Dropped support for Ubuntu Focal.
- Added
Devicetree=setting for configuring bootloader device trees - Added systemd-machined registration using varlink for
mkosi qemuvms,
which includes the vsock CID so thatssh vsock/<cid>or
ssh machine/<name>will work on systems runningsystemd-machined
257 or newer. - Bumped CentOS Stream default release to 10.
- mkosi now manages the pacman keyring itself so
/etc/pacman.d/gnupg
from the host is not used anymore and mkosi will run
pacman-key --initandpacman-key --populateitself. - Added
ToolsTreeRelease=match - mkosi now enforces that images built with
Overlay=yesonly add files
on top of the base tree(s) and don't overwrite any existing files or
directories. - Added a
mkosi-addontool and accompanying kernel-install plugin that
allows building PE addons to extend a vendor provided unified kernel
image. - Added
systemd-boot-signed,uki-signedandgrub-signedvariants
for theBootloader=option which instruct mkosi to only install
pre-signed EFI binaries. mkosi.profilesis now parsed in configuration included with
Include=.- Any initrds configured with
Initrds=are now used as fallback when
booting with qemu direct kernel boot (--firmware=linux) if no split
initrd was produced by the image build. - mkosi now makes a greater effort to ensure the crypto-policies are
configured to allow GPG keys from older distributions. - We don't pick up pre-signed bootloader binaries anymore when
ShimBootloader=signedis configured. To force usage of pre-signed
EFI binaries, use the newsystemd-boot-signed,uki-signedand
grub-signedvariants for theBootloader=option. - Added a new constant
microsoft-mokfor theFirmwareVariables=
option. If specified, a firmware variables file with the Microsoft
keys enrolled will be extended to include aMokListentry that
trusts the certificate configured withSecureBootCertificate=and
passed toqemu. - We now use
mkosi.pkgcacheas the package cache directory if the
directory exists. BuildSourcesEphemeral=learned a new variantbuildcachein which
case the overlay will be cached in the build directory configured with
BuildDirectory=.
v24.3
What's Changed
- Check for $HOME environment variable as well by @DaanDeMeyer in #2927
v24.2
What's Changed
- Look for $USER for the username before reading /etc/passwd by @DaanDeMeyer in #2926
v24.1
What's Changed
- completion: fix bash completion script by @behrmann in #2916
- Add some documentation on how to implement a new distribution by @DaanDeMeyer in #2919
- Add missing init.py to mkosi/initrd/resources by @DaanDeMeyer in #2920
- Handle dangling symlinks in rmtree() and run_clean() by @DaanDeMeyer in #2922
- Handle failure to detect the distribution in test_parse_config() by @DaanDeMeyer in #2923
v24
- The default kernel command line of
console=ttyS0(or equivalent for
other architectures) has been removed. The requiredconsole=
argument to have the kernel output to the serial console has to be
added manually fromv24onwards. - Support for installing local packages located in directories in
BuildSources=was dropped. Instead, the packages can be made
available for installation viaPackageManagerTrees=. - Configuration parsing was reworked to remove the need for the
@
specifier and to streamline building multiple images with
mkosi.images/. If you were building multiple images with
mkosi.images/, you'll need to adapt your configuration to the
rework. Read the Building multiple images section in the
documentation for more information. - mkosi has gained the option to generate completion scripts for bash,
fish and zsh. Packagers should generate the scripts during packaging
and ship them in the appropriate places. - Added support for CentOS Stream 10.
- mkosi now installs a separate
mkosi-initrdscript that can be used
to build initramfs images intended for use on the local system. - We do not automatically append
centos-streamorfedoraanymore to
CentOS (and derivatives) and Fedora mirrors specified withMirror=
as not all mirrors store the repository metadata under these
subdirectories. Users are now required to add these subdirectories
themselves inMirror=. If the EPEL repositories are enabled for
CentOS Stream (and derivatives) andMirror=is used, we look for the
EPEL repositories in../fedorarelative to the mirror specified in
Mirror=. - We now support compressed tar archives wherever we already accept tar
archives as input. - We now always rerun the build if
Format=noneand don't remove
previous outputs in that case (unless--forceis specified). This
allows usingmkosi -t noneto rerun the build scripts without
removing the previous image. This can then be combined with
RuntimeBuildSources=yesto make the build script outputs available
in a booted container or virtual machine so they can be installed
without having to rebuild the image. - We now use
virtconsoleto provide the serial console when booting
withqemu. root=PARTUUIDandmount.usr=PARTUUIDon the kernel command line
are now automatically extended with the actual PARTUUID of the
corresponding partition.- All available OpenSUSE repositories are now supported and can be
enabled withRepositories=. - Building OpenSUSE
aarch64images is now supported mkosi dependencieswas beefed up to handle more scenarios properly- The default list of kernel modules that are always added to the
initramfs was extended with various virtualization modules. - Added a
Repositories=match. - Cached images are now invalidated if packages specified via
PackageDirectories=change. - Added
VolatilePackageDirectories=which can be used to provide local
packages that do not invalidate cached images. mkosi.pkgmngris now used as the default path for
PackageManagerTrees=.- The package directory that build scripts can use to make built
packages available for installation ($PACKAGEDIR) is now shared
between all image builds. This means that packages built in earlier
images and stored in$PACKAGEDIRbecome available for installation
in all subsequent image builds. - The default tools tree distribution is now chosen based on the host
distribution instead of the target distribution. - mkosi can now be invoked from the initramfs.
mkosi v23.1
v23.1
- Respin due to git tag mismatch
v23
- Added
CleanScripts=to allow running custom cleanup code whenever
mkosi cleans up the output directory. This allows cleaning up extra
outputs produced by e.g. a build script that mkosi doesn't know about. - Added
ConfigureScripts=to allow dynamically modifying the mkosi
configuration. Each configure script receives the current config as
JSON on stdin and should output the new config as JSON on stdout. - When building a UKI, we don't measure for the TPM SHA1 PCR bank
anymore. - All keys in the mkosi config JSON output are now in pascal case,
except for credentials and environments, where the keys encode names
of credentials and environment variables and are therefore case
sensitive. - Added various settings to allow running mkosi behind a proxy.
- Various fixes to kernel module filtering that should result in fewer
modules being pulled into the default initrd when
KernelModulesExclude=orKernelModulesInitrdExclude=are used. - Added
ToolsTreeDistribution=match. - Removed
vmspawnverb and replaced it withVirtualMachineMonitor=. - New specifiers for various directories were added.
%Dresolves to
the directory that mkosi was invoked in,%Pto the current working
directory, and%Cto the parent directory of the config file. - Added
ForwardJournal=to have systemd inside a container/VM forward
its journal to the specified file or directory. - Systemd scopes are now allocated for qemu, swtpm, virtiofsd and
systemd-journal-remote if available. - The
mkosi qemuvirtual machine is now registered with
systemd-machined if available. - Added new
ocioutput format - Runtime trees without a target are now mounted to
/root/srcinstead
of a subdirectory of it (To have the same behaviour as
BuildSources=). - Added
RuntimeBuildSources=to mount build and source directories
when booting the image withmkosi nspawnormkosi qemu. - Introduced
--appendto allow command line settings to be parsed
after parsing configuration files. distribution-releaseis not installed by default anymore on
OpenSUSE.- Setting
QemuSmp=to0will now make qemu use all available CPUs - Free page reporting and discard request processing are now enabled by
default in VMs spawned bymkosi qemu. - Added
ToolsTreeCertificates=to allow configuring whether to use
certificates and keys from the tools tree (if one is used) or the
host. - Added
neverforCacheOnly=to specify that repository metadata
should always be refreshed. - Renamed the
noneoption forCacheOnly=toauto. - Added
ProxyExclude=to configure hostnames for which requests should
not go through the configured proxy. - The default tools tree is now reused on incremental builds.
- Added
VolatilePackages=andInitrdVolatilePackages=to configure
packages that should be installed after executing build scripts and
which should not be cached when usingIncremental=. PackageDirectories=now has an associated default path
mkosi.packages.repreprois now used to generate local apt repositories.- Support for BSD tar/cpio was dropped.
- When both
ExtraSearchPaths=andToolsTree=are used, mkosi will
now prefer running a binary found inExtraSearchPaths=without the
tools tree over running the binary from the tools tree. If a binary is
not found inExtraSearchPaths=, the tools tree is used instead. - An artifact directory is now made available when running scripts which
can be used to pass around data between different scripts. mkosi will
also look for microcode and initrds in the artifact directory under
theio.mkosi.microcodeandio.mkosi.initrdsubdirectories. - Added
Environment=match setting to check for environment variables
defined with theEnvironment=setting. - The
basesystempackage is now always installed in Fedora and
CentOS images instead of thefilesystempackage. - The
qemu,shellandbootverbs do not automatically build the
image anymore unless--forceis specified. SplitArtifacts=is now supported for the portable, sysext and
confext outputs.- The
WithDocs=option was implemented for pacman-based distributions. - The default Fedora release was bumped to 40.
QemuSwtpm=can now be used withQemuFirmware=set tolinuxor
bios.- Added
UnitProperties=to allow configure properties on the scopes
generated bysystemd-nspawnandsystemd-run. - mkosi now only builds a single default tools tree per build using the
settings from the last regular image that we'll build. - Configure scripts are now only executed for verbs which imply an image
build and are executed with the tools tree instead of without it. $QEMU_ARCHITECTUREis now set for configure scripts to easily allow
scripts to figure out which qemu binary will be used to run qemu.- A file ID can now be specified for
QemuDrives=. This allows adding
multiple qemu drives that are backed by the same file. - mkosi doesn't fail anymore if images already exist when running
mkosi build. - Image names from
mkosi.images/are now preferred over the specified
image ID when determining the output filename to use for an image. --includenow has a shorthand option-I.- The
WITH_NETWORKenvironment variable is now passed to build and
finalize scripts. - We now clamp mtimes to the specified source date epoch timestamp
instead of resetting all mtimes. This means that we won't touch any
mtimes that are already older than the given source date epoch
timestamp. - Removed support for CentOS 8 Stream as it is now EOL.
- The
coredumpctlandjournalctlverbs now operrate on the path
specified inForwardJournal=if one is set. - Added
UnifiedKernelImageFormat=format setting to allow configuring
the naming of unified kernel images generated by mkosi. - The
versionlockplugin is now enabled by default for dnf with a noop
configuration. Repositories=is now implemented for zypper.KernelModulesInclude=andKernelModulesInitrdInclude=now take the
special valueshostanddefaultto include the host's loaded
modules and the default kernel modules defined inmkosi-initrd
respectively.KernelModulesIncludeHost=andKernelModulesInitrdIncludeHost=are
now deprecated.- Added
mkosi dependenciesto output the list of packages required by
mkosi to build and boot images.
mkosi v22
- We'll now try to delete btrfs subvolumes with
btrfs subvolume delete
first before falling back to recursively deleting the directory. - The invoking user is now always mapped to
rootwhen running sync
scripts. This fixes an issue where we would fail when a package
manager tree or skeleton tree contained a/usrdirectory as we would
not have permissions to run mount in the sandbox. - We now use qemu's official firmware descriptions to find EDK2/OVMF
UEFI firmware. Addititionally,QemuFirmware=uefinow boots without
SecureBoot support, andQemuFirmware=uefi-secure-bootwas introduced
to boot with SecureBoot support. By default we will still boot with
SecureBoot support ifQemuFirmware=auto. - Added support for
QemuFirmwareVariables=customand
QemuFirmwareVariables=microsoftto use OVMF/EDK2 variables with
either the user's custom keys enrolled or with the Microsoft keys
enrolled. - Added
UnifiedKernelImages=to control whether we generate unified
kernel images or not. Bootloader=grubwill now generate a grub EFI image and install it.
IfSecureBoot=is enabled andShimBootloader=is not set to
signed, the grub EFI image will be signed for SecureBoot.ShimBootloader=signedwill now also instruct mkosi to look for and
install already signed grub, systemd-boot, kernel and UKI binaries.- We now build grub images with a fixed set of modules and don't copy
any grub modules to the ESP anymore. - The configuration is now made available as a JSON file to all mkosi
scripts via the$MKOSI_CONFIGenvironment variable. $PROFILEis now set for all mkosi scripts containing the value of
Profile=if it is set.