Add a new %post option to the kickstart stage that supports adding
multiple post blocks to a kickstart file, with all the options supported
by the directive.
Rename the 'success' case to 'base64_success' as a preparation for
adding test case for other encodings.
The test case was originally embedding the tools/inline-source.py
script. Since the script has been updated, let's update the embedded
date in the test case as well.
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Extend the script to support specifying the data encoding. Keep
'base64' as the default encoding.
Add support for 'lzma+base64' encoding.
Also use the 'base64' module, instead of 'binascii' module for base64
encoding. This is consistent with what the actual source implementation
uses.
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Extend the inline source to support lzma compressed and base64 encoded
'data'. This will allow us to reduce the potential manifest size when
embedding big files. The aim is specifically at eventually embedding
SBOMs of the image.
An example single SBOM can be a JSON file with size of about 1.9 MiB.
The lzma+base64 combination reduces the 'data' to embed to "only" around
250 KiB.
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit adds an error message if no repositories are
defined in the dnfjson query. We had the issue in
https://github.com/osbuild/bootc-image-builder/issues/922
that in a RHEL bootc-container no repositories are defined.
Here the error is quite confusing, as it complains about
error marking packages which is technically correct but
hides the root of the problem.
With this detect we can construct a more useful error
message in the higher layers.
Drop `module_platform_id` as it is now optional and none of
our tests is using it (i.e. has any observable difference if
missing).
Once we start using it we need to add it (and maybe a
"with_platform_id" as parameter on top so that both with/without
platform_id is tested).
The PLATFORM_ID got retired from fedora-43 [0] and it
seems like it was always kinda optional. So lets make
it optional for real to avoid failing to build fedora-43
images.
[0] https://fedoraproject.org/wiki/Changes/Drop_PLATFORM_ID
DNF apparently doesn't check the expiration time on the cache unless you
call this first. It may help improve issues with the cache being out of
sync.
Internally dnf checks the mtime of the main repomd.xml file when using
baseurl, and it checks the hash values when using metalink so this
should not result in any noticeable extra slowdowns when things are
fresh.
This works around a file conflict on /usr/bin/typer between
python3-typer-cli and erlang-dialyzer until the problem can be fixed in
python-typer and/or erlang. See RHBZ#2359557, RHBZ#2359567.
After the file conflict is resolved, the python3-typer-slim dependency
will still be more precise and minimal than python3-typer, so no further
change will be required.
By depending on typer-slim[standard], we still get the nice-to-have
optional dependencies that plain typer would bring in (currently, rich
and shellingham), but without the generic typer command-line tool.
The old function has been deprecated by dnf5, use load_repos directly
and only load the available repos (the ones osbuild has setup), not the
system repos.
Fixes#2080
The `generic.ins` template uses:
images/kernel.img
images/initrd.img
However, kernel and initrd are currently stored as:
images/pxeboot/vmlinuz
images/pxeboot/initrd.img
This change ensures correct paths are used.
Extend the stage to support setting new options:
- Provisioning.UseCloudInit
- Provisioning.Enabled
Extend the stage test to use them and add a simple stage unit test for
the schema.
Related to https://github.com/osbuild/images/issues/1416
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
The refclock directive can be used to specify one or more hardware
reference clocks to be used as a time source. Each refclock line must
specify a driver and a mandatory parameter, in the form:
refclock driver parameter
Drivers can have driver-specific options:
refclock driver parameter:[driver-option,...]
General refclock options can also be specified:
refclock driver parameter:[driver-option,...] [general-option]...
The stage options schema is written so that the "driver" property is an
object that must match one of four schemas corresponding to the four
drivers, each with a "name" property matching the driver name.
Each driver defines its required property and any optional
driver-specific options.
There are more general refclock options supported than the ones defined
in this commit, but we can add them if and when we need them in the
future.
Note that the restriction on the top-level stage options schema is now
lifted and any set of options can be specified. Servers are not
required. However, at least one top-level property is required still.
Docs: https://chrony-project.org/doc/3.4/chrony.conf.html
Support setting the `auto_enable_yum_plugins` option in the `rhsm`
section of `rhsm.conf`.
Add a unit test for the stage schema and also adjust the stage test
manifest.
Related to: https://github.com/osbuild/images/issues/1408
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Modify the action to allow passing the version when run manually. This
will be useful in the future once we branch-off a `rhel-x.y` branch to
backport a fix and will be doing the first "dot" release from such
branch.
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit adds support for more debug for `qemu-user` options.
When settings:
```
$ sudo IMAGE_BUILDER_EXPERIMENAL=debug-qemu-user bootc-image-builder ...
```
extra debug will be printed. This hopefully helps to track down
the root cause of
https://github.com/podman-desktop/extension-bootc/issues/1475
This commit adds two new helpers:
- util.experimentalflags.get_bool()
- util.experimentalflags.get_string()
similar to what we added in the images library in PR:
https://github.com/osbuild/images/pull/1248
The idea is that we provide experimentalflags for osbuild via
an environment like `OSBUILD_EXPERIMENTAL` and for those we
make no API promises. This will be initially used for better
debug of qemu-user.