distribution, or the version of the distribution running on the host
if it matches the configured distribution.
+`Architecture=`, `--architecture=`
+
+: The architecture to build the image for. A number of architectures can
+ be specified, but which ones are actually supported depends on the
+ distribution used and whether a bootable image is requested or not.
+ When building for a foreign architecture, you'll also need to install
+ and register a user mode emulator for that architecture.
+
+ The following architectures can be specified:
+
+ - alpha
+ - arc
+ - arm
+ - arm64
+ - ia64
+ - loongarch64
+ - mips64-le
+ - mips-le
+ - parisc
+ - ppc
+ - ppc64
+ - ppc64-le
+ - riscv32
+ - riscv64
+ - s390
+ - s390x
+ - tilegx
+ - x86
+ - x86-64
+
`Mirror=`, `--mirror=`, `-m`
: The mirror to use for downloading the distribution packages. Expects
: Enable package repositories that are disabled by default. This can be used to enable the EPEL repos for
CentOS or different components of the Debian/Ubuntu repositories.
-`Architecture=`, `--architecture=`
-
-: The architecture to build the image for. A number of architectures can be specified, but which ones are
- actually supported depends on the distribution used and whether a bootable image is requested or not. When
- building for a foreign architecture, you'll also need to install and register a user mode emulator for that
- architecture.
-
- The following architectures can be specified:
+`CacheOnly=`, `--cache-only=`
- - alpha
- - arc
- - arm
- - arm64
- - ia64
- - loongarch64
- - mips64-le
- - mips-le
- - parisc
- - ppc
- - ppc64
- - ppc64-le
- - riscv32
- - riscv64
- - s390
- - s390x
- - tilegx
- - x86
- - x86-64
+: If specified, the package manager is instructed not to contact the
+ network for updating package data. This provides a minimal level of
+ reproducibility, as long as the package cache is already fully
+ populated.
### [Output] Section
in the default name, e.g. a specified image version of `7.8` might
result in an image file name of `image_7.8.raw.xz`.
+`CompressOutput=`, `--compress-output=`
+
+: Configure compression for the resulting image or archive. The
+ argument can be either a boolean or a compression algorithm (`xz`,
+ `zstd`). `xz` compression is used by default. Note that when applied
+ to block device image types this means the image cannot be started
+ directly but needs to be decompressed first. This also means that
+ the `shell`, `boot`, `qemu` verbs are not available when this option
+ is used. Implied for `tar` and `cpio`.
+
`OutputDirectory=`, `--output-dir=`, `-O`
: Path to a directory where to place all generated artifacts. If this is
is automatically used for this purpose (also see the "Files" section
below).
-`UseSubvolumes=`, `--use-subvolumes=`
-
-: Takes a boolean or `auto`. Enables or disables use of btrfs subvolumes for
- directory tree outputs. If enabled, mkosi will create the root directory as
- a btrfs subvolume and use btrfs subvolume snapshots where possible to copy
- base or cached trees which is much faster than doing a recursive copy. If
- explicitly enabled and `btrfs` is not installed or subvolumes cannot be
- created, an error is raised. If `auto`, missing `btrfs` or failures to
- create subvolumes are ignored.
-
-`CompressOutput=`, `--compress-output=`
-
-: Configure compression for the resulting image or archive. The
- argument can be either a boolean or a compression algorithm (`xz`,
- `zstd`). `xz` compression is used by default. Note that when applied
- to block device image types this means the image cannot be started
- directly but needs to be decompressed first. This also means that
- the `shell`, `boot`, `qemu` verbs are not available when this option
- is used. Implied for `tar` and `cpio`.
-
`ImageVersion=`, `--image-version=`
: Configure the image version. This accepts any string, but it is
https://uapi-group.org/specifications/specs/extension_image for more
information.
+`UseSubvolumes=`, `--use-subvolumes=`
+
+: Takes a boolean or `auto`. Enables or disables use of btrfs subvolumes for
+ directory tree outputs. If enabled, mkosi will create the root directory as
+ a btrfs subvolume and use btrfs subvolume snapshots where possible to copy
+ base or cached trees which is much faster than doing a recursive copy. If
+ explicitly enabled and `btrfs` is not installed or subvolumes cannot be
+ created, an error is raised. If `auto`, missing `btrfs` or failures to
+ create subvolumes are ignored.
+
### [Content] Section
`Packages=`, `--package=`, `-p`
in the "Development Tools" group, and the package that contains the
`mypy` python module.
+`BuildPackages=`, `--build-package=`
+
+: Similar to `Packages=`, but configures packages to install only in an
+ overlay that is made available on top of the image to the prepare
+ script when executed with the `build` argument and the build script.
+ This option should be used to list packages containing header files,
+ compilers, build systems, linkers and other build tools the
+ `mkosi.build` script requires to operate. Note that packages listed
+ here will be absent in the final image.
+
`WithDocs=`, `--with-docs`
: Include documentation in the image built. By default if the
variable passed to the `mkosi.build` script indicates whether this
option was used or not.
-`WithTests=`, `--without-tests`, `-T`
-
-: If set to false (or when the command-line option is used), the
- `$WITH_TESTS` environment variable is set to `0` when the
- `mkosi.build` script is invoked. This is supposed to be used by the
- build script to bypass any unit or integration tests that are
- normally run during the source build process. Note that this option
- has no effect unless the `mkosi.build` build script honors it.
-
-`Bootable=`, `--bootable=`
-
-: Takes a boolean or `auto`. Enables or disables generation of a bootable
- image. If enabled, mkosi will install systemd-boot, and add an ESP partition
- when the disk image output is used. If systemd-boot is not installed or no
- kernel images can be found, the build will fail. `auto` behaves as if the
- option was enabled, but the build won't fail if either no kernel images or
- systemd-boot can't be found. If disabled, systemd-boot won't be installed even
- if found inside the image, no unified kernel images will be generated and no
- ESP partition will be added to the image if the disk output format is used.
-
-`KernelCommandLine=`, `--kernel-command-line=`
-
-: Use the specified kernel command line when building images.
-
`BaseTrees=`, `--base-tree=`
: Takes a colon separated pair of directories to use as base images. When
file may be provided too. `mkosi.extra.tar` will be automatically
used if found in the local directory.
-`CleanPackageMetadata=`, `--clean-package-metadata=`
+`RemovePackages=`, `--remove-package=`
-: Enable/disable removal of package manager databases at the end of
- installation. Can be specified as true, false, or "`auto`" (the
- default). With "`auto`", files will be removed if the respective
- package manager executable is *not* present at the end of the
- installation.
+: Takes a comma-separated list of package specifications for removal, in
+ the same format as `Packages=`. The removal will be performed as one
+ of the last steps. This step is skipped if `CleanPackageMetadata=no`
+ is used.
`RemoveFiles=`, `--remove-files=`
: Takes a comma-separated list of globs. Files in the image matching
the globs will be purged at the end.
-`RemovePackages=`, `--remove-package=`
-
-: Takes a comma-separated list of package specifications for removal, in the
- same format as `Packages=`. The removal will be performed as one of the last
- steps. This step is skipped if `CleanPackageMetadata=no` is used.
-
-: This option is currently only implemented for distributions using `dnf`.
-
-`Environment=`, `--environment=`
-
-: Adds variables to the environment that package managers and the
- prepare/build/postinstall/finalize scripts are executed with. Takes
- a space-separated list of variable assignments or just variable
- names. In the latter case, the values of those variables will be
- passed through from the environment in which `mkosi` was invoked.
- This option may be specified more than once, in which case all
- listed variables will be set. If the same variable is set twice, the
- later setting overrides the earlier one.
-
-`BuildSources=`, `--build-sources=`
-
-: Takes a list of colon-separated pairs of paths to source trees and where to mount them in the development
- image, if the build script is used. Every target path is prefixed with `/work/src` and all build sources
- are sorted lexicographically by mount target before mounting so that top level paths are mounted first. By
- default, the current working directory is mounted to `/work/src`.
-
-`BuildPackages=`, `--build-package=`
+`CleanPackageMetadata=`, `--clean-package-metadata=`
-: Similar to `Packages=`, but configures packages to install only in an
- overlay that is made available on top of the image to the prepare
- script when executed with the `build` argument and the build script.
- This option should be used to list packages containing header files,
- compilers, build systems, linkers and other build tools the
- `mkosi.build` script requires to operate. Note that packages listed
- here will be absent in the final image.
+: Enable/disable removal of package manager databases at the end of
+ installation. Can be specified as true, false, or "`auto`" (the
+ default). With "`auto`", files will be removed if the respective
+ package manager executable is *not* present at the end of the
+ installation.
-`Autologin=`, `--autologin`
+`PrepareScript=`, `--prepare-script=`
-: Enable autologin for the `root` user on `/dev/pts/0` (nspawn),
- `/dev/tty1` and `/dev/ttyS0`.
+: Takes a path to an executable that is used as the prepare script for
+ this image. See the `SCRIPTS` section for more information.
`BuildScript=`, `--build-script=`
: Takes a path to an executable that is used as build script for this
image. See the `SCRIPTS` section for more information.
-`PrepareScript=`, `--prepare-script=`
-
-: Takes a path to an executable that is used as the prepare script for
- this image. See the `SCRIPTS` section for more information.
-
`PostInstallationScript=`, `--postinst-script=`
: Takes a path to an executable that is used as the post-installation
: Takes a path to an executable that is used as the finalize script for
this image. See the `SCRIPTS` section for more information.
+`BuildSources=`, `--build-sources=`
+
+: Takes a list of colon-separated pairs of paths to source trees and
+ where to mount them in the development image, if the build script is
+ used. Every target path is prefixed with `/work/src` and all build
+ sources are sorted lexicographically by mount target before mounting
+ so that top level paths are mounted first. By default, the current
+ working directory is mounted to `/work/src`.
+
+`Environment=`, `--environment=`
+
+: Adds variables to the environment that package managers and the
+ prepare/build/postinstall/finalize scripts are executed with. Takes
+ a space-separated list of variable assignments or just variable
+ names. In the latter case, the values of those variables will be
+ passed through from the environment in which `mkosi` was invoked.
+ This option may be specified more than once, in which case all
+ listed variables will be set. If the same variable is set twice, the
+ later setting overrides the earlier one.
+
+`WithTests=`, `--without-tests`, `-T`
+
+: If set to false (or when the command-line option is used), the
+ `$WITH_TESTS` environment variable is set to `0` when the
+ `mkosi.build` script is invoked. This is supposed to be used by the
+ build script to bypass any unit or integration tests that are
+ normally run during the source build process. Note that this option
+ has no effect unless the `mkosi.build` build script honors it.
+
`WithNetwork=`, `--with-network=`
: When true, enables network connectivity while the build script
passed to the `mkosi.build` build script indicating whether the
build is done with or without network.
-`CacheOnly=`, `--cache-only=`
+`Bootable=`, `--bootable=`
-: If specified, the package manager is instructed not to contact the
- network for updating package data. This provides a minimal level of
- reproducibility, as long as the package cache is already fully
- populated.
+: Takes a boolean or `auto`. Enables or disables generation of a
+ bootable image. If enabled, mkosi will install systemd-boot, and add
+ an ESP partition when the disk image output is used. If systemd-boot
+ is not installed or no kernel images can be found, the build will
+ fail. `auto` behaves as if the option was enabled, but the build won't
+ fail if either no kernel images or systemd-boot can't be found. If
+ disabled, systemd-boot won't be installed even if found inside the
+ image, no unified kernel images will be generated and no ESP partition
+ will be added to the image if the disk output format is used.
-`Initrd=`, `--initrd`
+`Initrds=`, `--initrd`
-: Use user-provided initrd(s). Takes a comma separated list of paths to initrd
- files. This option may be used multiple times in which case the initrd lists
- are combined.
+: Use user-provided initrd(s). Takes a comma separated list of paths to
+ initrd files. This option may be used multiple times in which case the
+ initrd lists are combined.
-`MakeInitrd=`, `--make-initrd`
+`KernelCommandLine=`, `--kernel-command-line=`
-: Add `/etc/initrd-release` and `/init` to the image so that it can be
- used as an initramfs.
+: Use the specified kernel command line when building images.
`KernelModulesInclude=`, `--kernel-modules-include=`
as an already hashed root password. The root password is also stored in `/usr/lib/credstore` under the
appropriate systemd credential so that it applies even if only `/usr` is shipped in the image.
+`Autologin=`, `--autologin`
+
+: Enable autologin for the `root` user on `/dev/pts/0` (nspawn),
+ `/dev/tty1` and `/dev/ttyS0`.
+
+`MakeInitrd=`, `--make-initrd`
+
+: Add `/etc/initrd-release` and `/init` to the image so that it can be
+ used as an initramfs.
+
+`Ssh=`, `--ssh`
+
+: If specified, an sshd socket unit and matching service are installed
+ in the final image that expose SSH over VSock. When building with this
+ option and running the image using `mkosi qemu`, the `mkosi ssh`
+ command can be used to connect to the container/VM via SSH. Note that
+ you still have to make sure openssh is installed in the image to make
+ this option behave correctly. mkosi will automatically provision the
+ user's public SSH key into the image using the
+ `ssh.authorized_keys.root` credential if it can be retrieved from a
+ running SSH agent. To access images booted using `mkosi boot`, use
+ `machinectl`.
+
### [Validation] Section
`SecureBoot=`, `--secure-boot`
which is the default, which is equal to a true value if the
`systemd-measure` binary is in `PATH`.
+`Passphrase=`, `--passphrase`
+
+: Specify the path to a file containing the passphrase to use for LUKS
+ encryption. It should contain the passphrase literally, and not end in
+ a newline character (i.e. in the same format as cryptsetup and
+ `/etc/crypttab` expect the passphrase files). The file must have an
+ access mode of 0600 or less.
+
`Checksum=`, `--checksum`
: Generate a `SHA256SUMS` file of all generated artifacts after the
temporary snapshot is more efficient on file systems that support reflinks natively ("btrfs" or new "xfs")
than on more traditional file systems that do not ("ext4").
-`Ssh=`, `--ssh`
-
-: If specified, an sshd socket unit and matching service are installed
- in the final image that expose SSH over VSock. When building with this
- option and running the image using `mkosi qemu`, the `mkosi ssh`
- command can be used to connect to the container/VM via SSH. Note that
- you still have to make sure openssh is installed in the image to make
- this option behave correctly. mkosi will automatically provision the
- user's public SSH key into the image using the
- `ssh.authorized_keys.root` credential if it can be retrieved from a
- running SSH agent. To access images booted using `mkosi boot`, use
- `machinectl`.
-
`Credentials=`, `--credential=`
: Set credentials to be passed to systemd-nspawn or qemu respectively when
import subprocess
import sys
import textwrap
-from collections.abc import Sequence
+from collections.abc import Iterable, Sequence
from itertools import takewhile
from pathlib import Path
from typing import Any, Callable, Optional, Type, Union, cast
parse=config_make_list_parser(delimiter=","),
help="Repositories to use",
),
+ MkosiConfigSetting(
+ dest="cache_only",
+ metavar="BOOL",
+ section="Distribution",
+ parse=config_parse_boolean,
+ help="Only use the package cache when installing packages",
+ ),
MkosiConfigSetting(
dest="output_format",
parse=config_parse_filename,
help="Output name",
),
+ MkosiConfigSetting(
+ dest="compress_output",
+ metavar="ALG",
+ nargs="?",
+ section="Output",
+ parse=config_parse_compression,
+ help="Enable whole-output compression (with images or archives)",
+ ),
MkosiConfigSetting(
dest="output_dir",
short="-O",
paths=("mkosi.builddir",),
help="Path to use as persistent build directory",
),
- MkosiConfigSetting(
- dest="compress_output",
- metavar="ALG",
- nargs="?",
- section="Output",
- parse=config_parse_compression,
- help="Enable whole-output compression (with images or archives)",
- ),
MkosiConfigSetting(
dest="image_version",
match=config_match_image_version,
help="Add an additional package to the OS image",
),
MkosiConfigSetting(
- dest="remove_packages",
- long="--remove-package",
+ dest="build_packages",
+ long="--build-package",
metavar="PACKAGE",
section="Content",
parse=config_make_list_parser(delimiter=","),
- help="Remove package from the image OS image after installation",
+ help="Additional packages needed for build script",
),
MkosiConfigSetting(
dest="with_docs",
parse=config_parse_boolean,
help="Install documentation",
),
- MkosiConfigSetting(
- dest="with_tests",
- short="-T",
- long="--without-tests",
- nargs="?",
- const="no",
- section="Content",
- parse=config_parse_boolean,
- default=True,
- help="Do not run tests as part of build script, if supported",
- ),
- MkosiConfigSetting(
- dest="kernel_command_line",
- metavar="OPTIONS",
- section="Content",
- parse=config_make_list_parser(delimiter=" "),
- default=["console=ttyS0"],
- help="Set the kernel command line (only bootable images)",
- ),
- MkosiConfigSetting(
- dest="bootable",
- metavar="FEATURE",
- nargs="?",
- section="Content",
- parse=config_parse_feature,
- match=config_match_feature,
- help="Generate ESP partition with systemd-boot and UKIs for installed kernels",
- ),
- MkosiConfigSetting(
- dest="autologin",
- metavar="BOOL",
- nargs="?",
- section="Content",
- parse=config_parse_boolean,
- help="Enable root autologin",
- ),
MkosiConfigSetting(
dest="base_trees",
long='--base-tree',
parse=config_make_list_parser(delimiter=",", parse=make_path_parser(required=False)),
help='Use the given tree as base tree (e.g. lower sysext layer)',
),
- MkosiConfigSetting(
- dest="extra_trees",
- long="--extra-tree",
- metavar="PATH",
- section="Content",
- parse=config_make_list_parser(delimiter=",", parse=make_source_target_paths_parser()),
- paths=("mkosi.extra", "mkosi.extra.tar"),
- help="Copy an extra tree on top of image",
- ),
MkosiConfigSetting(
dest="skeleton_trees",
long="--skeleton-tree",
help="Use a package manager tree to configure the package manager",
),
MkosiConfigSetting(
- dest="clean_package_metadata",
- metavar="FEATURE",
+ dest="extra_trees",
+ long="--extra-tree",
+ metavar="PATH",
section="Content",
- parse=config_parse_feature,
- help="Remove package manager database and other files",
+ parse=config_make_list_parser(delimiter=",", parse=make_source_target_paths_parser()),
+ paths=("mkosi.extra", "mkosi.extra.tar"),
+ help="Copy an extra tree on top of image",
+ ),
+ MkosiConfigSetting(
+ dest="remove_packages",
+ long="--remove-package",
+ metavar="PACKAGE",
+ section="Content",
+ parse=config_make_list_parser(delimiter=","),
+ help="Remove package from the image OS image after installation",
),
MkosiConfigSetting(
dest="remove_files",
help="Remove files from built image",
),
MkosiConfigSetting(
- dest="environment",
- short="-E",
- metavar="NAME[=VALUE]",
+ dest="clean_package_metadata",
+ metavar="FEATURE",
section="Content",
- parse=config_make_list_parser(delimiter=" ", unescape=True),
- help="Set an environment variable when running scripts",
+ parse=config_parse_feature,
+ help="Remove package manager database and other files",
),
MkosiConfigSetting(
- dest="build_sources",
+ dest="prepare_script",
metavar="PATH",
section="Content",
- parse=config_make_list_parser(delimiter=",", parse=make_source_target_paths_parser(absolute=False)),
- help="Path for sources to build",
- ),
- MkosiConfigSetting(
- dest="build_packages",
- long="--build-package",
- metavar="PACKAGE",
- section="Content",
- parse=config_make_list_parser(delimiter=","),
- help="Additional packages needed for build script",
+ parse=config_parse_script,
+ paths=("mkosi.prepare",),
+ help="Prepare script to run inside the image before it is cached",
),
MkosiConfigSetting(
dest="build_script",
paths=("mkosi.build",),
help="Build script to run inside image",
),
- MkosiConfigSetting(
- dest="prepare_script",
- metavar="PATH",
- section="Content",
- parse=config_parse_script,
- paths=("mkosi.prepare",),
- help="Prepare script to run inside the image before it is cached",
- ),
MkosiConfigSetting(
dest="postinst_script",
metavar="PATH",
paths=("mkosi.finalize",),
help="Postinstall script to run outside image",
),
+ MkosiConfigSetting(
+ dest="build_sources",
+ metavar="PATH",
+ section="Content",
+ parse=config_make_list_parser(delimiter=",", parse=make_source_target_paths_parser(absolute=False)),
+ help="Path for sources to build",
+ ),
+ MkosiConfigSetting(
+ dest="environment",
+ short="-E",
+ metavar="NAME[=VALUE]",
+ section="Content",
+ parse=config_make_list_parser(delimiter=" ", unescape=True),
+ help="Set an environment variable when running scripts",
+ ),
+ MkosiConfigSetting(
+ dest="with_tests",
+ short="-T",
+ long="--without-tests",
+ nargs="?",
+ const="no",
+ section="Content",
+ parse=config_parse_boolean,
+ default=True,
+ help="Do not run tests as part of build script, if supported",
+ ),
MkosiConfigSetting(
dest="with_network",
metavar="BOOL",
help="Run build and postinst scripts with network access (instead of private network)",
),
MkosiConfigSetting(
- dest="cache_only",
- metavar="BOOL",
+ dest="bootable",
+ metavar="FEATURE",
+ nargs="?",
section="Content",
- parse=config_parse_boolean,
- help="Only use the package cache when installing packages",
+ parse=config_parse_feature,
+ match=config_match_feature,
+ help="Generate ESP partition with systemd-boot and UKIs for installed kernels",
),
MkosiConfigSetting(
dest="initrds",
help="Add a user-provided initrd to image",
),
MkosiConfigSetting(
- dest="make_initrd",
- metavar="BOOL",
- nargs="?",
+ dest="kernel_command_line",
+ metavar="OPTIONS",
section="Content",
- parse=config_parse_boolean,
- help="Make sure the image can be used as an initramfs",
+ parse=config_make_list_parser(delimiter=" "),
+ default=["console=ttyS0"],
+ help="Set the kernel command line (only bootable images)",
),
MkosiConfigSetting(
dest="kernel_modules_include",
parse=config_parse_string,
help="Set the shell for root",
),
+ MkosiConfigSetting(
+ dest="autologin",
+ metavar="BOOL",
+ nargs="?",
+ section="Content",
+ parse=config_parse_boolean,
+ help="Enable root autologin",
+ ),
+ MkosiConfigSetting(
+ dest="make_initrd",
+ metavar="BOOL",
+ nargs="?",
+ section="Content",
+ parse=config_parse_boolean,
+ help="Make sure the image can be used as an initramfs",
+ ),
+ MkosiConfigSetting(
+ dest="ssh",
+ metavar="BOOL",
+ nargs="?",
+ section="Content",
+ parse=config_parse_boolean,
+ help="Set up SSH access from the host to the final image via 'mkosi ssh'",
+ ),
MkosiConfigSetting(
dest="secure_boot",
'image that is removed immediately when the container/VM terminates'),
nargs="?",
),
- MkosiConfigSetting(
- dest="ssh",
- metavar="BOOL",
- nargs="?",
- section="Host",
- parse=config_parse_boolean,
- help="Set up SSH access from the host to the final image via 'mkosi ssh'",
- ),
MkosiConfigSetting(
dest="credentials",
long="--credential",
return "default" if s is None else str(s)
-def line_join_list(array: Sequence[PathString]) -> str:
+def line_join_list(array: Iterable[PathString]) -> str:
if not array:
return "none"
{bold(f"PRESET: {config.preset or 'default'}")}
{bold("COMMANDS")}:
- verb: {bold(args.verb)}
- cmdline: {bold(" ".join(args.cmdline))}
+ Verb: {bold(args.verb)}
+ Cmdline: {bold(" ".join(args.cmdline))}
{bold("DISTRIBUTION")}:
- Distribution: {bold(config.distribution.name)}
+ Distribution: {bold(config.distribution)}
Release: {bold(none_to_na(config.release))}
Architecture: {config.architecture}
Mirror: {none_to_default(config.mirror)}
Local Mirror (build): {none_to_none(config.local_mirror)}
Repo Signature/Key check: {yes_no(config.repository_key_check)}
- Repositories: {",".join(config.repositories)}
+ Repositories: {line_join_list(config.repositories)}
+ Use Only Package Cache: {yes_no(config.cache_only)}
{bold("OUTPUT")}:
- Image ID: {config.image_id}
- Image Version: {config.image_version}
- Output Format: {config.output_format.name}
+ Output Format: {config.output_format}
Manifest Formats: {maniformats}
+ Output: {bold(config.output_with_compression)}
+ Compression: {config.compress_output}
Output Directory: {none_to_default(config.output_dir)}
Workspace Directory: {none_to_default(config.workspace_dir)}
Cache Directory: {none_to_none(config.cache_dir)}
Build Directory: {none_to_none(config.build_dir)}
+ Image ID: {config.image_id}
+ Image Version: {config.image_version}
+ Split Artifacts: {yes_no(config.split_artifacts)}
Repart Directories: {line_join_list(config.repart_dirs)}
- Output: {bold(config.output_with_compression)}
- Output Checksum: {none_to_na(config.output_checksum if config.checksum else None)}
- Output Signature: {none_to_na(config.output_signature if config.sign else None)}
- Output nspawn Settings: {none_to_na(config.output_nspawn_settings if config.nspawn_settings is not None else None)}
- Compression: {config.compress_output.name}
+ Overlay: {yes_no(config.overlay)}
+ Use Subvolumes: {yes_no_auto(config.use_subvolumes)}
{bold("CONTENT")}:
Packages: {line_join_list(config.packages)}
+ Build Packages: {line_join_list(config.build_packages)}
With Documentation: {yes_no(config.with_docs)}
+
+ Base Trees: {line_join_list(config.base_trees)}
Skeleton Trees: {line_join_source_target_list(config.skeleton_trees)}
Package Manager Trees: {line_join_source_target_list(config.package_manager_trees)}
Extra Trees: {line_join_source_target_list(config.extra_trees)}
- Clean Package Metadata: {yes_no_auto(config.clean_package_metadata)}
- Remove Files: {line_join_list(config.remove_files)}
+
Remove Packages: {line_join_list(config.remove_packages)}
- Build Sources: {line_join_source_target_list(config.build_sources)}
- Build Packages: {line_join_list(config.build_packages)}
+ Remove Files: {line_join_list(config.remove_files)}
+Clean Package Manager Metadata: {yes_no_auto(config.clean_package_metadata)}
+
+ Prepare Script: {none_to_none(config.prepare_script)}
Build Script: {none_to_none(config.build_script)}
- Run Tests in Build Script: {yes_no(config.with_tests)}
Postinstall Script: {none_to_none(config.postinst_script)}
- Prepare Script: {none_to_none(config.prepare_script)}
Finalize Script: {none_to_none(config.finalize_script)}
+ Build Sources: {line_join_source_target_list(config.build_sources)}
Script Environment: {line_join_list(env)}
- Scripts with network: {yes_no(config.with_network)}
+ Run Tests in Build Script: {yes_no(config.with_tests)}
+ Scripts With Network: {yes_no(config.with_network)}
+
Bootable: {yes_no_auto(config.bootable)}
- Kernel Command Line: {" ".join(config.kernel_command_line)}
- Initrds: {",".join(os.fspath(p) for p in config.initrds)}
+ Initrds: {line_join_list(config.initrds)}
+ Kernel Command Line: {line_join_list(config.kernel_command_line)}
+ Kernel Modules Include: {line_join_list(config.kernel_modules_include)}
+ Kernel Modules Exclude: {line_join_list(config.kernel_modules_exclude)}
+
+ Kernel Modules Initrd: {yes_no(config.kernel_modules_initrd)}
+ Kernel Modules Initrd Include: {line_join_list(config.kernel_modules_initrd_include)}
+ Kernel Modules Initrd Exclude: {line_join_list(config.kernel_modules_initrd_include)}
+
Locale: {none_to_default(config.locale)}
Locale Messages: {none_to_default(config.locale_messages)}
Keymap: {none_to_default(config.keymap)}
Hostname: {none_to_default(config.hostname)}
Root Password: {("(set)" if config.root_password else "(default)")}
Root Shell: {none_to_default(config.root_shell)}
- Autologin: {yes_no(config.autologin)}
- {bold("HOST CONFIGURATION")}:
- Incremental: {yes_no(config.incremental)}
- NSpawn Settings: {none_to_none(config.nspawn_settings)}
- Extra search paths: {line_join_list(config.extra_search_paths)}
- QEMU Extra Arguments: {line_join_list(config.qemu_args)}
- Extra Kernel Command Line: {line_join_list(config.kernel_command_line_extra)}
+ Autologin: {yes_no(config.autologin)}
+ Make Initrd: {yes_no(config.make_initrd)}
+ SSH: {yes_no(config.ssh)}
"""
if config.output_format == OutputFormat.disk:
SecureBoot Sign Tool: {config.secure_boot_sign_tool}
Verity Signing Key: {none_to_none(config.verity_key)}
Verity Certificate: {none_to_none(config.verity_certificate)}
+ Sign Expected PCRs: {yes_no_auto(config.sign_expected_pcr)}
+ Passphrase: {none_to_none(config.passphrase)}
Checksum: {yes_no(config.checksum)}
Sign: {yes_no(config.sign)}
GPG Key: ({"default" if config.key is None else config.key})
"""
+ summary += f"""\
+
+ {bold("HOST CONFIGURATION")}:
+ Incremental: {yes_no(config.incremental)}
+ NSpawn Settings: {none_to_none(config.nspawn_settings)}
+ Extra search paths: {line_join_list(config.extra_search_paths)}
+ QEMU GUI: {yes_no(config.qemu_gui)}
+ QEMU CPU Cores: {config.qemu_smp}
+ QEMU Memory: {config.qemu_mem}
+ QEMU Use KVM: {config.qemu_kvm}
+ QEMU Use VSock: {config.qemu_vsock}
+ QEMU Use Swtpm: {config.qemu_swtpm}
+ QEMU Extra Arguments: {line_join_list(config.qemu_args)}
+ Ephemeral: {config.ephemeral}
+ Credentials: {line_join_list(config.credentials.keys())}
+ Extra Kernel Command Line: {line_join_list(config.kernel_command_line_extra)}
+ Use ACLs: {config.acl}
+ Tools Tree: {config.tools_tree}
+"""
+
return summary