Commit graph

1426 commits

Author SHA1 Message Date
Christian Kellner
3eea6e54d9 stages/xorrisofs: ability to set system id
Add an option to set the systemd id of the ISO. The systemd id
is used by e.g. by osinfo to identify the RHEL boot isos, where
the system id is "LINUX"[1]

[1] https://gitlab.com/libosinfo/osinfo-db/-/blob/master/data/os/redhat.com/rhel-8.4.xml.in#L19
2021-03-14 15:33:07 +01:00
Christian Kellner
2dcc1d9cee sources/ostree: capture ostree output
Instead of using stderr for the ostree subprocess command
capture its output so that in the case of an error we get
properly return the error output. With the old behavior
all the `ostree` command output would land in the journal
of the worker.
2021-03-12 18:49:41 +01:00
Christian Kellner
b609bb81dd source/ostree: fix download only case
Source, for compatability reasons, have two modes: download only
and download and export. The difference is the arguments that
are passed to the source: For download only, the `output` param
is empty. In this case also `checksums` *can* be empty and if so
it means everything, i.e. the commits, should be fetched. The
latter was not properly handled so far. Adjust the logic, which
now closely mimics that of the `org.osbuild.curl` source to fix
this case.
Also catch exceptions invoking `ostree` and properly return them
via the json error messaging.
2021-03-12 18:49:41 +01:00
Christian Kellner
c616afa87e test: dynamically generate stage test_stages
This is a partial revert of commit d584a1e, which converted the
dynamically generate stage tests to sub tests. The problem with
the latter is that they can't be individually run, which makes
testing changes to specific stages cumbersome to develop.
Therefore switch back to a model where the stage tests are
dynamically generated via a class decorator.
2021-03-11 12:46:24 +00:00
Christian Kellner
428a9fd58c test/stages: checks for org.osbuild.resolv-conf
Implement a new stage test that checks that the new resolv-conf
stage works as expected.
2021-03-11 12:46:24 +00:00
Christian Kellner
a44a9ab04c stages: add org.osbuild.resolv-conf
Add new stage that can be used to configure the resolver(3) via
the /etc/resolv.conf(5) configuration file.
2021-03-11 12:46:24 +00:00
Christian Kellner
99160ad369 ci: increase fetch-depth to 2
Codecov apparently has trouble detecting the git commit if the
fetch depth is only 1 (the default). Therefore increase it.
See https://github.com/codecov/codecov-action/issues/190 for
more details.
2021-03-11 12:46:24 +00:00
Aleksandar Todorov
775dceaf20 tests: Save osbuild.repo file under artifacts
makes it easier to grab if we need it for manual testing or
in case one needs to download the RPMs from Schutzbot
2021-03-10 12:00:49 +02:00
Christian Kellner
eb6461c165 test/fmt_v1: check result is complete
In the output test, check that for a successful pipeline run all
the elements are present: main result, assembler result, stage
result.
NB: Build result is hard to test because we would need to actually
build a valid build root.
2021-03-09 21:40:47 +00:00
Christian Kellner
74e6302860 test/fmt_v1: check assembler failures propagate
Check that if an assembler fails the result is propagated to the
overall result status, i.e. the main `success` is also `False`.
2021-03-09 21:40:47 +00:00
Christian Kellner
dfd7ff2500 fmt/v1: correctly infer result from assembler
If a pipeline has an assembler and that assembler failed, the
overall status of the build also needs to be marked as failed.
This used to be the case, but a bug got introduced when the
format abstraction code was added.
2021-03-09 21:40:47 +00:00
Christian Kellner
72ffa50c45 assemblers: add org.osbuild.error
This is, like the stage with the same name, an assembler that
will exit with an error code (default 255, but can be specified
via the assembler options). It is mostly useful for testing.
2021-03-09 21:40:47 +00:00
Aleksandar Todorov
d98f460841 runners: add rhel 85
A runner for rhel 8.5 is added. This runner is a sym link to the rhel82
runner as was done for the rhel84 runner.
2021-03-09 16:00:32 +00:00
Ondřej Budai
555b5d0f2b schutzbot/deploy: remove the RHEL 8.3 Beta workaround
These days are long gone, we no longer test osbuild against development RHEL
versions. This is covered by osbuild-composer's test suite.
2021-03-07 12:50:06 +00:00
Ondřej Budai
3028402e71 schutzbot/deploy: bump to osbuild-composer 29
It was set to osbuild-composer 24, so old.
2021-03-07 12:50:06 +00:00
Christian Kellner
850ee4466f stages/grub2: set GRUB_CMDLINE_LINUX default
Set the "GRUB_CMDLINE_LINUX" variable in /etc/default/grub to the
kernel command line options. This is used by `grub2-mkconfig` to
assemble the full kernel command line when generating the menu
entires. NB: `GRUB_CMDLINE_LINUX` does NOT include the root fs
bits (`root=...`), since that is generated by grub2-mkconfig
itself.
2021-03-03 20:19:39 +00:00
Christian Kellner
846b3274e3 stages/ostree.preptree: fix machine-id detection
Do the check if there is a /etc/machine-id before moving /etc to
/usr/etc, because otherwise /etc/machine-id will obviously not
exist and thus the detection is broken.
2021-03-02 18:23:54 +01:00
Christian Kellner
3d27b301a2 stages/oci-archive: do not include selinux labels
Instead of including SELinux labels for the content layers via the
`--selinux` tar option, make sure selinux labels are not included by
using the `--no-selinux` option.
The inclusion of the labels was a mistake, since they should be
determined by the target system because selinux labels are not
namespaced. On RHEL/Fedora the SELinux label used is something like
`system_u:object_r:container_ro_file_t:s0` for all the files in the
container.
Including the label was leading to permission problems because
the files had a different label on the host and programs inside
the container get `EACCES`, i.e. Permission denied, errors when
accessing files with the different label.
Interestingly this does not happen on Fedora 33 but only on RHEL.
One possibility is that the overlayfs kernel driver in RHEL is
behaving differently on RHEL than on Fedora.
2021-03-02 17:37:45 +01:00
Ondřej Budai
a4ae503c29 schutzbot/mock: fix centos stream 8 build
The centos stream 8 config was renamed in mock-core-config, see:
75cd9eb52d
2021-03-02 09:24:54 +00:00
Christian Kellner
01319b55a9 tools: use dnf filtering in lorax-template helper
The pylorax implementation of the template running code supports
globbing, as well as `--exclude` and `--optional` commands. These
are handled independently for each `installpkg` command, so that
requesting the installation of firmware packages in one command
together with an exclude of `*alsa` does indeed only exclude any
alsa firmware packages but not any other alsa packages. The
previous version of this script would just build an global list
for excludes which has a drastically different result because
a global exclude of "*alsa" would result in a global exclusion of
all matching packages and probably a dependency error.
Therefore, add support for dnf based filtering of packages on a
per `installpkg` command bases, very much like pylorax does.
2021-03-01 16:18:50 +01:00
Christian Kellner
961ce3077f tools: add lorax-template-pkg.py helper
Add a simple helper that is meant to gather the list of packages
to be installed via a lorax template that uses the "installpkg"
directives. A prominent example is the 'runtime-install.tmpl'
script from lorax-templates-generic, used to create boot isos.
2021-03-01 16:18:50 +01:00
Aleksandar Todorov
e4e527b5b7 schutzbot: build osbuild for aarch64 RHEL8/CentOS 8
needed for
https://github.com/osbuild/osbuild-composer/pull/1229
2021-02-23 19:23:32 +01:00
Achilleas Koutsou
e7b9fb6db7 NEWS: small typo fixes 2021-02-22 18:16:40 +01:00
Tom Gundersen
6f1350d72d schutzbot/mock: add more distros
This builds osbuild in F33aarch64 as well as RHEL8.4 and CentOS8. No tests are currently run.

