Commit graph

2479 commits

Author SHA1 Message Date
Simon de Vlieger
7c35b945ee depsolve: import dnf-json
Import the `dnf-json` Python script that is included in the "images" and
"osbuild-composer" repository into "osbuild".

`dnf-json` provides dependency solving capabilities by taking in some
JSON and then outputting the package set that JSON resolves to. Since it
is a Python script it moves into a subpackage of `osbuild`.

The script is renamed to `osbuild-depsolve-dnf`.
2023-10-16 20:47:17 +02:00
Luke Yang
980ca03685 tools/osbuild-mpp: Fix empty ostree commit object in deploy stage
This adds an early return to the `_process_ostree_commits` function to
prevent an empty ostree commit object from being created in the deploy
stage which causes violations to the deploy stage input schema.
2023-10-16 20:26:10 +02:00
Dusty Mabe
ecc997a81a tools/osbuild-mpp: add mpp-resolve-ostree-commits helper
This will make it easier to resolve OSTree refs into commits similar
to how mpp-resolve-images works for container image references to
SHA256 digests.
2023-10-16 20:26:10 +02:00
Dusty Mabe
8844bc260e osbuild/util/ostree: create setup_remote function
This moves the setup_remote function from the ostree source into
util/ostree. This is prep for sharing this function with an mpp
helper in the future.
2023-10-16 20:26:10 +02:00
Dusty Mabe
f4ab2f43e2 sources/ostree: leverage util/ostree library code
Similar to the cleanups in 4e99e80, let's start using the library
code for the calls to ostree here.
2023-10-16 20:26:10 +02:00
Dusty Mabe
7de357f1a9 inputs/ostree: leverage util/ostree library code
Similar to the cleanups in 4e99e80, let's start using the library
code for the calls to ostree here.
2023-10-16 20:26:10 +02:00
Achilleas Koutsou
cf14de3558 test/stages/users: extend to add ssh keys
Added three users to the test to test all combinations of ssh key
definitions:
- a user called `onekey` that has a single key defined in the `key`
  option.
- a user called `multikey` that has a multiple keys defined in the
  `keys` array.
- a user called `bothy` that defines both a single key in the `key`
  option and two other keys in the `keys` array.
2023-10-16 18:05:27 +02:00
Michael Ho
21054b181c stages/org.osbuild.users: support multiple SSH keys
Add a new attribute, "keys", to allow specifying multiple public SSH
keys to install to a users authorized_keys file.

This maintains backwards compatibility with the existing "key" attribute
that can only specify a single SSH key to install into the file (without
using some newline hacks).

Signed-off-by: Michael Ho <michael.ho@ieee.org>
2023-10-16 18:05:27 +02:00
schutzbot
6b851493c1 schutzfile: Update snapshots to 20231015 2023-10-16 14:49:34 +02:00
schutzbot
d66d58ae8a schutzfile: Update snapshots to 20231012 2023-10-13 00:20:46 +02:00
schutzbot
f0982873e2 Post release version bump
[skip ci]
2023-10-11 08:14:13 +00:00
Dusty Mabe
3cc733d7cd stages/ostree.deploy: support an ostree input
This will allow a user to specify an input directly to the deploy
stage rather than requiring a ostree.pull stage to be called first.

Adding inputs will also be useful when we soon add support for
deploying from a container rather than just deploying from an existing
ostree commit in a repo.
2023-10-06 15:55:26 +02:00
Dusty Mabe
c6c9454f6f osbuild/util: create pull_local function in util/ostree
This is prep for sharing this functionality with other stages than
the ostree.pull stage.
2023-10-06 15:55:26 +02:00
Dusty Mabe
4e99e80c4a osbuild/util: hoist ostree code into util/ostree
Prep for sharing with other stages later.
2023-10-06 15:55:26 +02:00
Dusty Mabe
34d3471fdd stages/ostree.passwd: delete dead code ostree function
As far as I can tell this is unused in this file.
2023-10-06 15:55:26 +02:00
Dusty Mabe
0f477889be stages/ostree: add deprecation notice/warning
I've been informed that this stage is old and shouldn't be used for
newly created manifests. Let's add a comment to the top for future
explorers of this code base.
2023-10-06 15:55:26 +02:00
Maxime Ripard
7af2f1a5c1 Create additional option to setup FS geometry
Some platforms like the TI AM62 require a particular FAT geometry for
their CPU to read the file system (and thus the bootloader). Failing
that the CPU will simply not boot and keep looking for a bootloader.

