Skip to content

Commit 322cfd5

Browse files
use file_contexts to label /boot/*
1 parent 11db312 commit 322cfd5

File tree

2 files changed

+31
-9
lines changed

2 files changed

+31
-9
lines changed

src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ mpp-vars:
33
filename: $filename
44
ostree_repo: $ostree_repo
55
ostree_ref: $ostree_ref
6+
ostree_commit: $ostree_commit
67
ociarchive: $ociarchive
78
osname: $osname
89
container_imgref: $container_imgref
@@ -40,6 +41,9 @@ mpp-vars:
4041
# the host buildroot is the default if nothing is specified.
4142
# We're still defining it here in an attempt to be explicit.
4243
qemu_stage_buildroot: ""
44+
# root path
45+
deploy_root:
46+
mpp-format-string: "ostree/deploy/{osname}/deploy/{ostree_commit}.0"
4347
mpp-define-images:
4448
- id: image
4549
sector_size:
@@ -349,8 +353,6 @@ pipelines:
349353
options:
350354
labels:
351355
mount://root/boot: system_u:object_r:boot_t:s0
352-
mount://boot/efi: system_u:object_r:boot_t:s0
353-
mount://boot/lost+found: system_u:object_r:lost_found_t:s0
354356
devices:
355357
disk:
356358
type: org.osbuild.loopback
@@ -363,13 +365,7 @@ pipelines:
363365
source: disk
364366
partition:
365367
mpp-format-int: '{image.layout[''root''].partnum}'
366-
target: /sysroot
367-
- name: boot
368-
type: org.osbuild.ext4
369-
source: disk
370-
partition:
371-
mpp-format-int: '{image.layout[''boot''].partnum}'
372-
target: /boot
368+
target: /
373369
- type: org.osbuild.copy
374370
inputs:
375371
tree:
@@ -406,6 +402,30 @@ pipelines:
406402
partition:
407403
mpp-format-int: '{image.layout[''EFI-SYSTEM''].partnum}'
408404
target: /boot/efi
405+
- type: org.osbuild.selinux
406+
inputs:
407+
tree:
408+
type: org.osbuild.tree
409+
origin: org.osbuild.pipeline
410+
references:
411+
- name:tree
412+
options:
413+
file_contexts:
414+
mpp-format-string: "input://tree/{deploy_root}/etc/selinux/targeted/contexts/files/file_contexts"
415+
target: "mount://boot/"
416+
devices:
417+
disk:
418+
type: org.osbuild.loopback
419+
options:
420+
filename: disk.img
421+
partscan: true
422+
mounts:
423+
- name: boot
424+
type: org.osbuild.ext4
425+
source: disk
426+
partition:
427+
mpp-format-int: '{image.layout[''boot''].partnum}'
428+
target: /
409429
- type: org.osbuild.bootupd
410430
options:
411431
bios:

src/runvm-osbuild

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ if [ -z "${deploy_via_container}" ]; then
6969
ostree_repo="file://$(getconfig "ostree-repo")"
7070
fi
7171

72+
ostree_commit=$(getconfig "ostree-commit")
7273
# Since it doesn't exist create loop-control
7374
[ ! -e /dev/loop-control ] && mknod /dev/loop-control c 10 237
7475

@@ -92,6 +93,7 @@ osbuild-mpp \
9293
-D arch=\""$(arch)"\" \
9394
-D ostree_ref=\""${ostree_ref}"\" \
9495
-D ostree_repo=\""${ostree_repo}"\" \
96+
-D ostree_commit=\""${ostree_commit}"\" \
9597
-D filename=\""${filename}"\" \
9698
-D ociarchive=\""${ostree_container}"\" \
9799
-D osname=\""${osname}"\" \

0 commit comments

Comments
 (0)