Skip to content

Various refactoring - #312

Merged
martinpitt merged 5 commits into
amutable-systems:mainfrom
daandemeyer:push-tunsmrrzlsyw
Oct 16, 2026
Merged

martinpitt merged 5 commits into
amutable-systems:mainfrom
daandemeyer:push-tunsmrrzlsyw

Conversation

@daandemeyer

Copy link
Copy Markdown
Member

No description provided.

kmod.py binds libkmod to select kernel modules. It depends on nothing else in
image, and it has its own test and its own default pattern list. Let's move
kmod.py, kmod_test.py and initrd_modules.toml into a kmod package with its own
library and test targets.

Signed-off-by: Daan De Meyer <[email protected]>
image.repart builds a DDI, a GPT disk image, from partition definitions, and
image.bootable_disk builds its disk through the same declaration function. The
rule, its provider and its driver are named after systemd-repart, the tool
they run, rather than after what they build. Let's rename image.repart() to
image.ddi(), RepartInfo to DdiInfo, disk.bzl to ddi.bzl and disk.py to ddi.py.
No partition UUID or digest changes.

Signed-off-by: Daan De Meyer <[email protected]>
image_format loads ImageInfo, the action helpers and the signing attributes
from image, and image loads every rule from image_format. The two packages
therefore don't form layers. The boot artifact rules are in image_format, but
their drivers are in image. ddi.py also needs a visibility exception to use
image:manifest-lib. Let's move image_format into image.

Signed-off-by: Daan De Meyer <[email protected]>
uki.bzl builds the UKIs of a disk, and boot.bzl extracts the kernel, initrd
and UKI back out of it. initrd.bzl declares a composition. install.bzl
declares the rule that fills ImageInstallInfo, which image.bzl defines and
consumes. Let's move uki.bzl into boot.bzl, initrd.bzl into compose.bzl and
install.bzl into image.bzl.

Signed-off-by: Daan De Meyer <[email protected]>
The image struct lists the thirteen layer operations next to the rules,
providers and constants, so a reader can't tell which names build a layer.
Let's put the operations in a nested image.ops struct, and call them as
image.ops.copy() and so on.

Signed-off-by: Daan De Meyer <[email protected]>

@martinpitt martinpitt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹

@martinpitt
martinpitt merged commit 4072631 into amutable-systems:main Oct 16, 2026
3 of 4 checks passed
@martinpitt martinpitt mentioned this pull request Oct 16, 2026
2 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants