The previous error didn't make it clear where the issue was coming from.
Now it explains that the problem is that a partition table for a given
architecture isn't specified on the image type.
Rework the stage to not reimplement `FilesInput` as
`RPMStageInput`, but instead use the one common
`FilesInput` implementation and its supported
references.
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Rework the stage to not reimplement `FilesInput` as
`IgnitionStageInput`, but instead use the one common
`FilesInput` implementation and its supported
references.
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Rework the stage to not reimplement `FilesInput` as `QEMUStageInput`,
but instead use the one common `FilesInput` implementation and its
supported references.
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Rework the stage to not reimplement `FilesInput` as
`FDOStageInput`, but instead use the one common
`FilesInput` implementation and its supported
references.
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
The `FilesInputs` was since the beginning an XZ-specific implementation
of the input, but it was implemented in the `files_input.go` in a false
hope that it could be used as a generic stage inputs by any stages. It
turned out that various stages require different implementation of
its input. Specifically there is usually a stage-specific key, which has
assigned a common input type. For XZ stage, the key is `file`.
Remove `FilesInputs` and instead implement `XzStageInputs` which is now
accepted by the XZ stage.
Fix all affected pipeline implementations that use XZ stage.
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Rework files input implementation to support all reference types
supported by the input schema. Also implement helper functions to
generate supported reference types. In some cases, the reference
supports e.g. referencing multiple pipelines in the stage inputs, but
this is currently not implemented, since no pipeline in composer uses
it.
Rework the files input unit tests to cover the new functionality.
Adjust all code affected by the changes made to files input.
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Updated manifests for RHEL 9.1.
The changes added here would have been part of commit
73882b7289 but the lack of repositories
defined for the distro prevented test case generation.
In commit 7c8b9f4da8 I intended to make a
copy of the RHEL 9.1 repos under the key "rhel-9" so that the
RHEL 9 distribution, which is currently an alias to RHEL 9.1 (the
current GA) would have valid test repositories available for the test
case generator. Instead, I accidentally replaced the "rhel-91"
repositories with the ones for "rhel-9".
This commit fixes that mistake.
Changes:
- Removed unnecessary packages from build roots. Build packages are
added on-demand.
- Some stages changed order in the OS pipeline for azure-rhui. This
will have no functional effect.
- RHSM Facts stage added to all RHEL 7 manifests. This wont be used
since RHEL 7 is not built in the cloud service. The RHSM fact is
added by the test case generator to all image types to test that the
option is working properly.
- Azure archive pipeline renamed to xz like in all the other rewritten
image types that use the xz pipeline.
- Azure image filename before archiving has changed from 'disk.vhd' to
'image.vhd'. Again, this will have no functional effect because the
name of the final artifact is unchanged (disk.vhd.xz).
The RHEL 7 images need to enable the force_autorelabel option for the
SELinux stage in osbuild. This option should almost never be used but
it was added specifically for RHEL 7. With the rewrite to the new
definitions and the sharing of pipeline code between all distros, we
need to add support to all stages of the pipeline generation to be able
to enable it.
The RHEL 7 vpc subformat in qemu does not support force_size so we need
to be able to disable it. The parameter in all parts is defined as a
pointer because the default value is 'true'. Not specifying it will
keep the option in the osbuild stage as 'nil', falling back to 'true' in
osbuild.
Older OS versions (RHEL 7) with older versions of grub2 don't support
BLS entries. Setting NoBLS to true configures the bootloader with
traditional menu entries through the grub2.legacy osbuild stage. This
requires specifying extra information for the OS to the pipeline:
version, product, and nick.
Add the partition tool as an option on the Raw pipeline. Set it to the
old value (sfdisk) by default.
Expose the option up through the liveImage image kind so that the
distribution can set it if needed.
For RHEL 7, set it to sgdisk.
- Replace Manifest() and PackageSets() imageType methods with (adapted)
copies from RHEL 8.
- Replace pipeline functions with liveImage image function.
- Specify xz compression for Azure RHUI.
- Add similar package name overrides as we did in RHEL 8. For RHEL 7,
we need to modify the capitalisation of python3-pyyaml.
Moved the qcow2 image type definition to the top of the file for
consistency with the other image type files.
Separated the default image config struct from the base image type
definition to make it easier to read.
Moved the Azure image type definition to the top of the file for
consistency with the other image type files.
Separated the default image config struct from the base image type
definition to make it easier to read.
Update the implementation of the distro.Distro interface to match the
one in RHEL 8, 9, and Fedora. The main change is that the runner is a
runner.Runner and not a string.
The runner name is now rhel79 (changed from rhel7). This is
functionally equivalent based on osbuild's runner version fallback
logic.
The qcow2 image type for RHEL 7 doesn't have packageset chains defined.
This means that the blueprint packages are never merged into the os
pipeline.
This is unnecessary right now because of the upcoming rewrite, but it
will minimise the differences that will show up in the manifest.
The qcow2-customize manifest has an added block of options for the
grub2.legacy stage because now the dracut-config-rescue package is being
installed in the image.
Azure RHUI and BYOS images use the respective BYOS / RHUI default image
configuration, inheriting the defaults from a common configuration. The
Azure SAP RHUI image was incorrectly using the common configuration and
was not inheriting any settings from the RHUI configuration. As a
result, the Azure SAP RHUI image was missing the following
configuration:
- Required GPG keys were not imported from the file system as part of
image build.
- No RHSM configuration was applied at all.
Add "Rhui" to the image type definition, to make it explicit that it is
RHUI-based. Make sure that the image type default configuration is based
on the common RHUI configuration. Regenerate affected image manifests.
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
`authselect-compat-1.2.5-2.el9_1` package is currently missing in AWS
RHUI el9 AppStream repositories, which makes `dnf upgrade` fail on
RHEL-9.1. This is a RHUI-specific issue, since the package is available
in CDN repos.
In order to workaround the issue for now, `authselect-compat` needs to
be removed as part of the upgrade in order for it to succeed. Use
`--allowerasing` instead of just removing the issue, because this will
ensure that `authselect-compat` will be upgraded just fine, once the
issue is resolved.
Fix the issue in the CI script that builds the image using Packer, as
well as the Ansible playbook used by Packer to build the image.
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Our 'customize' test manifests include an option to disable the
bluetooth.service. Originally this option was added for image types
that included bluez in their default package set (Fedora IoT commit) but
it was later copied to the qcow2 image type as a way of testing
customizations.
Until recently, building these caused no issues. On distros with more
recent versions of systemd, disabling a non-existent service causes an
error and these manifests fail to build.
Added the 'bluez' package to all manifests that include the 'disable
bluetooth.service' customization and updated the manifests. These
should all be buildable now.
The default value for the `os.FileMode` is zero, but the actual default
value used by the stage if no value is specified in the options is
`0777`. By using the pointer, we'll allow one to specify `0000`
permissions as a value which won't be omitted from the stage options.
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Add support for `exist_ok` stage option added as part of
PR#1224 [1], which allows to gracefully handle existence of a directory
path specified to the stage.
This will be helpful when creating custom directories in the image via
customizations, because one can't know in advance whether the directory
path won't be created by a package installed in the image.
Not bumping the requires on osbuild, because this new option is not yet
used by any image definition or customization.
[1] https://github.com/osbuild/osbuild/pull/1224
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
The stage supports a `parents` property in stage path options, which
allows one to auto-create any parent directories as needed.
Add the property to stage options implementation.
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
The plain `Path` name was a bit unfortunate, since it was specific to
the `mkdir` stage, but it was used outside of the `osbuild` package as
`osbuild.Path` which was making a wrong impression of it being a generic
path structure. This is not true.
Rename the structure to contain the stage name.
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Since composer is not updated into these distributions, it's safe to use
a newer version of osbuild on them without the risk of releasing a
composer version which would require an unreleased osbuild version.
Every image type defines a list of build pipeline names and a list of
payload pipeline names. These should match the names of the pipelines
that will exist in the manifest when it's generated. They should match
exactly, otherwise issues can occur when reading the metadata from an
osbuild result. The cloud API needs to know the names of the pipelines
and specifically the name of the build pipeline and the payload pipeline
in order to differentiated between build and payload packages in the
metadata.
This new test generates every manifest, parses it into a minimal struct,
and compares the pipeline names with the ones reported statically on the
image type definition.
The format-request-map is updated to remove the override for the
customized qcow for rhel-8.
The rhel-8 manifests are now identical to the rhel-87 counterparts.