Hello!
I am currently using Mender as a deployment platform for a small fleet of robots running on x86 computers (HX401). These robots currently run Ubuntu 20.04 with ROS2 Foxy.
To create the OS image they are using, I followed the recommended workflow outlined in the Mender documentation. This involves creating a “golden image” by installing the OS, booting the device, logging in, and making runtime modifications (e.g., installing packages, changing configurations) to generate the Mender Artifact.
I have noticed that this process is not ideal. This issue is also highlighted in this Mender Hub post, where @krystof states:
The recommended workflow for golden images suggests manually booting the device, logging in, and making all modifications. This is time-consuming, error-prone, and unsuitable for CI/CD.
I completely agree with this!
This comment prompted me to explore whether I could use mkosi
to create an image compatible with my platform while still supporting Mender.
I quickly discovered that this is a relatively niche area with limited information available online. While there are some snippets and mentions of using mkosi
on forums, there are no concrete, up-to-date examples demonstrating compatibility with the latest versions of these tools. Many configurations I found are outdated and no longer work.
For completeness, here is a list of all the sources I referenced in my research (these might help others in the future):
I attempted the following mkosi.config
to see if I could get it to build an image:
[Distribution]
Distribution=ubuntu
Release=focal
Repositories=universe
[Build]
WithNetwork=True
[Content]
Packages=
linux-image-generic-hwe-20.04
systemd
udev
grub-efi-amd64
sudo
Bootable=yes
Bootloader=grub
BiosBootloader=grub
[Output]
Format=disk
However, I encountered numerous errors during the process.
This experience has highlighted that I am out of my depth in figuring out how to get started with mkosi
as an alternative to manual golden image creation. Even experimenting with it has been challenging.
If someone could assist me (and likely others who come across this in the future), I would appreciate answers to the following:
- What configuration is needed to create an OS image (just Ubuntu 20.04 would already be enough!) that I can use with
dd
to flash onto the SSD of my target platform? Is any additional conversion required to make the output ofmkosi
usable withdd
? - What considerations are necessary to ensure this image is also compatible with Mender?