osbuild / osbuild/image-builder
rootless `--in-vm` bootc disk image generation fails with SELinux
Open
Nobody has claimed this yet.
area/docs
area/rootless
bug
- Dominant language
- Go
- Stars
- 77
- Forks
- 103
- Avg merge
- 3d 6h
- Merged PRs (30d)
- 53
Description
Trying to build a bootc disk image rootless using the new --in-vm flag :
ibc build qcow2 \ tekton ✭
--in-vm \
--bootc-build-ref $BUILDER \
--bootc-ref $TARGET_FCOS_IMAGE \
--output-name fedora-coreos-rawhide \
--output-dir output \
--with-buildlog --with-manifest \
--blueprint /srv/shared/blueprint.toml \
--blueprint /srv/qemu/x86_64.toml
Manifest generation step
Building manifest for bootc-based-qcow2
Image building step
starting -Pipeline source org.osbuild.containers-storage: 0079d3e26b7100b691705910fb02815586246c11b4bcff17e455be7741ce6bb4
Build
root: <host>
Pipeline target: 1a68fb1a34ab1c055377e67097c58060f09e7df2a3483577a5eb7f2d94d992e1
Build
root: <host>
runner: org.osbuild.fedora38 (org.osbuild.fedora38)
org.osbuild.container-deploy: 3f49744f03469239837affabb6ae2cc3318ec0c0590801028be6ed896f22d2ba {
"remove-signatures": true
}
075c3ef3bd4cb4de9a23cf92a141f58c0b8f8bf525c86cad2f0fa46571eee94e
umount: /run/osbuild/containers/storage/overlay: not mounted.
WARNING: umount of overlay dir failed with an error: CompletedProcess(args=['umount', '-f', '--lazy', '/run/osbuild/containers/storage/overlay'], returncode=32)
⏱ Duration: 7.71s
org.osbuild.mkdir: 8ad59a9faebf034417cd3cffc15a693bf520e2a5eef30cc46f73635676bdd709 {
"paths": [
{
"path": "/usr/lib/bootc/install",
"parents": true,
"exist_ok": true
},
{
"path": "/usr/lib/ostree",
"parents": true,
"exist_ok": true
}
]
}
⏱ Duration: 0.23s
org.osbuild.selinux: 1a68fb1a34ab1c055377e67097c58060f09e7df2a3483577a5eb7f2d94d992e1 {
"file_contexts": "etc/selinux/targeted/contexts/files/file_contexts",
"exclude_paths": [
"/sysroot"
],
"labels": {
"/usr/bin/mount": "system_u:object_r:install_exec_t:s0",
"/usr/bin/ostree": "system_u:object_r:install_exec_t:s0",
"/usr/bin/umount": "system_u:object_r:install_exec_t:s0"
}
}
setfiles: Could not set context for /run/osbuild/tree/usr/bin/pesto: Invalid argument
Traceback (most recent call last):
File "/run/osbuild/bin/org.osbuild.selinux", line 45, in <module>
r = main(osbuild.api.arguments())
File "/run/osbuild/bin/org.osbuild.selinux", line 26, in main
selinux.setfiles(file_contexts, os.path.normpath(root), target, exclude_paths=exclude_paths)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/run/osbuild/lib/osbuild/util/selinux.py", line 55, in setfiles
subprocess.run(["setfiles", "-F",
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
"-r", root,
^^^^^^^^^^^
...<2 lines>...
f"{root}{path}"],
^^^^^^^^^^^^^^^^^
check=True)
^^^^^^^^^^^
File "/usr/lib64/python3.14/subprocess.py", line 578, in run
raise CalledProcessError(retcode, process.args,
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['setfiles', '-F', '-r', '/run/osbuild/tree', '-e', '/run/osbuild/tree/sysroot', '/run/osbuild/tree/etc/selinux/targeted/contexts/files/file_contexts', '/run/osbuild/tree/']' returned non-zero exit status 255.
⏱ Duration: 0.81s
manifest - failed
Failed
error: error running osbuild: exit status 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the rootless ibc build qcow2 --in-vm command and start at the org.osbuild.selinux step, especially the setfiles invocation shown in the traceback. Investigate why labeling /usr/bin/pesto returns Invalid argument in this mode; done means the same build completes successfully rootless with SELinux enabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 48/100