This was added in osbuild: https://github.com/osbuild/osbuild/pull/875
Introduce the same option in composer and make it optional by specifying
it as a pointer to bool value. It would work the same even if it was
there every time, but as it should be an edge case, don't use it
everywhere. Also osbuild doesn't require it to be present, so it seems
like the right thing to do.
The stage now allows for customizations specific to YUM or DNF. So far
it is just an alias to the same definition, meaning that composer can
use exactly the same structures for both.
Ref: https://github.com/osbuild/osbuild/pull/876
Before dereferencing the method receiver in Write(), check if the object
is nil and return early.
Fixes#2002
Signed-off-by: Achilleas Koutsou <achilleas@koutsou.net>
Rework the stage options data validation to be done in constructor
methods, instead of when being marshalled to JSON.
Add validation of values passed to constructor methods for modprobe
command structures.
Add validation of the configuration filename based on stage schema.
Related to issue #1785.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
Add support for the 'install' modprobe command in the modprobe osbuild
stage implementation.
Extend unit tests to verify marshalling the stage options into JSON.
Related to https://github.com/osbuild/osbuild/pull/867.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
Moved and adapted tests from osbuild1 to osbuild2.
Moved test data from osbuild1 to osbuild2.
Added conversion tests for v1 to v2.
Added full v2 result raw data from successful build.
Signed-off-by: Achilleas Koutsou <achilleas@koutsou.net>
Convert osbuild1.Result{} to osbuild2.Result{}.
For the Metadata objects, it assumes they are directly convertible: the
stage metadata structs have the same members.
The old conversion code from v2 to v1 is removed and the equivalent
conversion logic is moved to osbuild2:
- version detection based on stub
- custom unmarshaller that calls conversion function if v1 result is
detected
Signed-off-by: Achilleas Koutsou <achilleas@koutsou.net>
Implementing writer for osbuild2 Result type.
Since Go maps don't have stable ordering, sorting by the pipeline name
provides stable output.
Signed-off-by: Achilleas Koutsou <achilleas@koutsou.net>
Expose the new (osbuild > 36) `sysroot.bootloader` option to
configure the bootloader backend for OSTree deployments.
Normally, this should be set to `none` for modern bootloader
that use the BLS, since the BLS snippets are always generated.
Add support for a new osbuild stage `org.osbuild.tuned`, for
setting TuneD profile.
Add unit tests for the new stage.
Related to https://github.com/osbuild/osbuild/pull/797.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
Add support for a new osbuild stage `org.osbuild.dnf.config`, for
configuring DNF.
Add unit tests for the new stage.
Related to https://github.com/osbuild/osbuild/pull/798.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
Add support for a new osbuild stage `org.osbuild.sysctld`, for
creating tmpfiles.d configuration files.
Add unit tests for the new stage.
Related to https://github.com/osbuild/osbuild/pull/804.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
Add support for a new osbuild stage `org.osbuild.tmpfilesd`, for
creating tmpfiles.d configuration files.
Add unit tests for the new stage.
Related to https://github.com/osbuild/osbuild/pull/801.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
Add support for a new osbuid stage `org.osbuild.selinux.config`,
for setting the desired SELinux policy state and type on the system.
Add unit tests for the new stage.
Related to https://github.com/osbuild/osbuild/pull/799.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
osbuild, since version 30, supports the ostree deployments for the
fstab stage.
Co-Developed-by: Achilleas Koutsou <achilleas@koutsou.net>
Co-Developed-by: Christian Kellner <christian@kellner.me>
Mark the `FilesInput` as valid input for the copy stage input so it
can be used in the constructor helper function(s).
Co-Developed-by: Achilleas Koutsou <achilleas@koutsou.net>
Co-Developed-by: Antonio Murdaca <runcom@linux.com>
Add a level of indirection for the copy stage constructor function
in order to be able to use it with existing input types, like the
files input.
Co-Developed-by: Achilleas Koutsou <achilleas@koutsou.net>
Co-Developed-by: Antonio Murdaca <runcom@linux.com>
Add the new stages included in osbuild 30 that can be used to
deploy an OSTree commit as well as the grub iso stage that
is used to configure grub2 (efi) for isos.
Bump the spec file requirement accordingly.
Co-Developed-by: Achilleas Koutsou <achilleas@koutsou.net>
Co-Developed-by: Christian Kellner <christian@kellner.me>
Should be a pointer otherwise it creates an empty object in the manifest
which makes the stage fail.
Co-Developed-by: Christian Kellner <christian@kellner.me>
Add support for the `org.osbuild.ostree.passwd` and with it also
support for the `org.osbuild.ostree.checkout` input.
This stage can be used to pre-load the user and groups database
from an existing commit to ensure that uids/gids are stable.
org.osbuild.chmod: runs chmod on one or more files
org.osbuild.nginx.conf: write nginx config file
Signed-off-by: Achilleas Koutsou <achilleas@koutsou.net>
The `uefi.unified` option indicates whether the `org.osbuild.grub2`
will use the unified grub configration scheme[1] used by Fedora 34
and thus RHEL 9.
NB: This requires osbuild version >= 32.
[1] https://fedoraproject.org/wiki/Changes/UnifyGrubConfig
The `uefi.install` option indicates whether the `org.osbuild.grub2`
stage will copy the efi binaries from the build root to the `/boot`
directory in the tree.
Co-Developed-by: Achilleas Koutsou <achilleas@koutsou.net>
Co-Developed-by: Antonio Murdaca <runcom@linux.com>
Devices unlike stage options, shouldn't be stage specific.
There is only one type of device so far, the loopback device, which
is already defined as a separate type.
The top level Devices type is simply an alias to a Device map.
The mkfs stages require a single device with a specific key ("device").
These stages accept only one device in their NewStage() function for
convenience and create the Stage struct with the required key.
The zipl.inst stage requires a device labeled 'disk' as well as the rest
of the devices that correspond to each partition. The disk device is
passed to the New stage function separately and added to the Stage
devices with the required key.
Signed-off-by: Achilleas Koutsou <achilleas@koutsou.net>
Mounts unlike stage options, shouldn't be stage specific. We have
filesystem specific mount types, differentiated by their type string.
Mounts can define their own additional options if necessary.
The top level Mounts type is simply an alias to a Mount array.
Signed-off-by: Achilleas Koutsou <achilleas@koutsou.net>
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>