For example, the command we used above can be written down in a
configuration file `mkosi.conf`:
-```conf
+```ini
[Distribution]
Distribution=arch
only install a specific package on Arch Linux, you can write the
following to `mkosi.conf.d/10-arch.conf`:
-```conf
+```ini
[Match]
Distribution=arch
We start by creating a temporary directory with a base configuration
file `mkosi.conf` with some shared settings:
-```conf
+```ini
[Output]
OutputDirectory=mkosi.output
CacheDirectory=mkosi.cache
Now let's continue with the base image definition by writing the
following to `mkosi.images/base/mkosi.conf`:
-```conf
+```ini
[Output]
Format=directory
Now that we have our base image, we can define a sysext that builds on
top of it by writing the following to `mkosi.images/btrfs/mkosi.conf`:
-```conf
+```ini
[Config]
Dependencies=base
when running mkosi scripts by using the `BuildSources=` setting. For
example, in `mkosi.local.conf`, we could have the following settings:
-```conf
+```ini
[Build]
BuildSources=../mkosi:mkosi
../fedora/mkosi:mkosi/rpm
make sure they're available inside the image by adding the following to
`mkosi.conf`:
-```conf
+```ini
[Content]
Packages=rpm-build
# If you don't want rpm-build in the final image.
Building an image with a mkosi-built initrd is a two step process, because you will build two images - the initrd and your distribution image.
1. Build an initrd image using the `cpio` output format with the same target distributions as you want to use for your distribution image. mkosi compresses the `cpio` output format by default.
-```conf
+```ini
[Output]
Format=cpio
First of all, to build a disk image with a verity protected root
partition, put the following in mkosi.repart:
-```conf
+```ini
# mkosi.repart/00-esp.conf
[Partition]
Type=esp
initrd with `mkosi.images` where we customize systemd-repart to behave
like this:
-```conf
+```ini
# mkosi.images/initrd/mkosi.conf
[Include]
Include=mkosi-initrd
To use the initrd in the top level image, add the following to
mkosi.conf:
-```conf
+```ini
[Content]
Initrds=%O/initrd
```
definitions from mkosi.repart in a reduced form solely for matching the
existing partitions:
-```conf
+```ini
# mkosi.extra/usr/lib/repart.d/00-esp.conf
[Partition]
Type=esp
example definitions here. These are all missing a `[Source]` section
whose contents will depend on how updates are deployed:
-```conf
+```ini
# /usr/lib/sysupdate.d/10-root-verity-sig.conf
[Transfer]
ProtectVersion=%A
Start by creating a temporary directory with a base configuration file
`mkosi.conf` with some shared settings:
-```conf
+```ini
[Output]
OutputDirectory=mkosi.output
CacheDirectory=mkosi.cache
Now let's continue with the base image definition by writing the
following to `mkosi.images/base/mkosi.conf`:
-```conf
+```ini
[Output]
Format=directory
Now that we have our base image, we can define a sysext that builds on
top of it by writing the following to `mkosi.images/btrfs/mkosi.conf`:
-```conf
+```ini
[Config]
Dependencies=base
in another format, for example an initrd, we can do that by adding the
following to `mkosi.conf`:
-```conf
+```ini
[Output]
Format=cpio
Output=initrd