From 7550f7fedbdddf035bdfbaae516b2283ff43e9de Mon Sep 17 00:00:00 2001 From: Gursewak Mangat Date: Mon, 15 Nov 2021 11:54:36 -0800 Subject: [PATCH] manifest.yaml: Add content_manifest and .json --- manifest.yaml | 23 +++++++++++++++++++ .../05rhcos/usr/lib/tmpfiles.d/buildinfo.conf | 10 ++++++++ 2 files changed, 33 insertions(+) create mode 100644 overlay.d/05rhcos/usr/lib/tmpfiles.d/buildinfo.conf diff --git a/manifest.yaml b/manifest.yaml index 7a4a798b..5174052e 100644 --- a/manifest.yaml +++ b/manifest.yaml @@ -164,6 +164,29 @@ postprocess: # NB: we don't use -f here so we break when this is no longer needed rm -v /etc/iscsi/initiatorname.iscsi + # Add content_manifests dir to have json files for build info + # See https://issues.redhat.com/browse/GRPA-3731 + - | + #!/usr/bin/env bash + set -euo pipefail + + REPOS=`jq .repos /usr/share/rpm-ostree/treefile.json` + ARCH=`jq .basearch /usr/share/rpm-ostree/treefile.json | tr -d '"'` + + . /etc/os-release + mkdir -p /usr/share/buildinfo/content_manifests && cd "$_" && touch $ID-$OSTREE_VERSION.json + # Make an empty json and add all the relevant fields + echo "$(var=$REPOS; jq --argjson repos "$var" '. += + { + "metadata": { + "icm_version": 1, + "icm_spec": "https://raw.githubusercontent.com/containerbuildsystem/atomic-reactor/master/atomic_reactor/schemas/content_manifest.json", + "image_layer_index": 1 + }, + "content_sets": $repos, + "image_contents": [] + }' $ID-$OSTREE_VERSION.json)" > $ID-$OSTREE_VERSION.json + etc-group-members: - wheel - sudo diff --git a/overlay.d/05rhcos/usr/lib/tmpfiles.d/buildinfo.conf b/overlay.d/05rhcos/usr/lib/tmpfiles.d/buildinfo.conf new file mode 100644 index 00000000..f0b391f6 --- /dev/null +++ b/overlay.d/05rhcos/usr/lib/tmpfiles.d/buildinfo.conf @@ -0,0 +1,10 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +# See tmpfiles.d(5) for details + +L /var/roothome/buildinfo - - - - /usr/share/buildinfo \ No newline at end of file