Distro-to-Order Component Overview¶
Overview¶
The eLxr distro to order (D2O) feature implements the mkosi (Make Operating System Image) tool to help you build your own custom images with the eLxr d2o-tool. eLxr builds on the stock mkosi functionality to provide pre-defined profiles and image configurations as described in this topic.
The tool requires the d2o-tool repository to work, and be set up by building the podman localhost/d2o container image as described in Setting Up Your Development Environment for Distro-to-Order Image Builds. Once complete, the following directories and files comprise your image configuration customizations.
Image Customization Files¶
variants/elxr-core.yml Image Recipe
This recipe file defines the components that comprise the image, such as the name, version, and release, as well as modules, which provide pre-defined configuration options based on the image requirements. Its contents include:
$ cat variants/elxr-core.yml
---
name: elxr
description: "An example d2o configuration file"
version: "26.04.02-core"
image:
distro: elxr
release: bianca
modules:
# Core profile that contains common configuration and packages
- name: core
type: profile
options:
include:
- shared/profile/core
# Base package list that is common across different artifacts
- name: base
id: image
options:
include:
- shared/image/base
# Default initrd
- name: initrd
id: image
options:
include:
- shared/image/initrd
The required settings include:
name: The image name. The d2o-tool will use this to define the image name in the build output and /etc/os-release file.
description: A short image description
version: The image version. If the version is not specified then D2O will assume that you are creating a snapshot version and use the “+%Y%m%d%H%M%S” format. Similar to the name setting above, the d2o-tool will use this to define the image name.
profile, image: base, and image: initrd modules. Each of these modules use an include option to specify the location of the mkosi.conf file, which defines the image customizations specific to the profile type.
Optional settings include
- image:
distro: Must be elxr
release: May be elxr or debian
genkey: True or False. If set to True the image build will create a custom Secure Boot key specific to the build. It set to False, default Microsoft boot keys will be used.
Note
Use False for development purposes only, or when you deploy images separate and set up keys independent of the build process.
Shared mkosi.conf Files
The image recipe file specifies three mkosi.conf files that define your base image, based on the type of customization. For examples of the default files in this section, see These include:
shared/profile/core/mkosi.conf
This file specifies the main image profile, which is a template for the core image type. Future releases will include additional profile types that you can use to create different image types.
shared/image/base/mkosi.conf
This file specifies the list of default packages to use. To include a package from the eLxr package repository, add it to this this file.
shared/image/initrd/mkosi.conf
This file sets the dependencies, root password, essential packages, and kernel command line options.
Output Image Name and Location¶
Once an image build completes, the output image components reside in the build/d2o-workspace/mkosi.output directory. The default image, with no customization, is named elxr_26.04.02-core.raw. Using this, and the configuration example above, you can see that the image name derives from the following settings:
Image name: elxr _ 26.04.02 - core
Config setting: name _ version - profile
Image Build Components and Recipes¶
D2O uses just to run recipes for building and deploying system images. The main build recipes include:
d2o-tool/Containerfile
Specifies which packages to install to the initial eLxr container from Docker Hub, which comprises the base container for the localhost/d2o podman build container.
d2o-tool/Justfile
Comprises the main recipe for all image builds and deployments.