Skip to content

Commit daa7046

Browse files
jlebonjschintag
authored andcommitted
Add osbuild patch for org.osbuild.dmverity stage fix
This carries osbuild/osbuild#1845 until it gets to Fedora so that we can unbreak secex builds.
1 parent 27458ef commit daa7046

File tree

3 files changed

+82
-0
lines changed

3 files changed

+82
-0
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ COPY ./ /root/containerbuild/
2323
RUN ./build.sh write_archive_info
2424
RUN ./build.sh make_and_makeinstall
2525
RUN ./build.sh configure_user
26+
RUN ./build.sh patch_osbuild
2627

2728
# clean up scripts (it will get cached in layers, but oh well)
2829
WORKDIR /srv/

build.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ if [ $# -gt 1 ]; then
2222
echo " configure_yum_repos"
2323
echo " install_rpms"
2424
echo " make_and_makeinstall"
25+
echo " patch_osbuild"
2526
exit 1
2627
fi
2728

@@ -160,6 +161,27 @@ write_archive_info() {
160161
prepare_git_artifacts "${srcdir}" /cosa/coreos-assembler-git.json /cosa/coreos-assembler-git.tar.gz
161162
}
162163

164+
patch_osbuild() {
165+
# Add a few patches that either haven't made it into a release or
166+
# that will be obsoleted with other work that will be done soon.
167+
168+
# To make it easier to apply patches we'll move around the osbuild
169+
# code on the system first:
170+
rmdir /usr/lib/osbuild/osbuild
171+
mv /usr/lib/python3.12/site-packages/osbuild /usr/lib/osbuild/
172+
mkdir /usr/lib/osbuild/tools
173+
mv /usr/bin/osbuild-mpp /usr/lib/osbuild/tools/
174+
175+
# Now all the software is under the /usr/lib/osbuild dir and we can patch
176+
patch -d /usr/lib/osbuild -p1 < /usr/lib/coreos-assembler/0001-stages-dmverity-make-device-objects-more-generic.patch
177+
178+
# And then move the files back; supermin appliance creation will need it back
179+
# in the places delivered by the RPM.
180+
mv /usr/lib/osbuild/tools/osbuild-mpp /usr/bin/osbuild-mpp
181+
mv /usr/lib/osbuild/osbuild /usr/lib/python3.12/site-packages/osbuild
182+
mkdir /usr/lib/osbuild/osbuild
183+
}
184+
163185
if [ $# -ne 0 ]; then
164186
# Run the function specified by the calling script
165187
${1}
@@ -174,4 +196,5 @@ else
174196
install_ocp_tools
175197
trust_redhat_gpg_keys
176198
configure_user
199+
patch_osbuild
177200
fi
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
From 5ccbe720ace34866931e2af7f248d5e5c632f9da Mon Sep 17 00:00:00 2001
2+
From: Jonathan Lebon <[email protected]>
3+
Date: Wed, 14 Aug 2024 10:56:11 -0400
4+
Subject: [PATCH] stages/dmverity: make device objects more generic
5+
6+
We need to pass loopback devices for these properties, but the schema
7+
says that there will be a `path` property, so osbuild complains.
8+
9+
osbuild is right of course, but this definitely *did* work in an earlier
10+
version, so something changed. Ideally, we'd narrow down here what
11+
happened exactly, but at the same time this approach of just making the
12+
property more generic matches what's done in e.g. the `zipl.inst` stage
13+
where we also use a loopback device.
14+
15+
For reference, this is where we use this stage:
16+
17+
https://github.com/coreos/coreos-assembler/blob/ba45b296ec11734bafcae7728915016f17137a3d/src/osbuild-manifests/platform.qemu.ipp.yaml#L100-L119
18+
---
19+
stages/org.osbuild.dmverity.meta.json | 20 ++------------------
20+
1 file changed, 2 insertions(+), 18 deletions(-)
21+
22+
diff --git a/stages/org.osbuild.dmverity.meta.json b/stages/org.osbuild.dmverity.meta.json
23+
index 213b5855..4c470838 100644
24+
--- a/stages/org.osbuild.dmverity.meta.json
25+
+++ b/stages/org.osbuild.dmverity.meta.json
26+
@@ -30,27 +30,11 @@
27+
"properties": {
28+
"data_device": {
29+
"type": "object",
30+
- "additionalProperties": false,
31+
- "required": [
32+
- "path"
33+
- ],
34+
- "properties": {
35+
- "path": {
36+
- "type": "string"
37+
- }
38+
- }
39+
+ "additionalProperties": true
40+
},
41+
"hash_device": {
42+
"type": "object",
43+
- "additionalProperties": false,
44+
- "required": [
45+
- "path"
46+
- ],
47+
- "properties": {
48+
- "path": {
49+
- "type": "string"
50+
- }
51+
- }
52+
+ "additionalProperties": true
53+
}
54+
}
55+
}
56+
--
57+
2.46.0
58+

0 commit comments

Comments
 (0)