Expand description
Β§The baseline installer
This module handles creation of simple root filesystem setups. At the current time
itβs very simple - just a direct filesystem (e.g. xfs, ext4, btrfs etc.). It is
intended to add opinionated handling of TPM2-bound LUKS too. But thatβs about it;
other more complex flows should set things up externally and use bootc install to-filesystem.
StructsΒ§
- Install
Block πDevice Opts - Options for installing to a block device
- Partition
Layout π - Partition numbers resulting from partitioning, used to look up devices after.
- Repart
Partition π - The json output for systemd-repart
EnumsΒ§
- Block
Setup π - Repart
Definitions π - Which repart.d definitions a systemd-repart run reads.
ConstantsΒ§
- ABOOT_
BOOT_ πGUID - ABOOT_
BOOT_ πSIZE_ MB - ABOOT_
VBMETA_ πGUID - ABOOT_
VBMETA_ πSIZE_ MB - BOOTPN_
SIZE_ πMB - CFS_
EFIPN_ πSIZE_ MB - EFI Partition size for composefs installations We need more space than ostree as we have UKIs and UKI addons We might also need to store UKIs for pinned deployments
- EFIPN_
SIZE_ πMB - MIB π
- Bytes per MiB, the unit we pin the generated root partitionβs size in.
- PREPBOOT_
GUID π - PREPBOOT_
LABEL π - REPART_
CONFIG_ πDIRS - The repart.d configuration search directories, in descending priority. A definition present in a higher-priority directory masks a same-named one below it (matching systemdβs own semantics).
- REPART_
INCLUDE_ πPARTITIONS_ MIN_ VERSION - The first systemd version that supports
systemd-repart --include-partitions=. - REPART_
MKFS_ πOPTIONS_ MIN_ VERSION - The first systemd version whose systemd-repart honors the
SYSTEMD_REPART_MKFS_OPTIONS_<FSTYPE>environment variable (used to enable ext4 fs-verity). Older versions silently ignore it. - REPART_
PLANNED_ πSIZE_ DROPIN - The name of the drop-in that pins a definitionβs partition to its planned
size. Drop-ins apply in name order, so the name sorts after those images
usually ship, such as
override.confor10-size.conf. - UKIBOOT_
BOOT_ πGUID - UKIBOOT_
CTL_ πGUID - UKIBOOT_
CTL_ πSIZE_ MB - UKIBOOT_
ESP_ πSIZE_ MB
FunctionsΒ§
- aboot_
partition_ πlabels - aboot_
partition_ πtype - aboot_
repart_ πdefinitions - can_
use_ πsystemd_ repart - collect_
repart_ πdefinitions - Collect the selected repart.d definitions into dest_dir, a fresh directory.
- generated_
root_ πdefinition_ name - A file name for the root partition definition we generate when the imageβs
repart.d definitions have none. systemd-repart lays out partitions in the
order of their definitionsβ names, so it sorts where
50-root.confwould; the random part keeps it from masking a definition of the image, or from being masked by one. - has_
systemd_ πrepart - image_
repart_ πpartitions - install_
create_ πrootfs - mkfs π
- need_
filtered_ πdefinitions - Whether we must emulate
--include-partitions=by pre-filtering the definitions ourselves - parse_
repart_ πlayout - Parse partition layout from systemd-repart JSON output.
- planned_
boot_ πpartition_ sizes - The partitions other than root that a generic imageβs install creates (the ESP and BIOS boot), as the file name of their definition and the size in bytes systemd-repart planned for them with all definitions.
- planned_
root_ πsize_ mib - The size in MiB to pin the root partition we generate to, given a dry run of all definitions in which it has no size limits. systemd-repart gives it the space the other definitions leave, padding included, and shares that by Weight= with any of them that can grow, so the partitions created only on first boot still fit after it. Rounded down to whole MiB.
- planned_
size_ πpin - The repart.d drop-in that pins a partition to
sizebytes. - repart_
partition_ πis_ required - Whether a partition (as reported by systemd-repart) is one we must create even for a generic image: root, ESP or BIOS boot.
- sfdisk π
- Use sfdisk to create partitions
- systemd_
repart π - Create partitions using systemd-repart Assumes we have systemd-repart definitions
- systemd_
repart_ πaboot - systemd_
repart_ πrun - Run systemd-repart on the device and return the parsed JSON output.
dry_run: if true, no changes are written to disk.definitions: which repart.d definitions to read. - udev_
settle π - use_
discoverable_ πpartitions - Check whether DPS auto-discovery is enabled. When
true,root=UUID=is omitted andsystemd-gpt-auto-generatordiscovers the root partition via its DPS type GUID instead. - validate_
aboot_ πrepart_ partitions - validate_
repart_ πboot_ layout - verify_
image_ πaboot_ filesystems - wipefs π
- write_
repart_ πfile - Write the repart.d definition or drop-in
nameintodir, creating parent directories as needed.