No description
Find a file
Michael Vogt 0a2e0bb3d2 stages: add org.osbuild.machine-id stage
This is a variation of PR https://github.com/osbuild/osbuild/pull/960
that put the machine-id handling into it's own stage and adds
explicit handling what should happen with it.

For machine-id(5) we essentially want the following three states
implemented:

1. `first-boot: yes` will ensure that /etc/machine-id is
   in the "uninitialized" state. This means on boot the systemd
   `ConditionFirstBoot` is triggered and a new id in `/etc/machine-id`
   is created. This will work for systemd v247+.
2. `first-boot: no` will ensure that /etc/machine-id exists but
   is empty. This will trigger the creation of a new machine-id but
   will *not* trigger `ConditionFirstBoot`.
3. `first-boot: preserve` will just keep the existing machine-id.
   Note that it will error if there is no /etc/machine-id

Note that the `org.osbuild.rpm` will also create a
`{tree}/etc/machine-id` while it runs to ensure that postinst
scripts will not fail that rely on this file. This is an
implementation detail but unfortunately the rpm stage will
leave an empty machine-id file if it was missing. So we cannot
just remove /etc/machine-id because any following rpm stage
would re-create it again (and we cannot change that without
breaking backward compatiblity). Thanks to the special semantic
that a missing /etc/machine-id and an /etc/machine-id with
the `uninitialized` string are equivalent we don't care.

To support systemd versions below v247 we could offer an option
to remove /etc/machine-id. But the downside of this is that
it would only work if the org.osbuild.machine-id stage is after
the rpm stage.

See also the discussion in PR#960.

Thanks to Tom, Christian for the PR and the background.
2023-11-30 13:30:32 +01:00
.devcontainer devcontainer: include packit, boto3 & more tools 2021-08-17 10:42:03 +02:00
.github tests: run the test_stages category in parallel 2023-11-08 08:10:34 +01:00
assemblers tox: add tox 2023-08-01 15:01:13 +02:00
data devices: add custom udev rule inhibitor mechanism 2021-12-09 00:44:21 +00:00
devices devices/loopback: make setting sector_size meaningful 2023-11-29 10:37:08 +01:00
docs docs: tweak the man-page a bit to make the example more useful 2023-11-17 17:23:40 +01:00
inputs inputs/ostree: leverage util/ostree library code 2023-10-16 20:26:10 +02:00
mounts mounts/org.osbuild.btrfs: add support for compression 2023-08-25 12:35:56 +02:00
osbuild devices/loopback: make setting sector_size meaningful 2023-11-29 10:37:08 +01:00
runners runners: clean up temp files before exiting the runner 2023-11-28 11:50:31 +01:00
schemas schemas/osbuild2: mark version as required 2022-07-25 16:01:48 +02:00
schutzbot schutzbot/terraform: aws instance types rework 2023-11-17 17:27:57 +01:00
selinux docs: document osbuild and selinux integration 2021-10-01 11:02:32 +02:00
sources osbuild/util/ostree: create setup_remote function 2023-10-16 20:26:10 +02:00
stages stages: add org.osbuild.machine-id stage 2023-11-30 13:30:32 +01:00
test tools/osbuild-mpp: set part ID from name if missing 2023-11-29 10:37:08 +01:00
tools tools/osbuild-mpp: set part ID from name if missing 2023-11-29 10:37:08 +01:00
.bandit lint: provide bandit configuration 2023-04-23 21:44:46 +02:00
.editorconfig editorconfig: include markdown specifications 2020-10-23 16:29:50 +02:00
.git-blame-ignore-revs git: ignore isort commit 2022-09-12 13:32:51 +02:00
.gitignore tox: add tox 2023-08-01 15:01:13 +02:00
.gitlab-ci.yml tools: add Fedora 38 runner for OSTree image tests 2023-11-06 13:44:43 +01:00
.mypy.ini osbuild: fix optional-types 2022-07-13 17:31:37 +02:00
.packit.yaml Packit: handle only tags without a 'dot' 2023-10-31 09:21:02 +01:00
.ruff.toml tox: add tox 2023-08-01 15:01:13 +02:00
LICENSE Revert "Fill in the license template" 2019-11-18 12:23:10 +01:00
Makefile test/data/manifests: remove F34 manifests 2023-11-14 10:45:44 -08:00
osbuild.spec Move org.osbuild.experimental.ostree.config to osbuild-ostree subpackage 2023-11-22 19:28:06 +01:00
README.md fix link to developer guide 2023-09-29 07:01:56 -07:00
requirements.txt Makefile: use pytest for nicer output 2020-12-04 18:24:48 +01:00
samples samples: replace with symlink to test data 2021-07-12 18:44:50 +02:00
Schutzfile schutzfile: Update snapshots to 20231101 2023-11-01 10:30:11 +01:00
setup.cfg tox: add tox 2023-08-01 15:01:13 +02:00
setup.py Post release version bump 2023-11-22 08:16:02 +00:00
tox.ini tox: move to pylint 3.0.2 for py312 support 2023-11-15 18:31:56 +01:00

OSBuild

Build-Pipelines for Operating System Artifacts

OSBuild is a pipeline-based build system for operating system artifacts. It defines a universal pipeline description and a build system to execute them, producing artifacts like operating system images, working towards an image build pipeline that is more comprehensible, reproducible, and extendable.

See the osbuild(1) man-page for details on how to run osbuild, the definition of the pipeline description, and more.

Project

Contributing

Please refer to the developer guide to learn about our workflow, code style and more.

Requirements

The requirements for this project are:

  • bubblewrap >= 0.4.0
  • python >= 3.6

Additionally, the built-in stages require:

  • bash >= 5.0
  • coreutils >= 8.31
  • curl >= 7.68
  • qemu-img >= 4.2.0
  • rpm >= 4.15
  • tar >= 1.32
  • util-linux >= 235
  • skopeo

At build-time, the following software is required:

  • python-docutils >= 0.13
  • pkg-config >= 0.29

Testing requires additional software:

  • pytest

Installation

Installing osbuild requires to not only install the osbuild module, but also additional artifacts such as tools (i.e: osbuild-mpp) sources, stages, schemas and SELinux policies.

For this reason, doing an installation from source is not trivial and the easier way to install it is to create the set of RPMs that contain all these components.

This can be done with the rpm make target, i.e:

make rpm

A set of RPMs will be created in the ./rpmbuild/RPMS/noarch/ directory and can be installed in the system using the distribution package manager, i.e:

sudo dnf install ./rpmbuild/RPMS/noarch/*.rpm

Repository

License

  • Apache-2.0
  • See LICENSE file for details.