rootless `--in-vm` bootc disk image generation fails with SELinux

Đang mở
#2,425 6 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Ít trao đổi
Công nghệ
linux
Lĩnh vực
operating-systems

Hướng nghiên cứu

Tái hiện lệnh ibc build qcow2 --in-vm ở chế độ rootless và bắt đầu từ bước org.osbuild.selinux, đặc biệt là lời gọi setfiles được hiển thị trong traceback. Điều tra lý do việc gán nhãn cho /usr/bin/pesto trả về Invalid argument ở chế độ này; hoàn tất có nghĩa là cùng một bản build hoàn thành thành công ở chế độ rootless khi SELinux được bật.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area/docs area/rootless bug

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
Ngôn ngữ chính
Go
Star
86
Fork
115
Merge trung bình
2 ngày 6 giờ
Pull request đã merge (30 ngày)
48

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của osbuild/image-builder

Tất cả issue của osbuild/image-builder

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.