Can mkosi replace Kickkstart / Calamares?

Lennart Poettering lennart at poettering.net
Tue Jan 2 14:44:21 UTC 2024


On Mo, 25.12.23 02:39, Patrick Schleizer (patrick-mailinglists at whonix.org) wrote:

> Hi,
>
> I am maintaining a systemd, Debian-based Linux distribution (Kicksecure) and
> am considering moving to mkosi as the "base image creation tool".
>
> It seems mkosi is a fine OS image builder. With systemd-repart, you even
> solved the resizing of partitions at the first boot, which is magic.
>
> Suppose a Linux distribution is providing an OS image that can be written to
> USB. Maybe soon, even to a CD/DVD. [1]
>
> Suppose that OS image is supposed to be able to act as an installer, so the
> user can use it to install it on an internal hard drive.
>
> Is something like Kickstart or Calamares still required? It seems (at least
> Calamares, whose code I am reading) is kind of "yet another OS image
> builder". It doesn't build an image but instead writes to a hard drive.
> However, I find it problematic that a lot of code (creating partition
> tables, creating file systems, making bootable) is duplicated. [2]

I don't really know what Kickstart/Calamares really do.

But it's certainly our intention to allow systemd-repart to operate
like an installer, in the sense that you boot from a USB stick and you
can use systemd-repart to copy the relevant partitions you just booted
from to a target disk very efficiently, which will then be basically
the same OS, just with maybe differently sized data/home partitions,
new uuids, different crypto keys and such.

More specifically, systemd-repart + bootctl install +
systemd-firstboot is supposed to be enough to do what a classic
installer disk can do on traditional OSes.

Note that currently there are still some gaps, but people are workng
on this in various places.

> Do you have any suggestions?
>
> Did you envision replacing installers, or do you already have tools for
> that?

Well, depends on what you mean by "installers". We certainly have no
interest to replace a package-based installer. But we certainly do
want to provide you with basic tools which you can combine into an A/B
image-based OS installer

> [2] But what about installer questions, customization such as time zone,
> keyboard layout? I think the crucial question for an installer is the target
> drive, and that's it. Perhaps partitioning and file system choices, but that
> is more for geeks. How about time zone, keyboard layout? Valid points. But I
> think those would be better handled through a first-boot GUI wizard.

systemd-firstboot is supposed to be just that – but it only covers the
offline and console cases. It's also supposed to be useful as a blueprint
to implement something similar in a graphical tool.

systemd-firstboot can be used in two modes. In "offline" mode, where
you call it from the cmdline and specify --root= or --image= to let it
operate directly on an OS tree you mounted somewhere or on a block
device/image file you have accessible. Or in "online" mode where it is
run at first boot, and asks the user interactively.

systemd-firstboot covers hostname, locale, keyboard, timezone, root pw
currently. In systemd git main you also fine a "homectl firstboot"
command which can prompt the user interactively for a user to create
at boot.

Regarding partitioning: my thinking was that installers would ship
multiple alternative sets of repart .conf files, of which the first
that can be applied is applied or of which the user can pick one
explicitly, depending on the use case. The focus is clearly on
automatic partitioning here though, if people want to manually and
precisely set the sizes of each partition in a UI, then repart is not
the tool they should use.

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list