Let's add some options to enforce a particular filesystem geometry
through the -g option of mkfs.fat.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
2023-10-05 20:17:40 +02:00
Maxime Ripard
e58fc3d289 Consolidate the options setup for mkfs.fat
The current options building code for mkfs.fat prevents to have multiple
options at a time since it will assign the opts list to either the label
or fatsize options.

If both are set, only the last one, fatsize, will be set.

Use the occasion to rewrite the code a bit and limit the number of
lists concatenation.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
2023-10-05 20:17:40 +02:00
Dusty Mabe
4e5de3808e osbuild/util: add containers_source helper
This will hoist even more code into util out of the skopeo stage.
Now a caller can call:

    with containers.container_source(image) as (image_name, image_source):
        print(f"{image_name}, {image_source}")

to process containers inputs.
2023-09-30 02:29:05 +02:00
Dusty Mabe
4cd9af47d0 osbuild/util: hoist container handling code into util/containers
This hoists container handling code from the skopeo stage into
util/containers. It is prep for adding another stage that accepts
containers as an input. The code is common so we should share it
amongst all stages that use containers as input.
2023-09-30 02:29:05 +02:00
Otto Fowler
cfe7818771 fix link to developer guide 2023-09-29 07:01:56 -07:00
Dusty Mabe
c88b3982e8 stages/ostree.deploy: switch to v2 schema
Prep for possibly adding inputs to the ostree.deploy stage in the
future.
2023-09-28 21:38:58 +02:00
Achilleas Koutsou
7b359e3ecd Update Fedora 39 x86_64 runner 2023-09-28 09:15:53 -07:00
schutzbot
ad2fed1a3b Post release version bump
[skip ci]
2023-09-27 08:13:30 +00:00
Michael Vogt
e48360e01c docs: update the samples used in osbuild.1.rst
The file `./samples/base-qcow2.json` used in the osbuild.1.rst
man-page does no longer exists. It was removed in e92b409 and
`samples` is now a symlink into the test data. The closest in
the test data to the original `base-qcow2.json` seems to be
the `fedora-boot.json` so this is now used in the examples
section.

This removes the references to `./samples/base-rpm-qcow2.json`
which was remove in fe95d93. Here `fedora-boot.json` is also
used.
2023-09-18 22:13:09 +02:00
Dusty Mabe
e31b0fe931 stages/ostree.deploy: drop requirement on rootfs option
For Fedora CoreOS we don't actually have any root= kernel command
line option in our baked images. We have services that rely on this
and set up sysroot on first boot. The code in this stage doesn't
require for this option to have been provided and actually gracefully
handles when it's not provided. Let's just change the schema to also
not require it.
2023-09-14 13:02:19 +02:00
schutzbot
4e2f17bfca Post release version bump
[skip ci]
2023-09-13 08:16:15 +00:00
Tomáš Hozza
66b1da022a Actions: add workflow for marking and closing stale issues and PRs
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-09-06 17:49:43 +02:00
Eric Curtin
005d76be97 runners: add autosd runner
autosd is a CentOS Stream 9 derivate. User reported:

 "ValueError: No suitable runner for org.osbuild.autosd"

in Automotive SIG community Matrix. We are going through some name
changes at the moment.
2023-09-05 13:41:51 +02:00
Colin Walters
fd44af4fe7 osbuild.ostree.selinux: xref ostree issue for this
We should drop this stage entirely once we have a way to
force on selinux in ostree.
2023-08-31 14:01:12 +02:00
schutzbot
feee1255b0 Post release version bump
[skip ci]
2023-08-30 08:17:13 +00:00
Colin Walters
2972949d13 tests/ostree-container: Drop hardcoded max layers
This should just defer to rpm-ostree.
xref https://github.com/coreos/rpm-ostree/issues/4530

(If someone cares about reproducibility here, they can specify it;
 alternatively and more reliably, they can create builder container
 images and pin to those)
