Commit aab2890
committed
guestfs: relabel root image after virt-sysprep for Fedora on Debian
virt-sysprep modifies files in the root image (hostname, SSH keys, timezone, etc)
but those modified files don't get SELinux labels because virt-sysprep's
auto-relabeling is disabled with --no-selinux-relabel to avoid the chicken-and-egg
problem where relabeling fails on Debian hosts.
The complete workflow is now:
1. virt-builder creates base image (no SELinux labels)
2. virt-customize --selinux-relabel on base image (correct labels)
3. cp base to root.raw (labels preserved)
4. virt-sysprep customizes root.raw with --no-selinux-relabel (modified files unlabeled)
5. virt-customize --selinux-relabel on root.raw (NEW STEP - fixes all labels)
This ensures all files have correct SELinux contexts before boot, including files
created or modified by virt-sysprep. The relabeling runs on localhost with proper
conditions for Fedora guests on Debian/Ubuntu hosts.
Generated-by: Claude AI
Signed-off-by: Daniel Gomez <[email protected]>1 parent 8787069 commit aab2890
1 file changed
+30
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
115 | 145 | | |
116 | 146 | | |
117 | 147 | | |
| |||
0 commit comments