diff --git a/build.sh b/build.sh index 7567e6e823..132f0e1a70 100755 --- a/build.sh +++ b/build.sh @@ -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 diff --git a/src/0001-tools-osbuild-mpp-run-_process_format-for-mpp-embed-.patch b/src/0001-tools-osbuild-mpp-run-_process_format-for-mpp-embed-.patch new file mode 100644 index 0000000000..c7fc1754fd --- /dev/null +++ b/src/0001-tools-osbuild-mpp-run-_process_format-for-mpp-embed-.patch @@ -0,0 +1,50 @@ +From c62e555202eaa3d2e6f460a97b39c37a0a7b3a39 Mon Sep 17 00:00:00 2001 +From: Dusty Mabe +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 +