Skip to content

Commit

Permalink
osbuild: backport fix for osbuild-mpp mpp-embed
Browse files Browse the repository at this point in the history
  • Loading branch information
dustymabe committed Jan 9, 2024
1 parent 3a2948a commit 866d635
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
3 changes: 2 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ patch_osbuild() {
mv /usr/bin/osbuild-mpp /usr/lib/osbuild/tools/

# Now all the software is under the /usr/lib/osbuild dir and we can patch
cat /usr/lib/coreos-assembler/0001-create-org.osbuild.bootupd-stage.patch \
cat /usr/lib/coreos-assembler/0001-create-org.osbuild.bootupd-stage.patch \
/usr/lib/coreos-assembler/0001-tools-osbuild-mpp-run-_process_format-for-mpp-embed-.patch \
| patch -d /usr/lib/osbuild -p1

# And then move the files back; supermin appliance creation will need it back
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
From c62e555202eaa3d2e6f460a97b39c37a0a7b3a39 Mon Sep 17 00:00:00 2001
From: Dusty Mabe <[email protected]>
Date: Fri, 5 Jan 2024 00:53:52 -0500
Subject: [PATCH] tools/osbuild-mpp: run _process_format() for mpp-embed dict

So we can use something like mpp-format-string inside of mpp-embed. An
example would be below where we want to substitute the ociarchive var
in using `mpp-format-string: 'file://{ociarchive}'`.

```
version: '2'
mpp-vars:
ociarchive: /path/to/fedora-coreos-39.20240104.dev.2-ostree.x86_64.ociarchive
pipelines:
- name: oci-archive
stages:
- type: org.osbuild.copy
inputs:
inlinefile:
type: org.osbuild.files
origin: org.osbuild.source
mpp-embed:
id: fcos.ociarchive
url:
mpp-format-string: 'file://{ociarchive}'
options:
paths:
- from:
mpp-format-string: input://inlinefile/{embedded['fcos.ociarchive']}
to: tree:///fcos.ociarchive
```
---
tools/osbuild-mpp | 1 +
1 file changed, 1 insertion(+)

diff --git a/tools/osbuild-mpp b/tools/osbuild-mpp
index 018cfa01..6d5ebddd 100755
--- a/tools/osbuild-mpp
+++ b/tools/osbuild-mpp
@@ -1545,6 +1545,7 @@ class ManifestFileV2(ManifestFile):
return self.checksum

def embed_data(ip, mpp):
+ self._process_format(mpp)
uid = mpp["id"]
path = mpp.get("path")
url = mpp.get("url")
--
2.43.0

0 comments on commit 866d635

Please sign in to comment.