mkosi.news(7)
๐ mkosi Changelog ๐
okay so bestie, this is mkosi.news(7) โ the literal receipts of every change that ever landed in mkosi, version by version ๐ it's basically the group chat scrollback of the whole project, so grab a snack and let's get into it. every flag, every setting, every "we removed this, sorry" is right here, no cap.
๐ v27.1 ๐
- Fix tests failing in restricted build environments ๐ง
SignInitrdPCRs=can be used withSplitArtifacts=pcrs, fixing initrd-specific PCR policies with systemd v262 โจ- Don't fail creating initrds when there are directories mixed in with microcode files ๐ซถ
- Fix builds when using unsigned local repositories with opensuse ๐
- Only use repositories and variables from the sandbox tree when using DNF ๐
- The
mkosi-obsno longer setsMakeScriptsExecutable=, except for the main image, so it can be included again ๐ - The security and debug repositories are switched back to
deb.debian.organd are no longer set by theRepositories=setting ๐ - Add an environment variable
MKOSI_FORCE_USERNS_FALLBACKthat when set to a value that parses as a truthy bool, skips usingsystemd-nsresourcedโญ - A new setting
DelegateRanges=is added that defaults to0when mkosi is run as the root user. This fixes builds run as the root user ๐
๐ฅ v27 ๐ฅ
- Debug output (with
--debug) will now show the duration of all steps โฑ๏ธ lowkey so satisfying - When booting an image it is always registered with user session machined instance ๐
- gzip compressed outputs have been made reproducible โจ yes bestie, reproducibility ate
- Generate locales configured in
/etc/locale.gen๐ PORTABLE_PREFIXES=can be set viaEnvironment=๐- The special value
defaultis now understood forInitrds=, so that it can be used in conjunction with custom initrds ๐ - Plugins for DNF can be configured via the environment variables
MKOSI_DNF_DISABLE_PLUGINSandMKOSI_DNF_ENABLE_PLUGINS. This is meant for advanced use cases and is not supported further ๐ (iykyk, don't come crying if it breaks) - A new option
MakeScriptsExecutable=has been added to make scripts, that are not executable, executable instead of exiting with an error ๐ง - A new option
OutputSize=has been added to resize output images to that size after creation ๐ - Two new options
OciLabels=andOciAnnotations=have been added to support adding custom labels and annotations for images using the OCI output ๐ท๏ธ - Default initrds are no longer built by default for images using the directory output ๐
- All cached images are removed when repository metadata will be synced to avoid partial upgrade scenarios ๐
- When booting images the hostname is no longer set via the kernel command line so as not to overwrite the hostname set via other means in the image ๐ฅ๏ธ
- Support for using
systemd-nsresourced's foreign UID range has been added for directory images via the newForeignUIDRange=. This is now the only supported way for booting directory images unprivileged. Building images unprivileged without a sufficiently newsystemd-nsresourcedis still supported ๐ฆ - If a
mkosi/directory exists and no output location is configured, the.mkosi-privatewill be put there ๐๏ธ LocalMirror=can now be set for tools trees ๐ซ- A new setting
DiskType=has been added to configures the disk type to use for the root disk when booting a virtual machine ๐ฝ - Four new settings
ElTorito=,ElToritoSystem=,ElToritoVolume=, andElToritoPublisher=for use withsystemd-repart's El Torito support have been added ๐ฅ mkosi boxdoes not tint the background by itself anymore ๐จ- The GitHub integration tests have been made runnable locally ๐งช
- Support for distribution-built UKIs have been fixed and they are picked up as
/usr/lib/modules/<kver>/vmlinuz*.efiif a signed bootloader orUnifiedKernelImages=signedis requested ๐ - The update-grub trigger of APK is disabled for postmarketOS if
/etc/update-grub.confdoes not exist. If you define the file yourself, you must setdisable_trigger=1yourself, if you pull in the grub package ๐ซถ (yes bestie, that one's on you) - A new option
ToolsTreeSnapshotwas added, which defaults to the value of the regularSnapshot=setting if the same distribution is used for the image and the tools tree ๐
โจ v26 โจ
- Extra options to commands invoked by mkosi (e.g. when using
mkosi bootormkosi shell) should now be delimited from regular options using--. Options passed after the verb without using the--delimiter are now interpreted as regular mkosi options โ ๏ธ - Boolean options specified on the command line now always expect a boolean argument. For example,
--repository-key-checkneeds to become--repository-key-check=yes. The reason for this change is to remove ambiguity when parsing e.g.--repository-key-check buildwherebuildwould be interpreted as the argument for--repository-key-checkwhereas now it'll be properly interpreted as the verb ๐ - Teach
--veritya new hash value, which skips the verity signature partition for extension / portable images. To align the possible values,yesis renamed tosigned๐๏ธ - Teach
--veritya newdefervalue, which defers creation of the verity signature partition for disk, extension and portable images (but still allocates space for it). This is useful to implement offline signing of the verity roothash ๐ - A new way to specify modules included in the initrd has been added. The new default is that modules need to be specified to be included. Previous separate Include and Exclude options that take regexps are now deprecated and are replaced by a single option that takes a list of positive and negative globs. The new options are
KernelModules=andKernelInitrdModules=๐งฉ - A new way to specify firmware files included in the initrd has been added. Previous separate Include and Exclude options that take regexps are now deprecated and are replaced by a single option that takes a list of positive and negative globs. The new option is
FirmwareFiles=๐ซถ - The
RuntimeScratch=option has been dropped. UseRuntimeSize=instead to grow the image before booting it ๐๏ธ - The
CDROM=option has been dropped ๐๏ธ - Unknown settings now generate a warning message instead of failing the image build. This allows configs to work across a wider range of mkosi versions while still taking advantage of newer settings.
MinimumVersioncan still be used to enforce a minimum version of mkosi that knows all required settings ๐ก
๐ฆ 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 โ ๏ธ - mkosi does 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/manand now include man pages formkosi-initrdandmkosi-sandboxas well ๐ InitrdInclude=was removed. If you're usingInitrdInclude=, please build your initrd via a subimage inmkosi.imagescontainingInclude=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/rootwhen 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 aftermkosi.conf.dinstead of before it. To set defaults for use inmkosi.conf.dbased 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 one 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 not a thing inPrepareScripts=anymore โ like, gone gone. If your prepare script needs to grab files for the build, drop them somewhere sensible inside$BUILDROOTso they can actually get cached when you build incrementally. That's the whole vibe ๐- When you're using a tools tree and a relaxed sandbox to run a command (
qemu,nspawn, ...), we now keep all entries from$PATHoutside of/usrintact. Sounds iconic, right? But heads up โ this can cause issues if a$PATHentry contains binaries linked against libraries in/usrfrom the host. ๐ญ - New specifier just dropped:
%Iโจ It resolves to the name of the current subimage when you use it in a config undermkosi.images/. And how is it different from%o? It's always the name of the config file without extension (or the name of the directory). iykyk ๐ซถ - If
/dev/fuseis found in the host context, it gets made available in the sandbox context too. Sharing is caring bestie ๐ - Added a
sandboxverb so you can run a command inside a relaxed mkosi sandbox โ literally the same sandbox thatmkosi vm,mkosi boot, ... run in. ๐ง - OpenSSL providers are now supported as key sources for the various key settings, as long as you're on a recent enough systemd version (257 or newer). ๐
- Also added support for loading X.509 certificates from OpenSSL providers if you've got a recent enough systemd version (257 or newer). Double slay.
- Added
ToolsTreePackageDirectories=โจ - Added
--kernel-image=tomkosi-initrdso you can specify which kernel image to use when building a UKI. ๐ - Okay so this one's a subtle but real behaviour change: if you set a collection based setting to the empty string via the CLI and then append to that same setting, it will now override the settings coming from configuration files. Before, the CLI values would've been appended to the values from configuration files. So, different. Noted. ๐
- The
mkosi-initrddefault config now includes various extra kernel modules by default. More modules, more fun ๐ธ - The
coredumpctlandjournalctlverbs will now always operate on the image โ even ifForwardJournal=is configured. No cap. ๐ฅ - Bumped the default Fedora release to 41 ๐
- Added the
addonoutput format for building UKI addons ๐ฆ - Renamed the
[Host]section to[Runtime]. Get used to the new name, bestie ๐ - Also renamed various settings from
[Host]โ so go check your configs, this is your sign ๐ - 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). Which means: any binaries coming fromExtraSearchPaths=have to be linked against libraries from the tools tree (or be statically linked). Alternatively, the tools tree distribution and release have to match the host. Pick your fighter ๐ญ - Binaries from
ExtraSearchPaths=are not used anymore when building the default tools tree. Periodt. - Dropped support for
pesignas a secure boot signing tool. It's over ๐ - Added support for
systemd-sbsignas a secure boot signing tool. We love a glow-up โจ - Added
--register=to control whether to register containers and VMs withsystemd-machinedor not. Your call, main character ๐ mkosi.profilesis now parsed in subimages as well ๐mkosi-initrdnow usesdnf5on systems where it is the default. Matching energy.- Added various packages to the default tools tree. Snacks for the tools tree, basically ๐
- Dropped support for Ubuntu Focal. RIP, respect ๐ซถ
- Added the
Devicetree=setting for configuring bootloader device trees ๐ - Added
systemd-machinedregistration using varlink formkosi qemuvms โ and it includes the vsock CID so thatssh vsock/<cid>orssh machine/<name>will work on systems runningsystemd-machined257 or newer. ssh-ing into your vm like a boss ๐ - Bumped the CentOS Stream default release to 10 ๐ฅ
- mkosi now manages the
pacmankeyring itself, so/etc/pacman.d/gnupgfrom the host is not used anymore. mkosi will runpacman-key --initandpacman-key --populateitself. Self-sufficient queen behaviour ๐ - 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. No sneaky overwrites allowed ๐ - Added a
mkosi-addontool and an accompanyingkernel-installplugin that lets you build PE addons to extend a vendor provided unified kernel image. Extend the UKI, extend the lore ๐ง - Added
systemd-boot-signed,uki-signedandgrub-signedvariants for theBootloader=option, which instruct mkosi to only install pre-signed EFI binaries. Signed and delivered ๐ mkosi.profilesis now parsed in configuration included withInclude=as well ๐ธ- Any initrds configured with
Initrds=are now used as a fallback when booting with qemu direct kernel boot (--firmware=linux) if no split initrd was produced by the image build. Backup initrd, love that for you ๐ซถ - mkosi now makes a greater effort to ensure the crypto-policies are configured to allow GPG keys from older distributions. Respecting the elders ๐
Big one: we don't pick up pre-signed bootloader binaries anymore whenShimBootloader=signedis configured. To force usage of pre-signed EFI binaries, use the newsystemd-boot-signed,uki-signedandgrub-signedvariants for theBootloader=option instead. Don't say I didn't warn you ๐ญ
- 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 to qemu. ๐ - We now use
mkosi.pkgcacheas the package cache directory if that directory exists ๐ BuildSourcesEphemeral=learned a new variant:buildcacheโ in which case the overlay will be cached in the build directory configured withBuildDirectory=. Cache it, bestie ๐
v24
- The default kernel command line of
console=ttyS0(or the equivalent for other architectures) has been removed. So from v24 onwards you have to manually add the requiredconsole=argument yourself if you want the kernel output on the serial console. It's giving DIY now ๐ญ - Support for installing local packages located in directories in
BuildSources=was dropped. Instead, you can make those packages available for installation viaPackageManagerTrees=. Same goal, different route ๐ - Configuration parsing got reworked to remove the need for the
@specifier and to streamline building multiple images withmkosi.images/. If you were building multiple images withmkosi.images/, you'll need to adapt your configuration to the rework โ go read the Building multiple images section in the documentation for more info. This is your homework, bestie ๐ - mkosi gained the option to generate completion scripts for
bash,fishandzsh๐ Packagers should generate the scripts during packaging and ship them in the appropriate places. Do it for the people ๐ซถ - 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. Local initramfs, iconic โจ - We do not automatically append
centos-streamorfedoraanymore to CentOS (and derivatives) and Fedora mirrors specified withMirror=, because not all mirrors store the repository metadata under these subdirectories. Users are now required to add these subdirectories themselves inMirror=. And 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 inMirror=. Read that twice, it matters ๐ธ - We now support compressed tar archives wherever we already accept tar archives as input. Compression stans rise ๐
- We now always rerun the build if
Format=noneand don't remove previous outputs in that case (unless--forceis specified). This lets you usemkosi -t noneto rerun the build scripts without removing the previous image โ and you can combine that withRuntimeBuildSources=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. Elite workflow behaviour ๐ - We now use
virtconsoleto provide the serial console when booting with qemu ๐ root=PARTUUIDandmount.usr=PARTUUIDon the kernel command line are now automatically extended with the actualPARTUUIDof the corresponding partition. Auto-magic, love that for us โจ- All available OpenSUSE repositories are now supported and can be enabled with
Repositories=๐ - Building OpenSUSE
aarch64images is now supported ๐ฆ mkosi dependencieswas beefed up to handle more scenarios properly. She's been to the gym ๐ช- 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. Fresh cache only, bestie ๐ - Added
VolatilePackageDirectories=, which can be used to provide local packages that do not invalidate cached images. Cache-friendly local packages, the dream ๐ธ mkosi.pkgmngris now used as the default path forPackageManagerTrees=. ๐- The package directory that build scripts can use to make built packages available for installation (
$PACKAGEDIR) is now shared between all image builds. Which means packages built in earlier images and stored in$PACKAGEDIRbecome available for installation in all subsequent image builds. Sharing economy but make it packages ๐ซถ - The default tools tree distribution is now chosen based on the host distribution instead of the target distribution. Plot twist ๐ญ
- mkosi can now be invoked from the initramfs. She's everywhere now ๐
v23.1
- Respin due to git tag mismatch. That's it, that's the whole changelog entry ๐ (git said no, so we tried again)
v23
- Added
CleanScripts=so you can run custom cleanup code whenever mkosi cleans up the output directory. Perfect if you produce extra outputs from e.g. a build script that mkosi doesn't know about โ now you can clean those up yourself ๐งนโจ - Added
ConfigureScripts=to allow dynamically modifying the mkosi configuration. Each configure script receives the current config as JSON onstdinand should output the new config as JSON onstdout. Config-ception, but make it useful ๐ - When building a UKI, we don't measure for the TPM SHA1 PCR bank anymore. SHA1, your time is up ๐
- 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. Don't mess with case-sensitive names, bestie ๐
- 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. Lean initrd era ๐ธ - Added
ToolsTreeDistribution=match โจ - Removed the
vmspawnverb and replaced it withVirtualMachineMonitor=. Out with the old, in with the new ๐ - 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. Memorize these, they're useful fr fr ๐ - 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,virtiofsdandsystemd-journal-remoteif available. Organized queen behaviour ๐ - The
mkosi qemuvirtual machine is now registered withsystemd-machinedif 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 asBuildSources=๐ซถ - Added
RuntimeBuildSources=to mount the build and source directories when you boot the image withmkosi nspawnormkosi qemu. yes bestie, your sources are right there while it runs, so slay ๐ - Introduced
--appendso command line settings can be parsed after the configuration files get parsed. ordering matters, and now you control it โจ distribution-releaseis not installed by default anymore on OpenSUSE. lowkey a glow-down of default packages but okay ๐ซถ- Setting
QemuSmp=to0will now make qemu use all available CPUs. zero means everything, main character energy fr ๐ฅ - Free page reporting and discard request processing are now enabled by default in VMs spawned by
mkosi qemu. - Added
ToolsTreeCertificates=to let you configure whether to use certificates and keys from the tools tree (if one is used) or from the host. pick your source, no cap ๐ - Added
neverforCacheOnly=, which specifies that repository metadata should always be refreshed. never means never, periodt ๐ - Renamed the
noneoption forCacheOnly=toauto. the name changed, the vibes are immaculate. - 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. recycling is iconic ๐
- 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 pathmkosi.packages. it's giving "drop your packages here" ๐repreprois now used to generate local apt repositories.- Support for BSD tar/cpio was dropped. RIP bestie, you will not be missed ๐ญ
- When both
ExtraSearchPaths=andToolsTree=are used,mkosiwill 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. like, extras first, tools tree as the fallback, iykyk ๐ฆ - An artifact directory is now made available when running scripts, which can be used to pass around data between different scripts.
mkosiwill also look for microcode and initrds in the artifact directory under theio.mkosi.microcodeandio.mkosi.initrdsubdirectories. shared folder for the script girlies โจ - Added the
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. swap noted ๐ฆ - The
qemu,shellandbootverbs do not automatically build the image anymore unless--forceis specified. no sneaky builds, you have to ask ๐ SplitArtifacts=is now supported for theportable,sysextandconfextoutputs. split it, slay it โจ- The
WithDocs=option was implemented for pacman-based distributions. - The default Fedora release was bumped to
40. happy birthday Fedora ๐ QemuSwtpm=can now be used withQemuFirmware=set tolinuxorbios.- Added
UnitProperties=to allow configuring properties on the scopes generated bysystemd-nspawnandsystemd-run. mkosinow only builds a single default tools tree per build, using the settings from the last regular image that we'll build. one tree, one vibe ๐ณ- Configure scripts are now only executed for verbs which imply an image build, and they're executed with the tools tree instead of without it.
$QEMU_ARCHITECTUREis now set for configure scripts, so scripts can easily figure out which qemu binary will be used to run qemu. go little env var go ๐โโ๏ธ- A file ID can now be specified for
QemuDrives=. this allows adding multiple qemu drives that are backed by the same file. efficient queen ๐ mkosidoesn't fail anymore if images already exist when runningmkosi build. chill behaviour fr fr- 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. shorter flag, same slay.- 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. polite and respectful of your timestamps ๐ซถ
- Removed support for CentOS 8 Stream as it is now EOL. o7 ๐
- The
coredumpctlandjournalctlverbs now operate on the path specified inForwardJournal=if one is set. - Added the
UnifiedKernelImageFormat=format setting to allow configuring the naming of unified kernel images generated bymkosi. - The
versionlockplugin is now enabled by default for dnf with a noop configuration. Repositories=is now implemented for zypper. finally ๐KernelModulesInclude=andKernelModulesInitrdInclude=now take the special valueshostanddefault, to include the host's loaded modules and the default kernel modules defined inmkosi-initrdrespectively. two magic words, no cap ๐ชKernelModulesIncludeHost=andKernelModulesInitrdIncludeHost=are now deprecated. bestie they're old news, move on ๐- Added
mkosi dependenciesto output the list of packages required by mkosi to build and boot images. literally a shopping list, obsessed ๐
๐ v22 ๐
- We'll now try to delete btrfs subvolumes with
btrfs subvolume deletefirst, before falling back to recursively deleting the directory. try the nice way first, always ๐ธ - The invoking user is now always mapped to root when running sync scripts. This fixes an issue where we would fail when a package manager tree or skeleton tree contained a
/usrdirectory, because we wouldn't have permissions to run mount in the sandbox. root era ๐ - We now use qemu's official firmware descriptions to find EDK2/OVMF UEFI firmware. Additionally,
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. read that twice bestie, the meanings flipped ๐ - Added support for
QemuFirmwareVariables=customandQemuFirmwareVariables=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. yes or no, pick your fighter โจ Bootloader=grubwill now generate a grub EFI image and install it. IfSecureBoot=is enabled andShimBootloader=is not set tosigned, the grub EFI image will be signed for SecureBoot.ShimBootloader=signedwill now also instructmkosito look for and install already signed grub, systemd-boot, kernel and UKI binaries. pre-signed and pre-slaying ๐- 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. your whole config, in JSON, right there ๐ $PROFILEis now set for all mkosi scripts, containing the value ofProfile=if it is set.
๐ v21 ๐
- We now handle unmerged-usr systems correctly โจ
- Builtin configs (
mkosi-initrd,mkosi-tools) can now be included usingInclude=(e.g.Include=mkosi-initrd). builtin and built different ๐ - The kernel-install plugin now uses the builtin
mkosi-initrdconfig, so there's no need anymore to copy the fullmkosi-initrdconfig into/usr/lib/mkosi-initrd. - We don't require a build anymore for the
journalctlandcoredumpctlverbs. no build, just vibes ๐ฆ mkosi sshworks again when used withToolsTree=default.- We now use
.zstinstead of.zstdfor compressed split artifacts produced bysystemd-repart. one less letter, honestly iconic. systemd-repartuses a persistent temporary directory again for assembling images instead of a tmpfs.- Added
MicrocodeHost=setting to only include the CPU specific microcode for the current host system. just your CPU's microcode, main character only ๐ - The kernel-install plugin now only includes the CPU specific microcode.
- Introduced
PackageCacheDirectory=to set the directory for package manager caches. This setting defaults to a suitable location in the system or user directory depending on howmkosiis invoked.CacheDirectory=is only used for incremental cached images now. know the difference bestie ๐ - Repository metadata is now synced once at the start of each image build and never during an image build. Each image includes a snapshot of the repository metadata in the canonical locations in
/var, so that incremental images and extension images can reuse the same snapshot.
โ ๏ธ When building an image intended to be used withBaseTrees=, disableCleanPackageMetadata=to make sure the repository metadata in/varis not cleaned up, otherwise any extension images using this image as their base tree will not be able to install additional packages. don't skip this one fr ๐ญ
- Implemented
CacheOnly=metadata.
๐ Note that in the JSON output, the value of CacheOnly= will now be a string instead of a boolean. it's giving type change, brace yourself ๐
- Added
CompressLevel=to set the compression level to use. - Dropped experimental Gentoo support. experimental era over ๐ซก
- Added
TriggerMatch=to specify multiple match sections, of which only one should be satisfied. - Added
jq,attr,acl,git,sed,grepandfindutilsto the default tools tree. the tools tree ate and left no crumbs ๐ฅ - Added
mkosi-install,mkosi-upgrade,mkosi-removeandmkosi-reinstallscripts, which allow writing scripts that are independent of the package manager being used to build the image. package-manager-agnostic queen ๐ - We now expand specifiers in Match section values.
- Made GPG key handling for Fedora rawhide more robust. rawhide is chaos, we tamed it a lil ๐พ
- If
systemd-repart256 or newer is available,mkosiwill instruct it to generate/etc/fstaband/etc/crypttabfor the image if any partition definitions contain the corresponding settings (MountPoint=andEncryptedVolume=). bashis now started in the debug shell instead ofsh. upgrade bestie โจ- The default release for Ubuntu is now
noble. - Ubuntu is now used as the default tools tree distribution for Ubuntu instead of Debian. matching sets, love that for us ๐
- Added
mkosi vmspawn, which boots the image withsystemd-vmspawn.
โ ๏ธ Note thatsystemd-vmspawnis experimental and its interface may still change. As such,mkosi vmspawnis also considered experimental. Note thatsystemd-vmspawnversion 256 or newer is required. experimental means experimental, no cap ๐
- Added
SyncScripts=, which can be used to update various build sources before starting the image build. - The
DISTRIBUTION=andRELEASE=environment variables are now set when running scripts. - Added
ToolsTreeRepositories=andToolsTreePackageManagerTrees=. - Added
RuntimeNetwork=to configure the networking used when booting the image. networking but make it configurable ๐ - Added
SecureBootKeySource=andVerityKeySource=to support signing images with OpenSSL engines.
๐ Note that these settings require various systemd tools to be version 256 or newer. check your versions first bestie ๐ซถ
- We don't clean up package manager metadata anymore unless explicitly requested with
CleanPackageManagerMetadata=yeswhen building directory and tar images.
๐ v20.2 ๐
- Fixed a bug in signing unsigned shim EFI binaries. bug found, bug obliterated ๐
- We now build an early microcode initrd in the mkosi kernel-install plugin.
- Added
PackageDirectories=to allow providing extra packages to be made available during the build. extra packages, extra slay ๐ - Fixed issue where
KernelModulesIncludeHostwas including unnecessary modules. it was doing too much, now it's doing just enough โจ - Fixed
--mirrorspec for CentOS (and its variant girlies) and Fedora โ before, you had to point at a subdirectory inside the mirror, which meant you literally could not use CentOS and EPEL repos from the same mirror ๐ญ now you just give the URL and she's slaying. - Package manager cache dirs get mounted when we run scripts on the host โ so any packages you install in scripts are actually cached properly, no more re-downloading the same thing like a clown ๐
- No more filelists downloads on Fedora โ we just don't, and honestly? good for us. ๐
- Nested build sources don't error out anymore when they try to install packages. the drama is over.
- We don't build the same tools tree twice anymore when you're building multiple images โ one and done, efficient queen behavior ๐
/etc/mtabcompat symlink now gets created in mkosi's sandbox. little symlink, big deal โจ- We always hash the root password ourselves now instead of leaving that job to
systemd-firstboot. we do it, we do it right, no handoff. ๐ฅ /srvand/mntare not mounted read-only anymore during builds โ they get write access like the main characters they are.- Fixed a crash that happened when you ran mkosi in a directory with fewer than two parent directories ๐ญ that was a vibe check we failed, but it's fixed now.
- Implemented
RepositoryKeyCheck=for apt-based distributions โ she's real now, bestie. ๐
๐ฆ v20.1 ๐ฆ
BuildSources=are now mounted when we install packages โ so local packages can actually be made available in the sandbox, periodt. ๐ซถ- Fixed the "am I root?" check โ which makes sure we don't do shared mounts when running as root. lowkey important, highkey fixed. โจ
- The extension release file is now actually written when building system or configuration extensions. like, actually. real. on disk. not just a vibe. ๐
- The nspawn settings get copied to the output directory again โ they made a comeback, iconic. ๐
- Incremental caching is now skipped when
Overlay=is enabled โ because that combo isn't supported, and we're not gonna pretend it is. - The SELinux relabel check is way more granular now โ it checks for all the required files instead of just going "is there a policy configured? cool, we're done." ๐
qemu-system-xxxbinaries are preferred over the genericqemuandqemu-kvmbinaries โ specific girlies over generic girlies, always. ๐- Grub tools from the tools tree are now used to install grub, instead of the grub tools living inside the image itself. also the grub tools got added to the default tools trees too, so it's all cozy in there. ๐ฅ
- The pacman keyring in tools trees is now only populated from the Arch Linux keyring โ no more Debian/Ubuntu ones sneaking in. we had to let that go. ๐ธ
gpgis allowed to access/run/pscsd/pscsd.common the host if it exists โ so it can interact with smartcards. smartcard girlies, this one's for you ๐ณโจ
๐ v20 ๐
- The current working directory is NOT mounted unconditionally to
/work/srcanymore. instead, the default value forBuildSources=is what mounts the cwd to/work/src. real talk: this means if you explicitly configureBuildSources=, the current working directory is no longer implicitly included. behavior change, bestie, take note. ๐ - Assigning the empty string to a setting that takes a list of values now overrides any configured default value too. yes,
""actually does something now. she has power. ๐ - The github action does not build and install systemd from source anymore โ instead, use
ToolsTree=defaultto make sure a recent version of systemd is used for the image build. easier, cleaner, less chaos. โจ - Added
EnvironmentFiles=to read environment variables from environment files. env vars, from files, into your build. ๐ซถ - We drastically reduced how much of the host system we expose to scripts. aside from
/usr, a few directories in/etc,/tmp,/var/tmpand various directories configured in mkosi settings, ALL host directories are hidden from scripts, package managers and other tools executed by mkosi. privacy era ๐โจ - Added
RuntimeScratch=to automatically mount a directory with extra scratch space into mkosi-spawned containers and virtual machines. scratch space, but make it automatic. ๐ - Package manager trees can now be used to configure every tool invoked by mkosi while building an image that reads config files from
/etcor/usr. every. single. tool. ๐ - Added
SELinuxRelabel=to specify whether to relabel selinux files or not. your call, your labels. ๐ท๏ธ - Lots of fixes to tools trees, and tools trees are now covered by CI ๐ญ some combinations aren't possible yet, but we're actively working to make them possible. we're on it, fr fr. ๐ฅ
mkosi qemunow supports direct kernel boots of s390x and powerpc images. big architectures, big slay. ๐- Added
HostArchitecture=match to match against the host architecture. yass, match her. ๐ - We don't use the user's SSH public/private keypair anymore for
mkosi sshโ instead we use a separate key pair, which can be generated bymkosi genkey. โ ๏ธ heads up: if you usemkosi ssh, you'll have to runmkosi genkeyonce to generate the necessary files somkosi sshkeeps working. don't skip it, bestie, or ssh will simply not vibe. ๐ - We don't automatically set
--offline=noanymore when we detect theSubvolumes=setting used in asystemd-repartpartition definition file. instead, use the newRepartOffline=option to explicitly disable runningsystemd-repartin offline mode. ๐ - During the image build we now install UKIs/kernels/initrds to
/bootinstead of/efi. most people won't notice, but โ ๏ธ if you've got customsystemd-repartESP partition definitions, you need to addCopyFiles=/boot:/alongside the usualCopyFiles=/efi:/to your ESP partition definitions. the payoff? installing to/bootmakes it possible to use/bootto populate an XBOOTLDR partition, which wasn't possible before. and good news โ this is also safe to do before v20, so you can unconditionally addCopyFiles=/boot:/to any ESP partition definition files. ๐ - Added
QemuFirmwareVariables=so you can specify a custom OVMF variables file to use. custom firmware variables, custom vibe. โจ - Added
MinimumVersion=to specify the minimum required mkosi version to build an image. gatekeeping, but make it helpful. ๐ - Added support for Arch Linux's debug repositories. debug girlies rise ๐ฆ
- Merged the mkosi-initrd project into mkosi itself โ
mkosi-initrdis now used to build the default initrd. she's home now. ๐ ๐ - Implemented mkosi-initrd for all supported distributions. all of them. no cap. ๐
- Added
ShimBootloader=to support installing shim to the ESP. shim squad, assemble. ๐ซถ - Added sysext, confext and portable output formats โ these produce signed disk images usable as sysexts, confexts and portable services respectively. three new formats, all signed, all iconic. ๐
- Added
QemuVsockConnectionId=to configure how to allocate the vsock connection ID whenQemUVsock=is enabled. ๐ง - Added documentation on how to build sysexts with mkosi โ you asked, we documented. iykyk ๐โจ
- Global systemd user presets are now also configured. not just the system ones, the user ones too. ๐
- Implemented
WithDocs=for apt. apt girlies get docs control too. ๐ - On supported package managers, locale data for other locales is now stripped if the locale is explicitly configured using
Locale=. (original says "local" but like, we all know she means locale ๐ญ) smaller images, same vibe. โ๏ธ - All rpm plugins are now disabled when building images. every single one. off. ๐ซ
- Added
KernelModulesIncludeHost=andKernelModulesInitrdIncludeHost=to only include modules loaded on the host system in the image/initrd respectively. only the host's faves make the cut. ๐ธ - Implemented
RemovePackages=for Arch Linux. removal rights, granted. ๐ - Added
useraddandgroupaddscripts to configure these binaries to operate on the image during builds instead of on the host. they work on the image now, where they belong. ๐ซถ - Added microcode support โ if installed into the image, an early microcode initrd is automatically built and prepended to the initrd. automatic. prepended. iconic. ๐ฅ
- A passwordless root account may now be created by specifying
hashed:. โ ๏ธ yes that's a real thing and yes it means what you think โ passwordless root, by design, withhashed:. be normal about it. ๐ - The
Autologin=feature got extended with support for arm64, s390x and powerpc architectures. autologin, but global. ๐ - Added
SecureBootAutoEnroll=to control automatic enrollment of secureboot keys separately from signing systemd-boot and generated UKIs. separate control, separate slay. ๐ ImageVersion=is no longer automatically appended to the output files. instead, it's automatically appended toOutput=if not specified, and the result is that the%ospecifier is equivalent to%ior%i_%vdepending on whetherImageVersion=is specified. ๐ read that specifier bit twice, bestie.
โญ v19 โญ
- Support for RHEL was added! RHEL girlies, you're seen. ๐โจ
- Added
journalctlandcoredumpctlverbs for running the respective tools on built directory or disk images. logs and cores, but on your image. ๐ - Added a
burnverb to write the output image to a block device. ๐ฅ literally burn. accurate naming for once. - Added a new
espoutput format โ largely similar to the existingukioutput format, but wraps it in a disk image with only an ESP. ESP-only, extra cute. ๐ - Presets were renamed to Images. so:
mkosi.images/is now used instead ofmkosi.presets/, thePresets=setting was renamed toImages=, and the Presets section was merged into the Config section. ๐ซถ good news: the old names can still be used for backwards compatibility, so nothing breaks. iykyk - Added profiles to support building variants of the same image in one repository. profiles can be defined in
mkosi.profiles/and you select one using the newProfile=setting. variants, babes. variants. ๐ - mkosi will now parse
mkosi.local.confbefore any other config files if that file exists. local config gets first dibs. ๐ - Added a kernel-install plugin โ โ ๏ธ but this is only shipped in the source tree and is NOT included in the Python module. read that twice. ๐ฆ
- Added a
--jsonoption to get the output ofmkosi summaryas JSON. machine-readable summary, for the data girlies. ๐ง - Added shorthand
-afor--autologin. short flag, same slay. โจ - Added a
--debug-workspaceoption to NOT remove the workspace directory after a build โ super useful for inspecting the workspace after failing builds. as a consequence, the prefix for the default workspace directory prefix changed from.mkosi-tmptomkosi-workspace. ๐ note the rename, bestie. - Scripts with the
.chrootextension are now executed in the image automatically. just name it.chrootand she knows what to do. ๐ช - Added an rpm helper script to have rpm automatically operate on the image when running scripts. ๐ซถ
- Added
mkosi-as-callerhelper script that you can use in scripts to run commands as the user invoking mkosi. be the caller you want to see in the world. ๐ mkosi-chrootwill now start a shell if no arguments are specified. no args? shell. you're welcome. ๐- Added
WithRecommends=to configure whether to install recommended packages by default or not, where it's supported. โ ๏ธ it's disabled by default. ๐ - Added
ToolsTreeMirror=setting for configuring the mirror to use for the default tools tree. mirror, mirror. ๐ชโจ WithDocs=is now enabled by default. docs on by default, because reading is fundamental. ๐- Added
BuildSourcesEphemeral=to make source directories ephemeral when running scripts โ meaning any changes made to source directories while running scripts get undone after the scripts finish executing. what happens in the script stays in the script ๐ซง (well, gets reverted. same vibe.) - Added
QemuDrives=to have mkosi create extra qemu drives and pass them to qemu when using theqemuverb. extra drives, extra fun. ๐พ - Added
BuildSources=match to match against configured build source targets. match made in config. ๐ PackageManagerTrees=was moved to the Distribution section. new home, same setting. ๐ก- We now automatically configure the qemu firmware, kernel cmdline and initrd based on what type of kernel you pass via
-kernelorQemuKernel=. auto-config, no cap. โ๏ธโจ - The mkosi repository itself now ships configuration to build basic bootable images that you can use to test mkosi. test girlies, this is your moment. ๐งช
- Added support for enabling
updates-testingrepositories for Fedora. testing repos, unlocked. ๐ - GPG keys for CentOS, Fedora, Alma and Rocky are now looked up locally first before fetching them remotely. local first, remote second. efficient queen. ๐ธ
- Signatures are not required for local packages on Arch anymore. local packages, you're free. ๐๏ธ
- Packages on opensuse are now always downloaded in advance before installation when using
zypper. download first, install second. order matters. ๐ - The tar output is now reproducible. same input, same tar, every time. ๐โจ
- We now make sure
gitcan actually be executed from mkosi scripts without running into permission errors. no more random permission jumpscare mid-build ๐โจ - We don't create subdirectories beneath the configured cache directory anymore. clean cache, clean mind ๐งน
- Workspace directories are now created outside of any source directories. mkosi will either use
XDG_CACHE_HOME,$HOME/.cacheor/var/tmpdepending on the situation. so your source tree stays untouched, as it should ๐ - Added environment variable
MKOSI_DNFto override which dnf to use for building images (dnfordnf5). pick your fighter ๐ฅ - The rootfs can now be modified when running build scripts โ with all changes thrown away after the last build script has been executed. temporary chaos, zero consequences ๐
- mkosi now fails if configuration specified via the CLI does not apply to any image (because it is overridden). harsh but fair, bestie ๐จ
- Added a new doc on building rpms from source with mkosi (
docs/building-rpms-from-source.md). go read it, it's giving study date ๐ /etc/resolv.confwill now only be mounted for scripts when they are run with network access. situational resolv.conf, iconic behavior ๐
๐ธ v18 ๐ธ
$SCRIPTwas renamed to$CHROOT_SCRIPT.$SCRIPTcan still be used but is considered deprecated. it's giving "still works but everyone's judging you" ๐- Added
RuntimeTrees=setting to mount directories when booting images viamkosi boot,mkosi shellormkosi qemu. The directories are mounted with a uid map that maps the user invoking mkosi to the root user, so that all files in the directory appear as if owned by the root user in the container or virtual machine, and any new files created in the directories are owned by the user invoking mkosi. To make this work in VMs, we use VirtioFS viavirtiofsd. Note that this requires systemd v254 or newer to be installed in the image. uid mapping is the main character here, no cap ๐ - Added support for booting directory images with
mkosi qemuvia VirtioFS. WhenCONFIG_VIRTIOFSandCONFIG_VIRTIO_PCIare builtin modules, no initramfs is required to make this work. zero initramfs, maximum slay ๐ฆ - Added
Include=or--includeto include extra configuration files or directories. modular config era โจ - Added support for specifiers to access the current value of certain settings during configuration file parsing. config files that know themselves, love that for them ๐ช
- mkosi will now exit with an error when no configuration was provided. it literally refuses to guess, periodt ๐
- Multiple scripts of the same type are now supported. more scripts, more friends ๐ซถ
- Custom distributions are now supported via the new
customdistribution. When usingcustomas the distribution, the rootfs must be provided via base trees, skeleton trees or prepare scripts. build your own little world ๐ - We now use local GPG keys for rpm based distributions if the
distribution-gpg-keyspackage is installed on the host. trust, but locally ๐ - Added
RuntimeSize=to grow the image to a specific size before booting it when usingmkosi bootormkosi qemu. glow-up before the boot โจ - We now set
MKOSI_UIDandMKOSI_GIDwhen running scripts, which are set to the uid and gid of the user invoking mkosi respectively. These can be used to run commands as the user that invoked mkosi. identity crisis? no, identity variables ๐ชช - Added an
Architecture=match ๐๏ธ - Initrds specified with
Initrds=are now used for grub menuentries as well. equal initrd rights for grub ๐ ImageId=andImageVersion=are now written toos-releaseasIMAGE_IDandIMAGE_VERSIONif provided. putting the name on the label ๐ท๏ธ- We pass command line arguments passed to the
buildverb to the build script again. the arguments are coming back, and honestly? we're happy about it ๐ญ - We added support for the โRHEL Universal Base Imageโ distribution. RHEL UBI said hi and we said hi back ๐
๐ v17.1 ๐
- Fixed bug where
--autologinwas broken when used in combination with a tools tree when using a packaged version of mkosi. little fix, huge relief ๐ฎโ๐จ
โญ v17 โญ
- Added
ToolsTreePackages=to add extra packages to the default tools tree. sprinkles for your tools tree ๐ - Added
SystemdVersion=match to match on the host's systemd version ๐ - Added
Format=match to match on the configured output format ๐ฆ Presets=can now be configured in global configuration files to select which presets to build. set it globally, live your truth ๐- UKIs can now be booted using direct linux boot. UKI gets the direct treatment ๐
- We don't try to make images UEFI bootable anymore on architectures that do not support UEFI. respectfully, no ๐
- Fixed
--helpto show all options again. the options were hiding, we found them ๐ฆ - We now warn when settings are configured in the wrong section. you put it in the wrong channel bestie, moving it for you ๐
๐ฆ v16 ๐ฆ
mkosi.versionis now picked up from preset and dropin directories as well, following the usual config precedence logic. it gets around, respectfully ๐ง- Removed the โfirst assignment winsโ logic from configuration parsing. Settings parsed later will now override earlier values. last one in gets the crown ๐
- Removed the
!operator for lists. Instead, assign the empty string to the list to remove all previous values. empty string = clean slate ๐งผ - Added support for configuring custom default values for settings by prefixing their name in the configuration file with
@. at-sign said "defaults, but mine" โจ - Added
QemuCdrom=to attach the image to the virtual machine as a CD-ROM instead of a block device. retro tech moment ๐ฟ - Added
SectorSize=to set the sector size of the disk images built bysystemd-repart. sector size rights ๐ฏ - Added back grub support (BIOS/UEFI). Note that we don't install grub on UEFI yet, but we do add the necessary configuration and partitions. grub is back and it's complicated ๐ซ
- Added
Bootloader=option to configure which EFI bootloader to install. Addedukioption to install just the UKI withoutsystemd-boot, andgrubto generate grub configuration to chainload into the built UKIs. choose your bootloader like it's a personality quiz ๐ฎ - Added
BiosBootloader=to configure whether grub for BIOS gets installed or not. BIOS grub: yes or no, no in-between ๐ค - Added
QemuFirmware=to select which qemu firmware to use (OVMF,Seabiosor direct kernel boot). pick your firmware vibe ๐ - Added
QemuKernel=to specify the kernel that should be used with direct kernel boot. a kernel just for qemu, bespoke ๐งต /var/lib/dbus/machine-idis now removed if it was added by a package manager postinstall script. yeeted by request ๐- The manifest is not generated by default anymore. Use
ManifestFormat=jsonto make sure the manifest is generated. manifest said "I need to be asked" ๐ - Added
SourceDateEpoch=to enable more reproducible image builds. same input, same output, that's the dream ๐ - Added
Seed=to set the seed passed tosystemd-repart. seeded like a pro ๐ฑ - Updated the default Fedora release to Fedora 39. Fedora said new year new me ๐
- If
ToolsTree=is set todefault, mkosi will now build a default tools tree containing all the necessary tools to build images. The distribution and release to use can be configured withToolsTreeDistribution=andToolsTreeRelease=or are determined automatically based on the image being built. auto-magic tools tree, obsessed ๐ช - Added
ukioutput format. This is similar tocpio, except the cpio is packaged up as a UKI with a kernel image and stub picked up from the rootfs. cpio but make it fancy ๐
๐ง v15.1 ๐ง
- The man page can be generated from the markdown file via
tools/make-man-page.sh. docs generating docs, very meta โจ - Fixed issue where not all packages and data files where included in the generated python package. missing files found, justice served โ๏ธ
- mkosi doesn't try to unshare the network namespace anymore when it doesn't have
CAP_NET_ADMIN. if you can't do it, don't try it, growth ๐ฑ - Fixed issue when the workspace was located in
/tmp./tmpworkspaces said "I exist" and now we listen ๐ซถ - Don't try to run
timedatectlorssh-addwhen they're not installed. no ghost binaries, no cry ๐ญ
๐ฅ v15 ๐ฅ
- Migrated to
systemd-repart. Many options are dropped in favor of specifying them directly in repart partition definition files:Format=gpt_xxxoptions are replaced with a single โdiskโ options. Filesystem to use can now be specified with repart'sFormat=optionFormat=plain_squashfs(Can be reproduced by a single repart squashfs root partition combined withSplitArtifacts=yes)Verity=(Replaced by repart'sVerity=options)Encrypt=(Replaced by repart'sEncrypt=option)RootSize=,HomeSize=,VarSize=,TmpSize=,ESPSize=,SwapSize=,SrvSize=(Replaced by repart's size options)UsrOnly=(replaced withCopyFiles=/:/usrin a usr partition definition)OutputSplitRoot=,OutputSplitVerity=, (Replaced by repart'sSplitName=option)OutputSplitKernel=(UKI is now always written to its own output file)GPTFirstLBA(Removed, no equivalent in repart)ReadOnly=(Replaced by repart'sReadOnly=option per partition)Minimize=(Replaced by repart'sMinimize=option per partition)CompressFs=(No equivalent in repart, can be replicated by replacingmkfs.in$PATHwith a script that adds the necessary command line option)MkSquashfs=(Can be replaced with a script in$PATHthat invokes the correct binary)
- We also remove the
WithoutUnifiedKernelImages=switch as building unified kernel images is trivial and fast these days. UKIs are literally not the vibe-killer they used to be ๐ง - Support for
โqemu-bootwas dropped โ - Support for
โuse-host-repositorieswas dropped, useโrepository-directoryinstead RepositoryDirectorywas removed, usePackageManagerTrees=orSkeletonTrees=instead. old setting out, two new settings in ๐ช--repositoriesis now only usable on Debian/RPM based distros and can only be used to enable additional repositories. Specifically, it cannot be used on Arch Linux anymore to add new repositories. Arch, you're on your own for this one ๐- The
_epeldistributions were removed. Use--repositories=epelinstead to enable the EPEL repository. EPEL glow-up ๐ซ - Removed
-streamfrom CentOS release specifiers. Instead of specifying8-stream, you know just specify8. shorter spec, same energy โ๏ธ - Removed default kernel command line arguments
rhgb,selinux=0andaudit=0. bye to the defaults ๐ - Dropped
โallandโall-directoryas this functionality is better implemented by using a build system. use a build system bestie, it's the grown-up move ๐ - mkosi now builds images without needing root privileges. rootless era, and we're thriving ๐
- Removed
--no-chown,--idmapand--nspawn-keep-unitoptions as they were made obsolete by moving to rootless builds. obsolete options get retired respectfully ๐ - Removed
--source-file-transfer,--source-file-transfer-final,--source-resolve-symlinksand--source-resolve-symlinks-finalin favor of always mounting the source directory into the build image.--source-file-transfer-finalmight be reimplemented in the future usingvirtiofsd. maybe one day, king ๐ - Dropped
--include-diroption. Usage can be replaced by using--incrementaland reading includes from the cached build image tree. ๐ฒ - Removed
--machine-idin favor of shipping images without a machine ID at all. no machine ID is the new machine ID ๐ชช - Removed
--skip-final-phaseas we only have a single phase now. one phase, one love ๐ - The post install script is only called for the final image now and not for the build image anymore. Use the prepare script instead. post-install said "final image only, I'm busy" ๐
--ssh-key,--ssh-agent,--ssh-portand--ssh-timeoutoptions were dropped as the SSH support was reimplemented using VSock.mkosi sshcan only be used with images booted withmkosi qemu. Usemachinectlto access images booted withmkosi boot. Useโextra-treeorโcredentialwith the.ssh.authorized_keys.rootcredentials as alternatives for provisioning the public key inside the image. SSH got a whole rework, read the fine print fr fr ๐- Only configuration files matching
*.confare parsed in dropin directories now.*.confonly, the rest are strangers ๐ซ - Removed
--qemu-headless, we now start qemu in the terminal by default and configure the serial console at runtime. Use the new--qemu-guioption to start qemu in its graphical interface. terminal by default, GUI on request ๐ป - Removed
--netdev. Can be replaced by manually installingsystemd-networkd, putting a network file in the image and enablingsystemd-networkd. DIY networking arc ๐ - If
mkosi.extra/ormkosi.skeleton/exist, mkosi now always uses them โ no more "only when you didn't define an explicit extra/skeleton tree" situation. It's giving unconditional love โจ - mkosi doesn't install any default packages anymore, aside from packages required by the distro, or the base filesystem layout package if there are no required packages. What that means in practice? systemd and other basic tools have to be installed explicitly from now on. Yeah. Your faves aren't coming free ๐ญ
--base-packagesis gone, because it's just not needed anymore โ since we don't install any packages by default anymore aside from the base filesystem layout package. Byeee ๐--qcow2is removed, in favor of supporting only raw disk images as the disk image output format. Raw is the main character now ๐--bmapis removed โ you can trivially add it manually by utilizing a finalize script. DIY era ๐ฅ- The
nevervalue for--with-networkgot spun off into its own custom option:--cache-only. She needed her own space ๐ฆ --bootablenow defaults toauto. When it's set toauto, mkosi only generates a bootable image if all the necessary packages are installed. Docs were added indocs/bootable.mdon how a bootable image can be generated on mainstream distros ๐- The RPM db is no longer rebuilt in
bdbformat on CentOS Stream 8. To be able to install packages on a CentOS Stream 8 image with a RPM db insqliteformat, rewrite the db inbdbformat usingrpm --rebuilddb --define _db_backend bdb. - Repositories are now only written to
/etc/apt/sources.listifaptis installed in the image. No apt, no list, no problem ๐ - The dependency on
debootstrapto build Ubuntu or Debian images is removed ๐ aptnow uses the keyring from the host instead of the keyring from the image. Which meansdebian-archive-keyringorubuntu-archive-keyringare now required to be installed to build Debian or Ubuntu images respectively. Keyring era ๐--base-imagegot split into--base-treeand--overlay. Two icons, both slaying โจ--cache-initrdis removed. Instead, use a prebuilt initrd withInitrds=to avoid rebuilding the initrd all the time. Work smarter, not harder ๐- Disk images are now resized to 8G when booted, to give you some disk space to play around with in the booted image. Room to be silly ๐ซถ
--install-directory=is removed. It was originally added for caching the installation results, but that doesn't work properly โ it might leave leftover files in the install directory from a previous installation, so the directory has to be emptied before reusing it, which invalidates the caching entirely. So the option got the boot. Honestly? Fair ๐ญ- Build scripts are now executed on the host. See the SCRIPTS section in the manual for more info. Existing build scripts will need to be updated to make sure they keep working โ specifically, most paths in scripts will need to be prefixed with
$BUILDROOTto have them operate on the image instead of on the host system. To ensure the host system cannot be modified when running a script, most host directories are mounted read-only when running a script, so a script literally cannot modify the host in any way ๐
Alternatively to making the script run on the host, the script can also still be executed in the image itself by putting the following snippet at the top of the script:
if [ "$container" != "mkosi" ]; then
exec mkosi-chroot "$SCRIPT" "$@"
fi
--tar-strip-selinux-context=is removed. We now label all files properly if selinux is enabled, and if users don't want the labels, they can simply exclude them when extracting the archive. Labels stay on unless you say otherwise ๐ท๏ธ- Gentoo is now marked as experimental and unsupported and there's no guarantee at all that it will work. Issues related to gentoo will generally not receive attention from core maintainers. All gentoo specific hacks outside of the gentoo implementation module have been removed. It's giving "we tried, bestie" ๐
- A
documentationverb has been added. Calling mkosi with this verb shows the documentation โ super useful when you're running mkosi during development and want the documentation in the correct version always available. By default it tries several ways to output the documentation, but a specific option can be chosen with the--doc-formatoption. Distro packagers are encouraged to add a filemkosi.1into themkosi/resourcesdirectory of the Python package if it's missing, as well as install it in the appropriate search path for man pages. The man page can be generated from the markdown filemkosi/resources/mkosi.md, e.g. viapandoc -t man -s -o mkosi.1 mkosi.md๐ BuildSources=now takessource:targetpairs, which specify the source directory and where to mount it relative to the top level source directory when running scripts. LikeBuildSources=../my-project:my-projectโ cute, right? ๐
๐ v14
- Support for Clear Linux was dropped. See
https://github.com/systemd/mkosi/pull/1037for more information. - Support for Photon was dropped. See
https://github.com/systemd/mkosi/pull/1048for more information. - The Arch kernel/bootloader pacman hooks were removed. For anyone that still wants to use them, they can be found here. (iykyk ๐ซถ)
- mkosi now creates
distro~releasesubdirectories inside the build, cache and output directories, for eachdistro~releasecombination that is built. This lets you build for multiple distros without throwing away the results of a previous distro build every single time. Multitasking icon behavior ๐ - The preferred names for mkosi configuration files and directories are now
mkosi.confandmkosi.conf.d/respectively. The old names (mkosi.defaultandmkosi.default.d) have been removed from the docs but are still supported for backwards compatibility. She's retired but she still shows up to the function ๐ plain_squashfstype images will now also be named with a.rawsuffix.tartype images will now respect the--compressoption.- Pacman's
SigLeveloption was changed to use the same default value as used on Arch, which isSigLevel = Required DatabaseOptional. If this results in keyring errors, you need to update the keyring by runningpacman-key --populate archlinux๐ - Support for CentOS 7 was dropped. If you still need to support CentOS 7, we recommend using any mkosi version up to 13.
- Support for BIOS/grub was dropped. Because EFI hardware is widely available, and legacy BIOS systems do not support the feature set to fully verify a boot chain from firmware to userland, and it has become bothersome to maintain for little use. No cap ๐
To generate BIOS images you can use any version of mkosi up to mkosi 13, or the new --bios-size option. This can be used to add a BIOS boot partition of the specified size, on which grub (or any other bootloader) can be installed with the help of mkosi's script support (depending on your needs, most likely mkosi.postinst or mkosi.finalize). This method can also be used for other EFI bootloaders that mkosi intentionally does not support. Slay, DIY โจ
- mkosi now unconditionally copies the kernel, initrd and kernel cmdline from the image, which were previously only copied out for Qemu boot. Copy-paste era ๐
- mkosi now runs
aptanddpkgon the host. As such, we now requireaptanddpkgto be installed on the host, along withdebootstrap, in order to be able to build debian/ubuntu images. - Split dm-verity artifacts' default names have been changed to match what systemd and other tools expect:
image.root.raw,image.root.verity,image.root.roothash,image.root.roothash.p7s(same for usr variants). Consistency is the vibe ๐ - mkosi will again default to the same OS release as the host system, when the host system uses the same distribution as the image that's being built.
- By default, mkosi will now change the owner of newly created directories to
SUDO_UIDorPKEXEC_UIDif defined โ unless--no-chownis used. Permissions, but make it polite ๐ซถ - If systemd-nspawn v252 or newer is used, bind-mounted directories with systemd-nspawn will use the new
rootidmapoption, so files and directories created from within the container will be owned by the actual directory owner on the host. Obsessed with this for us ๐
๐ฆ v13
- The
--network-vethoption has been renamed to--netdev. The old name made sense with virtual ethernet devices, but when booting images with qemu, a TUN/TAP device is used instead. Naming glow-up โจ - The network config file installed by mkosi when the
--netdev(previously--network-veth) option is used (formerly/etc/systemd/network/80-mkosi-network-veth.networkin the image) now only matches network interfaces using thevirtio_netdriver. Please make sure you weren't relying on this file to configure any network interfaces other than the tun/tap virtio-net interface created by mkosi when booting the image in QEMU with the--netdevoption. If you were relying on this config file when the host system uses the same distribution as the image that's being built. Instead, when no release is specified, mkosi will now always default to the default version embedded in mkosi itself.
okay so that last bullet got a little scrambled in the notes, but I'm keeping every word of it because that's the rule and I don't make the rules (I do respect them tho) ๐
- mkosi will now use the pacman keyring from the host when building Arch images. This means users will, on top of installing
archlinux-keyring, also have to runpacman-key --initandpacman-key --populate archlinuxon the host system to be able to build Arch images. Also, unless the package manager is configured to do it automatically, the host keyring will have to be updated afterarchlinux-keyringupdates by runningpacman-key --populate archlinuxandpacman-key --updatedb๐ - Direct qemu linux boot is now supported with
BootProtocols=linux. When enabled, the kernel image, initrd, and cmdline will be extracted from the image and passed to qemu bymkosi qemuto directly boot into the kernel image without a bootloader. This can be used to boot, for example, s390x images in qemu. Kernel main character energy ๐ - The initrd will now always be rebuilt after the extra trees and build artifacts have been installed into the image. Rebuilt, every time, no skipping ๐
- The github action has been migrated to Ubuntu Jammy. To migrate any jobs using the action, add
runs-on: ubuntu-22.04to the job config. - All images are now configured by default with the
C.UTF-8locale. Multilingual queen ๐ - New
--repository-directoryoption can be used to configure a directory with extra repository files, to be used by the package manager when building an image. Note that this option is currently only supported for pacman and dnf-based distros. Limited edition ๐ - Option
--skeleton-treeis now supported on Debian-based distros. Finally ๐ --hostnameis removed, as it's trivial to configure usingsystemd-firstboot.- Default locale configuration is removed, as it's trivial to configure using
systemd-firstboot, and systemd writes a default locale well. Let systemd cook ๐
๐ธ v12
- Fix handling of
baselayoutin Gentoo installations. Small fix, big heart ๐
โญ v11
- Support for Rocky Linux, Alma Linux, and Gentoo has been added! New friends unlocked ๐ซถโจ
- A brand new
ManifestFormat=option is here and it makes โmanifestโ files that literally describe what packages got installed ๐. Withjson, you get a JSON file showing the names and versions of all installed packages. Withchangelog, you get a longer human-readable file showing package descriptions and changelogs. Heads up though: thatchangelogformat should be considered experimental and it's likely to change in later versions. iykyk ๐ - New
RemovePackages=option, and it uninstalls packages after the build and finalize scripts are done โจ. It's giving โclean up after yourselfโ โ super useful when packages are required by the build scripts, or pulled in as dependencies for scriptlets of other packages, but are not necessary in the final image. Bye besties ๐ - New
BaseImage=option for building โsystem extensionsโ a.k.a. โsysextsโ ๐ฆ โ those are partial images that get mounted on top of an existing system to provide additional files under/usr/. See thesystemd-sysextman page for more info, k? - New
CleanPackageMetadata=option, and it can force or disable the removal of package manager files ๐ฅ. When you don't use this option, they're removed when the package manager isn't installed in the final image. - New
UseHostRepositories=option tells mkosi to use the repository configuration from the host system instead of the internal list ๐. - New
SshAgent=option configures the path to the ssh agent. - New
SshPort=option overrides the port used for ssh ๐ธ. - The
Verity=setting supports a shiny new valuesignedโญ. When it's set, verity data gets signed and the result is inserted as an additional partition in the image. Seehttps://systemd.io/DISCOVERABLE_PARTITIONSfor details about signed disk images. This info is used bysystemd-nspawn,systemd-dissect,systemd-sysext,systemd-portabledand systemd'sRootImage=setting (among others) to cryptographically validate the image file systems before use. Literal main character energy ๐ - The
--build-environment=option got renamed to--environment=and extended to cover all invoked scripts, not just themkosi.buildโจ. Don't stress โ the old name is still understood ๐ซถ - With
--with-network=never, dnf is called with--cacheonly, so the package lists are not refreshed. This gives a degree of reproducibility when doing repeated installs with the same package set (and also makes installs significantly faster, slay ๐ ). - The
--debug=option gained a new valuediskto show information about disk sized and partition allocations. - Some sections and settings have been renamed for clarity ๐:
[Packages]is now[Content], andPassword=,PasswordIsHashed=, andAutologin=are now in[Content]. The old names are still supported, but not documented. - When
--prepare-script=/--build-script=/--finalize-script=is used with an empty argument, the corresponding script will not be called ๐. - Python 3.7 is the minimal supported version.
Note to packagers: the Python cryptography module is needed for signing of verity data. Don't forget it bestie, fr fr ๐
๐ v10 ๐
- Minimum supported Python version is now 3.7.
- Automatic configuration of the network for Arch Linux was removed to bring different distros more in line with each other ๐ญ. To add it back, add a postinstall script to configure your network manager of choice.
- The
--defaultoption was changed to not affect the search location ofmkosi.default.d/. mkosi now always searches formkosi.default.d/in the working directory. quietwas dropped from the default kernel command line.--source-file-transferand--source-file-transfer-finalnow accept an empty value as the argument, which you can use to override a previous setting โจ.- A new command
mkosi serveserves build artifacts using a small embedded HTTP server ๐ฆ. This is useful formachinectl pull-raw ...andmachinectl pull-tar .... - A new command
mkosi genkeygenerates secure boot keys for use with mkosi's--secure-bootoptions ๐. The number of days the keys should remain valid can be specified via--secure-boot-valid-days=and their CN via--secure-boot-common-name=. - When booting images with qemu, firmware that supports Secure Boot will be used if available ๐.
--source-resolve-symlinksand--source-resolve-symlinks-finaloptions are added to control how symlinks in the build sources are handled when--source-file-transfer[-final]=copy-allis used.--build-environment=option was added to set variables for the build script.--usr-onlyoption was added to build images that comprise only the/usr/directory instead of the whole root file system ๐ธ. This is useful for stateless systems where/etc/and/var/are populated bysystemd-tmpfiles/systemd-sysusersand related calls at boot, or systems that are originally shipped without a root file system, but wheresystemd-repartadds one on the first boot.- Support for โimage versionsโ has been added โญ. The version number can be set with
--version-number=. It's included in the default output filename and passed as$IMAGE_VERSIONto the build script. In addition,mkosi bumpcan be used to increase the version number by one, and--auto-bumpcan be used to increase it automatically after successful builds. - Support for โimage identifiersโ has been added ๐. The id can be set with
--image=idand is passed to the build script as$IMAGE_ID. - The list of packages to install can be configured with
--base-packages=๐. With--base-packages=no, only packages specified with--packages=will be installed. With--base-packages=conditional, various packages will be installed โconditionallyโ, i.e. only if some other package is otherwise pulled in. For example,systemd-udevmay be installed only ifsystemdis listed in--packages=. - CPIO output format has been added ๐ฅ. This is useful for kernel initramfs images.
- Output compression can be configured with
--compress-fs=and--compress-output=, and support forzstdhas been added. --ssh-key=option was added to control the ssh key used to connect to the image.--remove-files=option was added to remove file from the generated images.- Inline comments are now allowed in config files (anything from
#until the end of the line will be ignored) ๐. - The development branch was renamed from
mastertomain.
๐ธ v9 ๐ธ
๐ Highlighted Changes ๐
- The mkosi Github action now defaults to the current release of mkosi instead of the tip of the
masterbranch. - Add a
sshverb and accompanying--sshoption ๐ซถ. The latter sets up SSH keys for direct SSH access into a booted image, whereas the former can be used to start an SSH connection to the image. - Allow for distribution specific
mkosi.*files in subdirectories ofmkosi.default.d/โจ. These files are only processed if a subdirectory named after the target distribution of the image is found inmkosi.default.d/. - The summary of used options for the image is now only printed when building the image for the first time or when the
summaryverb is used. - All of mkosi's output, except for the build script, will now go to
stderr๐ . There was no clear policy on this before, and this choice makes it easier to use images generated and booted via mkosi with language servers using stdin and stdout for communication. --source-file-transfernow defaults tocopy-git-othersto also include untracked files.blackis now used as a code style and conformance with it is checked in CI.- Add a new
--ephemeraloption to boot into a temporary snapshot of the image that will be thrown away on shutdown ๐. - Add a new option
--network-vethto set up a virtual Ethernet link between the host and the image for usage with nspawn or QEMU ๐. - Add a new
--autologinoption to automatically log into the root account upon boot of the image. This is useful when using mkosi for boot tests. - Add a new
--hostonlyoption to generate host specific initrds. This is useful when using mkosi for boot tests. - Add a new
--install-directoryoption and special directorymkosi.installdir/that will be used as$DESTDIRfor the build script, so that the contents of this directory can be shared between builds ๐. - Add a new
--include-directoryoption and special directorymkosi.includedir/that will be mounted at/usr/includeduring the build ๐ฆ. This way headers files installed during the build can be made available to the host system, which is useful for usage with language servers. - Add a new
--source-file-transfer-finaloption to complement--source-file-transfer. It does the same--source-file-transferdoes for the build image, but for the final one โจ. - Add a new
--tar-strip-selinux-contextoption to remove SELinux xattrs. This is useful when an image with a target distribution not using SELinux is generated on a host that is using it. - Document the
--no-chownoption ๐. Using this option, artifacts generated by mkosi are not chowned to the user invoking mkosi when it is invoked viasudo. It has been with as for a while, but hasn't been documented until now.
๐ฉน Fixed Issues ๐ฉน
#506#559#561#562#575#580#593
๐ Authors ๐
- Daan De Meyer
- Joerg Behrmann
- Luca Boccassi
- Peter Hutterer
- ValdikSS
okay that's a wrap on the whole changelog bestie, you actually read all of it and I'm so proud of you ๐ญ๐ this entire iconic saga lives in mkosi.news(7) โ that's the source and the section it ships under, so go cite it proudly. Periodt. ๐โจ
๐ฆ where this page comes from
- arch rolling: mkosi 27.1-1 ยท LGPL-2.1-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms