Commit 6f98609
committed
base_image: add SELinux relabeling for Fedora virt-builder images
Fedora guest images created on Debian hosts fail to boot because the filesystem
lacks proper SELinux contexts. All binaries fail with exit code 127 (command not
found) as SELinux blocks execution of files with unlabeled_t context.
Add --selinux-relabel flag to virt-builder invocations when building Fedora
images. This flag applies correct SELinux contexts during image creation, before
first boot, ensuring all files have proper contexts when Fedora starts.
The implementation uses separate tasks for Fedora and non-Fedora builds rather
than conditional argv construction to avoid passing empty string arguments. This
ensures the flag is only present for Fedora builds and cleanly omitted otherwise.
Generated-by: Claude AI
Signed-off-by: Daniel Gomez <[email protected]>1 parent 88f94e7 commit 6f98609
1 file changed
+48
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
35 | 59 | | |
36 | 60 | | |
37 | 61 | | |
| |||
52 | 76 | | |
53 | 77 | | |
54 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
55 | 102 | | |
56 | 103 | | |
57 | 104 | | |
| |||
71 | 118 | | |
72 | 119 | | |
73 | 120 | | |
| 121 | + | |
74 | 122 | | |
75 | 123 | | |
76 | 124 | | |
| |||
0 commit comments