2023-08-29 10:56:49 +02:00
Brian Masney
e7fb2e1117 stages/dracut: add dracut omit drivers option
Add option to exclude specific kernel modules from the initramfs that's
generated by dracut.

Signed-off-by: Brian Masney <bmasney@redhat.com>
2023-08-28 13:25:04 +02:00
Sanne Raymaekers
6c4e5c5378 .gitlab-ci: update RHEL ga runners 2023-08-28 12:16:24 +02:00
Ondřej Budai
546c8267d1 test/run/stage: cover the btrfs stages
A simple test to make sure that our btrfs stages work.
Updating the testing container is needed, because the old version
didn't have btrfs-progs in it.
2023-08-25 12:35:56 +02:00
Ondřej Budai
b94048dfd4 mounts/org.osbuild.btrfs: add support for compression
Also, add it to the sample manifest.
2023-08-25 12:35:56 +02:00
Ondřej Budai
3bbded4607 org.osbuild.mkfs.btrfs: add support for -m argument
Osbuild doesn't support creating btrfs over multiple devices, thus it should
be fine to have only single and dup in the schema (other options are for raid)
2023-08-25 12:35:56 +02:00
Ondřej Budai
dae3f884bc samples/fedora-boot-btrfs: convert to use subvolumes
We now have a full support for subvolumes in osbuild, let's use
it in the sample.

Co-authored-by: Christian Kellner <christian@kellner.me>
2023-08-25 12:35:56 +02:00
Ondřej Budai
0952ae9933 mounts/org.osbuild.btrfs: add support for mounting subvolumes
Co-authored-by: Christian Kellner <christian@kellner.me>
2023-08-25 12:35:56 +02:00
Ondřej Budai
724183b35c stages: add org.osbuild.btrfs.subvol
A trivial stage to create subvolume on a btrfs partition.
2023-08-25 12:35:56 +02:00
Ondřej Budai
f145a877f6 test/data: include bootable fedora image with btrfs
So we have a quick reference how to work with btrfs-based images.

Co-authored-by: Christian Kellner <christian@kellner.me>
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2023-08-25 12:35:56 +02:00
schutzbot
36516f9fea schutzfile: Update snapshots to 20230824 2023-08-24 18:14:55 +02:00
schutzbot
271f5eff31 Post release version bump
[skip ci]
2023-08-23 15:27:18 +00:00
Sanne Raymaekers
433515cff8 schutzbot: unregister test hosts 2023-08-21 18:46:55 +02:00
Sayan Paul
61da6124ed stages/systemd:support for user service dropin
systemd unit stage will now be able to add user unit dropin,
this is done by adding an additional field:unit-type
which is set to system by default. It also adds ability
to update the unit config with ConditionPathExists.
Relevant testing updated for the new workflow.

Signed-off-by: Sayan Paul <paul.sayan@gmail.com>
2023-08-16 13:23:16 +02:00
Sayan Paul
ed926ecc71 stages/systemd:support timer units
unit pattern updated to incoporate timer units

Signed-off-by: Sayan Paul <paul.sayan@gmail.com>
2023-08-16 13:23:16 +02:00
Brian C. Lane
463d799dfd Remove unused repos as reported by ./tools/check-runners
This removes these unused repos:

fedora-35
fedora-36
rhel-8.8
rhel-9.2

Note that that script also reports that rhel-8.7 and rhel-9.1 do not have
Schutzfile entries. That is because they are used in deploy.sh which
does not use Schutzfile to lookup the urls.
2023-08-16 10:40:05 +02:00
Brian C. Lane
68f4c5bd5f tests: Add a check for valid snapshot urls
This pulls the list of snapshots from the rpmrepo API, greps the
codebase for all uses of rpmrepo.osbuild.org that look like a snapshot
name, and then checks to make sure they are still valid.

This is the same script as osbuild-composer, except that it also skips
checking ./test/data/stages/ which has rpm urls that look like snapshot
urls.
2023-08-16 10:40:05 +02:00
schutzbot
694e956104 Post release version bump
[skip ci]
2023-08-16 08:18:35 +00:00
schutzbot
e8bd5e9c8e schutzfile: Update snapshots to 20230815 2023-08-15 09:50:45 +02:00