No description
Find a file
Dusty Mabe 0da68e9af5 mounts/ostree.deployment: rework unmounting
This unwinds part of a25ae2b. The way the code ended up both
self.tree and self.mountpoint ended up pointing to the exactly
same path and so we'd end up doing two `umount -R` operations
on the same path. This ended up being a duplicate unmount.

On Fedora 39 this yields an error like:

```
mount/ostree.deployment (org.osbuild.ostree.deployment): umount: /var/osbuild/store/stage/uuid-efaac9370d25455d9e8df6d847ecb5b3/data/tree: not mounted
mount/ostree.deployment (org.osbuild.ostree.deployment): Traceback (most recent call last):
mount/ostree.deployment (org.osbuild.ostree.deployment):   File "/var/b/shared/code/github.com/osbuild/osbuild/mounts/org.osbuild.ostree.deployment", line 136, in <module>
mount/ostree.deployment (org.osbuild.ostree.deployment):     main()
mount/ostree.deployment (org.osbuild.ostree.deployment):   File "/var/b/shared/code/github.com/osbuild/osbuild/mounts/org.osbuild.ostree.deployment", line 132, in main
mount/ostree.deployment (org.osbuild.ostree.deployment):     service.main()
mount/ostree.deployment (org.osbuild.ostree.deployment):   File "/var/b/shared/code/github.com/osbuild/osbuild/osbuild/host.py", line 252, in main
mount/ostree.deployment (org.osbuild.ostree.deployment):     self.stop()
mount/ostree.deployment (org.osbuild.ostree.deployment):   File "/var/b/shared/code/github.com/osbuild/osbuild/osbuild/mounts.py", line 126, in stop
mount/ostree.deployment (org.osbuild.ostree.deployment):     self.umount()
mount/ostree.deployment (org.osbuild.ostree.deployment):   File "/var/b/shared/code/github.com/osbuild/osbuild/mounts/org.osbuild.ostree.deployment", line 125, in umount
mount/ostree.deployment (org.osbuild.ostree.deployment):     subprocess.run(["umount", "-R", self.tree],
mount/ostree.deployment (org.osbuild.ostree.deployment):   File "/usr/lib64/python3.12/subprocess.py", line 571, in run
mount/ostree.deployment (org.osbuild.ostree.deployment):     raise CalledProcessError(retcode, process.args,
mount/ostree.deployment (org.osbuild.ostree.deployment): subprocess.CalledProcessError: Command '['umount', '-R', '/var/osbuild/store/stage/uuid-efaac9370d25455d9e8df6d847ecb5b3/data/tree']
' returned non-zero exit status 1.

⏱  Duration: 103s
```

I think this was necessary because of a bug in util-linux that
mean some of the accounting information got out of date when
doing a `mount --move` operation, which we use here. I think this
bug (or bugs) is now fixed [1][2] in util-linux v2.39 (in Fedora 39),
which is now causing the above pasted error on F39.

Let's just add code here that mentions the problem and workaround
it with a loop to keep unmounting (essentially what the umount -R
should have done to overmounted filesystems if the mountinfo/utab
was correct) and also mention when we should be able to drop this
workaround.

[1] a04149fbb7
[2] 8cf6c50757
2024-01-31 16:46:01 -05:00
.devcontainer devcontainer: install parted for test_mount_with_partition 2023-12-22 10:18:29 -05:00
.github test: drop -k from -k stages/test test matrix 2024-01-31 09:24:59 +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: enable partition scanning as an option 2023-12-22 10:18:29 -05:00
docs add --break for requesting a debug shell 2024-01-10 08:39:27 -08:00
inputs inputs/ostree: leverage util/ostree library code 2023-10-16 20:26:10 +02:00
mounts mounts/ostree.deployment: rework unmounting 2024-01-31 16:46:01 -05:00
osbuild Post release version bump 2024-01-31 17:48:02 +00:00
runners runners: add debian runner (based on ubuntu1804) 2024-01-02 18:40:31 +01:00
schemas mounts: support mounting partitions 2023-12-22 10:18:29 -05:00
schutzbot CI: update terraform SHA 2024-01-31 12:34:57 +01:00
selinux docs: document osbuild and selinux integration 2021-10-01 11:02:32 +02:00
sources sources: rename download -> fetch_all 2024-01-26 09:58:48 +01:00
stages stages/test: introduce 'stage_schema' fixture 2024-01-31 17:18:52 +01:00
test test: add new testutil.assert_jsonschema_error_contains() helper 2024-01-23 12:00:59 +01:00
tools osbuild-depsolve-dnf5: Add libdnf5 based depsolving for Fedora 40 2024-01-24 09:55:49 -08: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 Switch rpmbuild to RHEL 8.9/9.3 GA 2024-01-18 19:19:23 +01:00
.mypy.ini osbuild: fix optional-types 2022-07-13 17:31:37 +02:00
.packit.yaml Packit: make COPR builds for new releases in a dedicated project 2023-11-30 14:23:15 +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 osbuild: add "mypy-strict" check 2024-01-23 12:01:45 +01:00
osbuild.spec Post release version bump 2024-01-31 17:48:02 +00:00
README.md Readme: Update project build information 2023-12-05 11:46:16 +01: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 Switch rpmbuild to RHEL 8.9/9.3 GA 2024-01-18 19:19:23 +01:00
setup.cfg tox: add tox 2023-08-01 15:01:13 +02:00
setup.py Post release version bump 2024-01-31 17:48:02 +00:00
tox.ini osbuild: add "mypy-strict" check 2024-01-23 12:01:45 +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

Build

Osbuild is a python script so it is not compiled. To verify changes made to the code use included makefile rules:

  • make lint to run linter on top of the code
  • make test-all to run base set of tests
  • sudo make test-run to run extended set of tests (takes long time)

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.