Skip to content

Commit 254f877

Browse files
committed
supermin: add ostree prepare-root config file
Bootc is looking for the prepare-root config file in the buildroot environnement because the main assumption is that it's run from the target container. However, in osbuild, it's run from te buildroot, because podman inside bwrap (inside supermin in our case) causes issues. It's fine for RHCOS and SCOS where we use the target container as the buildroot but we cannot do that for FCOS because we require python in the buildroot. For now, insert a prepare-root file in the supermin VM (use as the buildroot for osbuild) until either : - bootc learn to look into the container for it [1] - we ship python in our images and can use them as buildroot. Another approach would be to layer python and the osbuild dependencies on top of our image and use that as the buildroot, but that would create room for packages drift (what was in the repos at build time?). At least using COSA it's easier to keep track of versions. [1] bootc-dev/bootc#1410
1 parent e204703 commit 254f877

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ mpp-vars:
3737
# matches. Unfortunately for FCOS there is no python so we can't
3838
# really use FCOS as the buildroot so we'll use the host as the
3939
# buildroot there.
40-
buildroot: "name:deployed-tree"
41-
# mpp-if: osname in ['rhcos', 'scos', 'fc']
42-
# then: "name:deployed-tree"
43-
# else:
44-
# mpp-format-string: '{host_as_buildroot}'
40+
buildroot:
41+
mpp-if: osname in ['rhcos', 'scos']
42+
then: "name:deployed-tree"
43+
else:
44+
mpp-format-string: '{host_as_buildroot}'
4545
mpp-define-images:
4646
- id: image
4747
sector_size:

src/supermin-init-prelude.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,13 @@ touch /etc/cosa-supermin
7373
# the missing link. Hehe.
7474
update-alternatives --install /etc/alternatives/iptables iptables /usr/sbin/iptables-legacy 1
7575
update-alternatives --install /etc/alternatives/ip6tables ip6tables /usr/sbin/ip6tables-legacy 1
76+
77+
# To build the disk image using osbuild and bootc install to-filesystem we need to
78+
# have a prepare-root config in the build environnement for bootc to read.
79+
# This workaround can be removed when https://github.com/bootc-dev/bootc/issues/1410
80+
# is fixed or we have python in all streams which allows us to use the OCI image as the buildroot.
81+
# Note that RHCOS and SCOS use the OCI as buildroot so they should not be affected by this.
82+
cat > /usr/lib/ostree/prepare-root.conf <<EOF
83+
[composefs]
84+
enabled = true
85+
EOF

0 commit comments

Comments
 (0)