The `fix-bls` stage supports a `prefix` argument, which was not
supported in composer. Specifying this argument is necessary in case the
`/boot` mountpoint is on a separate partition.
Add the `prefix` argument to the `fix-bls` stage. Amend unit tests.
The RHEL-8.5 and RHEL-9.0 `aarch64` `ec2` and `ami` images use partitioning
with `/boot` on a separate partition. Due to this, the pipeline must specify
a non-default prefix to the `fix-bls` stage.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
Location property is actually required. If it's omitted from the stage
options, the stage just fails.
Also see: https://github.com/osbuild/osbuild/pull/759
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
Add support for specifying the `leapsectz` property of
`org.osbuild.chrony` stage. Modify stage tests to test setting of the
value.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
Add support for osbuild `org.osbuild.xz` stage. The stage accepts Files
inputs.
Add unit tests for the added functionality.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
osbuild stage inputs were originally implemented in composer as
stage-specific inputs, while in reality, they are defined as individual
inputs, usually accepted by multiple stages. Therefore a single stage
input can be passed to any stage, as long as the stage accepts it.
Files inputs type was previously defined, but not used by any stage.
Creation of proper inputs type structures is currently handled in
`internal/distro/rhel85/stage_inputs.go` instead.
Refactor files inputs type to be usable directly as an input type
structure for stages, which accept it. For now, implement only the
`org.osbuild.pipeline` origin and related input reference.
Add unit tests for the `FilesInputs`.
Define input origin names as string constants, so that they can be used
by inputs implementations, instead of using string literals.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
The part creating Systemd unit drop-ins was extracted from
`org.osbuild.systemd` stage to `org.osbuild.systemd.unit`,
before the osbuild v30 release. Update the composer implementation
to reflect the change.
Related to https://github.com/osbuild/osbuild/pull/739.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
The `org.osbuild.systemd-logind` stage was reworked before the osbuild
v30 release. Update the composer implementation to match the expected
schema.
Related to https://github.com/osbuild/osbuild/pull/739.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
The `org.osbuild.dracut.conf` stage was reworked before the osbuild v30
release. Update the composer implementation to match the expected
schema.
Related to https://github.com/osbuild/osbuild/pull/739.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
The `org.osbuild.modprobe` stage was reworked before the osbuild v30
release. Update the composer implementation to match the expected
schema.
Related to https://github.com/osbuild/osbuild/pull/739.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
The `org.osbuild.cloud-init` stage was reworked before the osbuild v30
release. Update the composer implementation to match the expected
schema.
Related to https://github.com/osbuild/osbuild/pull/739.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
osbuild has recently got support for specifying mounts as an array. This
commit takes advantage of it and uses this new format.
This allows us to specify the order of mounts which is important because
we cannot mount /boot/efi before / is mounted.
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
Live image pipeline: Creates the live image in a file through a loopback
device.
Stages:
- truncate: create the file to hold the image
- sfdisk: partition the device
- mkfs.fat, mkfs.xfs: create the filesystems
- copy: copy the tree from the previous pipeline (the OS pipeline) into
the directories where the partitions are mounted
- grub2.inst: install the bootloader
QEMU pipeline: Convert the live image from the previous pipeline to a
qcow2 image.
Some osbuild stages added as part of PR#1525 declare unexported types
which are complete copies of types with custom MarshalJSON method,
to prevent recursion when marshalling to JSON.
Modify relevant osbuild stages to use type alias instead of declaring a
complete type copy.
https://github.com/osbuild/osbuild-composer/pull/1525
Signed-off-by: Tomas Hozza <thozza@redhat.com>
Add support for the `org.osbuild.authselect` osbuild stage [1],
which allows one to set system identity profile and authentication
sources using `authselect`.
Add unit test cases for the newly added stage.
[1] https://github.com/osbuild/osbuild/pull/696
Signed-off-by: Tomas Hozza <thozza@redhat.com>
Add support for the newly added `x11-keymap` option in the
`org.osbuild.keymap` osbuild stage [1]. The option allows one to
set layouts for the X11 keyboard.
Add unit test cases for the added functionality.
[1] https://github.com/osbuild/osbuild/pull/693
Signed-off-by: Tomas Hozza <thozza@redhat.com>
Add support for the newly added `servers` option in the
`org.osbuild.chrony` osbuild stage [1]. The option allows one to
specify timeservers to be used by chrony, including a subset of
lower-level configuration options per each server.
Implement a custom JSON marshaller method for `ChronyStageOptions` to
ensure that exactly one of 'timeservers' or 'servers' is specified, as
mandated by the stage schema.
Optional values in `ChronyConfigServer` are declared as pointers to
distinguish the case when the value was explicitly set by the user from
the default value when the structure instance is created. All of these
options should be omitted from the JSON, but only when not explicitly
set, not when their value us "0" for int or "false" for bool. Downside
of this approach is that one can not easily use pointer to a basic
type literal in the struct literal. Passing the basic type literal has
to be workarounded using an intermediate variable, which address is
used in the struct literal.
Add unit test cases for the added functionality.
[1] https://github.com/osbuild/osbuild/pull/692
Signed-off-by: Tomas Hozza <thozza@redhat.com>
Add support for the newly added `subscription-manager` option in the
`org.osbuild.rhsm` osbuild stage [1]. The option allows one to
create configure subset of subscription-manager options in its
configuration file `/etc/rhsm/rhsm.conf`.
Add unit test cases for the added functionality.
[1] https://github.com/osbuild/osbuild/pull/659
Signed-off-by: Tomas Hozza <thozza@redhat.com>
Add support for the newly added `unit-dropins` option in the
`org.osbuild.systemd` osbuild stage [1]. The stage allows one to
create `.service` unit files drop-in configuration files under
`/usr/lib/systemd/system/`.
Add unit test cases for the added functionality.
[1] https://github.com/osbuild/osbuild/pull/664
Signed-off-by: Tomas Hozza <thozza@redhat.com>
Add support for the `org.osbuild.cloud-init` osbuild stage [1],
which allows one to configure cloud-init by creating
configuration files under `/etc/cloud/cloud.cfg.d/`.
Add unit test cases for the newly added stage.
[1] https://github.com/osbuild/osbuild/pull/689
Signed-off-by: Tomas Hozza <thozza@redhat.com>
Add support for the newly added `network-scripts` option in the
`org.osbuild.sysconfig` osbuild stage [1]. The stage allows one to
create `ifcfg` configuration files under
`/etc/sysconfig/network-scripts`.
Add unit test cases for the added functionality as well as for other
options of the stage, which were missing.
[1] https://github.com/osbuild/osbuild/pull/663
Signed-off-by: Tomas Hozza <thozza@redhat.com>
Add support for the `org.osbuild.systemd-logind` osbuild stage [1],
which allows one to configure systemd-logind by creating
configuration drop-ins.
Add unit test cases for the newly added stage.
[1] https://github.com/osbuild/osbuild/pull/668
Signed-off-by: Tomas Hozza <thozza@redhat.com>
The `org.osbuild.dracut` stage was previously not tested for JSON
unmarshalling. Add the missing test case and extend Stage's
`UnmarshalJSON()` method.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
Add support for the `org.osbuild.dracut.conf` osbuild stage [1], which
allows one to configure dracut by creating configuration files.
Add unit test cases for the newly added stage.
[1] https://github.com/osbuild/osbuild/pull/688
Signed-off-by: Tomas Hozza <thozza@redhat.com>
Add support for the `org.osbuild.modprobe` osbuild stage [1], which
allows one to configure modprobe by creating configuration files.
Add unit test cases for the newly added stage.
[1] https://github.com/osbuild/osbuild/pull/670
Signed-off-by: Tomas Hozza <thozza@redhat.com>
Metadata from stages in the output from osbuild in the v2 schema are
stored at the top level of the result structure.
Adding the same Metadata types from v1:
- org.osbuild.rpm stage
- org.osbuild.ostree.commit stage
- Raw metadata (for every other stage type)
Added a helper function to the bootiso stage for setting the BCJ option
for xz compression.
The FSCompression struct is changed to use a pointer for the Options
substruct so it can be omitted when nil (omitempty).
When a stage is successful in a manifest v2, the success field is omitted from
the result. In other words, the default value of the success field is true
which is against the default value of boolean in Go. This commit implements
a workaround.
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
- org.osbuild.anaconda
Configures Anaconda. For now, only enabling kickstart modules is
supported.
- org.osbuild.buildstamp
Creates a buildstamp file, which is required by Anaconda.
- org.osbuild.kickstart
Creates a kickstart file.
- org.osbuild.lorax-script
Uses lorax template helpers to execute a template.
- org.osbuild.bootiso
Prepares a bootable file system tree suitable for writing on an ISO
file system
- org.osbuild.discinfo
Creates a .discinfo file, used by the Anaconda installer.
- org.osbuild.xorrisofs
Uses the `xorrisofs` command line utility to an ISO.
- org.osbuild.implantisomd5
Uses the `implantisomd5` command to implant MD5 checksums into an
ISO.
The org.osbuild.oci-archive stage now supports an arbitrary number of
layers on top of the Base layer. The keys for these layers follow the
pattern "layer.N" (N = 1, 2, 3, ...).
We use a custom marshaller and unmarshaller for the
OCIArchiveStageInputs to handle this. The unmarshaller also validates
the layer keys to match the pattern in the schema.
Recently added stages org.osbuild.sysconfig and
org.osbuild.kernel-cmdline were missing from the Manifest unmarshal
method causing it to fail when trying to unmarshal manifests that
contained them.