With the mockbuilds in place we will be able to run composer CI against osbuild master, when necessary.
2021-02-20 15:16:20 +01:00
Christian Kellner
3086c7d70c 26
This completes the development of osbuild version 26
2021-02-19 20:44:20 +00:00
Christian Kellner
f48349d42f NEWS: update for osbuild version 26
This release includes the necessary bits and pieces to build
boot isos.
2021-02-19 20:44:20 +00:00
Christian Kellner
4a7efa087e test/ostree: add installer test
Extend the current ostree container test case to use the new
bootiso manifest to build a bootable iso. This is done in the
existing container test case in order to share the build root
and ostree commit results and speed up testing. In the future,
the test infrastructure should be extended so that the cache
can be optionally shared between test cases.
2021-02-19 14:42:32 +00:00
Christian Kellner
a0d716ad22 stages: org.osbuild.tar ported from assembler
Port the org.osbuild.tar assembler to a new assembler like stage,
that takes a tree input. The only real change is that instead of
having a compression argument, the compression is now based on
the file ending.
2021-02-19 14:42:32 +00:00
Christian Kellner
2d3f306a20 stages/kickstart: add support for 'liveimg'
Add support for the 'liveimg' kickstart command, which can be used
with tar payloads included in the installer image, to install
pre-built image archives.
2021-02-19 14:42:32 +00:00
Christian Kellner
283f8d0de8 test/data: add ostree based boot iso manifest
This new manifests creates an boot iso which contains an ostree
commit that is build in the same manifest. The boot iso can then
be installed via the ISO.
2021-02-19 14:42:32 +00:00
Christian Kellner
e1f1f64cf1 test/data: add iso tools to v2 build root
Add the necessary tools to build boot isos to the build root.
Most notably the lorax templates, bootloader as well as iso
creation tools.
2021-02-19 14:42:32 +00:00
Christian Kellner
3dac94a813 stages: add org.osbuild.implantisomd5
New stage that uses the implantisomd5(1) to implant MD5 checksums
into an ISO. This is then used by a dracut module in the installer
ISO to check the installation medium.
2021-02-19 14:42:32 +00:00
Christian Kellner
0197d6ce8a stages: add org.osbuild.xorrisofs
Add a new stage that uses the `xorrisofs`(1) command line utility
to assemble a. The iso can be made bootable by specifying a
combination of the `boot` and `efi` options.
2021-02-19 14:42:32 +00:00
Christian Kellner
f0f4751ca4 stages: add org.osbuild.discinfo
Add a new simple stage to create a .discinfo file, used by the
anaconda installer.
2021-02-19 14:42:32 +00:00
Christian Kellner
6e74c7f52c stages: add org.osbuild.bootiso
Add a new stage that prepares a bootable file system tree suitable
for writing to an ISO file system. It currently only supports
EFI and PC-BIOS boot. It takes a tree input which will be wrapped
into a ext4 file-system wrapped into a squashfs image.
2021-02-19 14:42:32 +00:00
Christian Kellner
200c6c373c stages: add org.osbuild.lorax-script
Add a new stage that uses the recently added lorax template
helpers to execute such a template. The template itself will
be search in the build root, but the command of the script
will operate on the tree.
2021-02-19 14:42:32 +00:00
Christian Kellner
1a19e48ae6 test/util_lorax: add basic checks
Add checks for the lorax utility methods, like rendering a template
and executing the basic set of commands.
2021-02-19 14:42:32 +00:00
Christian Kellner
6767d04ef5 utils/lorax: add lorax template related helpers
A new module that can parse and execute Lorax script templates,
which are mako template based files that support a limited set
of commands, like "install", "remove" and such.
The module provides helper functions to parse such templates
and execute them by providing a re-implementation of a subset
of the commands. All commands needed for running the post
installationtemplates were implemented.
2021-02-19 14:42:32 +00:00
Christian Kellner
0d00914da7 stages: add org.osbuild.kickstart
Add a new stage to create a kickstart file. Only the "ostreesetup"
command can be configured for now.
2021-02-19 14:42:32 +00:00
Christian Kellner
d61ea55f20 stages: add org.osbuild.buildstamp
Add a stage to create a buildstamp file, which is required by
anaconda to properly function, since it configures varies
aspects of the installation target (product, build arch, ...).
2021-02-19 14:42:32 +00:00
Christian Kellner
19b330eade stages: add org.osbuild.anaconda
Add a stage to configure anaconda. For now only the enabled
kickstart modules can be configured. This is done by dropping
a file "90-osbuild.conf" in `/etc/anaconda/conf.d`.
2021-02-19 14:42:32 +00:00
Christian Kellner
6d52349370 buildroot: bind mount mke2fs config
There was a bug in mke2fs (fixed in versionv 1.45.7, with commit
6fa8edd0) where mkfs.ext4 would fail because the default config,
created on the fly, would contain a syntax error. The program
would abort with:
  Syntax error in mke2fs config file (<default>, line #22)
    Unknown code prof 17

To avoid this error, we try to bind mount the config from the build
root.
2021-02-19 14:42:32 +00:00
Christian Kellner
47a81ff3ed pipeline: ability to checkpoint by pipeline name
Since pipelines can now be uniquely addressed via their names,
add the ability to checkpoint via the pipeline name. This will
effectively checkpoint the last stage of a pipeline.
For format v1 manifests, the build pipeline is called "build",
the main pipeline is called "tree" and the pipeline for the
assembler is called "assembler".
2021-02-19 14:42:32 +00:00
Christian Kellner
7a503100c8 test/data: set saved_entry in boot manifest
This is to test the functionality of the new `saved_entry` grub2
config file. Ideally an integration test would install a new non-
default kernel and check that it does not get selected. Something
for the future.
2021-02-19 14:41:26 +00:00
Christian Kellner
ca3db79c35 stages/grub2: support saved_entry grubenv var
The current grub configuration has no logic to select the default
boot entry, which means the next boot entry is chosen by grub2
by the sort order of available entries. This will break tooling
like grub2-set-default and grub2-reboot that set on a specific
variable `saved_entry` in the grub environment file `grubenv` to
to point to the select boot entry.
Change our grub configuration file to use that `saved_entry` var
to select the next boot entry to unbreak the tooling.
In addition to the aforementioned tools, the saved_entry is also
updated by the kernel install scripts when new kernel is installed,
but only if the newly installed kernel is the selected default.
Thus not respecting the `saved_entry` variable might cause a bug
where a newly installed non-default kernel gets selected by grub2.
2021-02-19 14:41:26 +00:00
David Rheinsberg
3072f882ca ci: convert to new immutable ci images
Use the new immutable image infrastructure from `osbuild/containers`.
While at it, also switch over to the new github-actions helper, now that
we no longer run `systemd-nspawn` in our tests.

The old image was renamed from `ghci-osbuild` to `osbuild-ci` to avoid
accidentally replacing old images. The new infrastructure uses immutable
images, so downstream will no longer get automatic updates, unless the
`latest` tags are used.

Signed-off-by: David Rheinsberg <david.rheinsberg@gmail.com>
2021-02-19 11:02:17 +01:00
Christian Kellner
f87447a120 treesum: handle special device files
When a special file, i.e. character or block device node, is
encountered, add its device id to the hash.
2021-02-16 23:00:13 +00:00
Christian Kellner
bc941c2342 mpp/depsolve: support multiple repos
Although MPP supported having multiple repo entries for each
depsolve block, in reality that didn't actually work because
the same (global) baseurl was used for all packages.
Now the basurl can still be (otionally) specified globally,
but also overridden by the repo block and the package paths
will be relative to that.
2021-02-16 23:00:13 +00:00
Christian Kellner
8ad2eef13f test/initrd: remove unneeded f-string
No interpolation was done via this f-string, remove it.
2021-02-16 22:58:15 +00:00
Christian Kellner
d4ebbb821a stages/oci-archive: support additional layers
In addition to the required base layer, provided via the the input
of the same name, the oci-archive stage now accepts up to nine
additional layers that get added on top of each other, sorted in
ascending order, i.e. `layer.1` to `layer.9`.

Adapt the `fedora-ostree-container` example manifest so that the
ostree commit is now in a separate layer, which makes it possible
to share the base layer between different commits container.
2021-02-16 22:58:15 +00:00