Skip to content

Commit 088bc14

Browse files
nikita-dubrovskiidustymabe
authored andcommitted
osbuild: set SELinux labels on qemu-secex image
1 parent 4a392b3 commit 088bc14

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

src/osbuild-manifests/platform.qemu-secex.ipp.yaml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,82 @@ pipelines:
109109
uuid: random
110110
label:
111111
mpp-format-string: '{sd_fs_label}'
112+
# We've created the filesystems. Now let's create the mountpoints (directories)
113+
# on the filesystems and label them with appropriate SELinux labels. This also
114+
# covers things like filesystem autogenerated files like 'lost+found'. The labeling
115+
# will happen once with just the root filesystem mounted and once with the boot
116+
# filesystem mounted too (to make sure we get all potentially hidden mountpoints).
117+
# https://github.com/coreos/fedora-coreos-tracker/issues/1771
118+
- type: org.osbuild.mkdir
119+
options:
120+
paths:
121+
- path: mount://root/boot
122+
mode: 493
123+
devices:
124+
disk:
125+
type: org.osbuild.loopback
126+
options:
127+
filename: disk.img
128+
partscan: true
129+
mounts:
130+
- name: root
131+
type: org.osbuild.xfs
132+
source: disk
133+
partition:
134+
mpp-format-int: '{image_secex.layout[''root''].partnum}'
135+
target: /root-mount-point
136+
- type: org.osbuild.selinux
137+
options:
138+
file_contexts: input://tree/etc/selinux/targeted/contexts/files/file_contexts
139+
target: mount://root/
140+
inputs:
141+
tree:
142+
type: org.osbuild.tree
143+
origin: org.osbuild.pipeline
144+
references:
145+
- name:build
146+
devices:
147+
disk:
148+
type: org.osbuild.loopback
149+
options:
150+
filename: disk.img
151+
partscan: true
152+
mounts:
153+
- name: root
154+
type: org.osbuild.xfs
155+
source: disk
156+
partition:
157+
mpp-format-int: '{image_secex.layout[''root''].partnum}'
158+
target: /
159+
- type: org.osbuild.selinux
160+
options:
161+
file_contexts: input://tree/etc/selinux/targeted/contexts/files/file_contexts
162+
target: mount://root/boot/
163+
inputs:
164+
tree:
165+
type: org.osbuild.tree
166+
origin: org.osbuild.pipeline
167+
references:
168+
- name:build
169+
devices:
170+
disk:
171+
type: org.osbuild.loopback
172+
options:
173+
filename: disk.img
174+
partscan: true
175+
mounts:
176+
- name: root
177+
type: org.osbuild.xfs
178+
source: disk
179+
partition:
180+
mpp-format-int: '{image_secex.layout[''root''].partnum}'
181+
target: /
182+
- name: boot
183+
type: org.osbuild.ext4
184+
source: disk
185+
partition:
186+
mpp-format-int: '{image_secex.layout[''boot''].partnum}'
187+
target: /boot
112188
- type: org.osbuild.copy
113189
inputs:
114190
tree:

0 commit comments

Comments
 (0)