From 894185bf363fb9a76096f77d4d60c79688ff0085 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 14 May 2019 02:47:55 +0000 Subject: [PATCH] Add overrides/rootfs This is strongly related to https://github.com/coreos/fedora-coreos-config/pull/66 For development iteration, we want the ability to directly overlay binaries. This depends on https://github.com/projectatomic/rpm-ostree/pull/1830 which adds to rpm-ostree the ability to inject ostree refs into the build. We could implement this in cosa by building an RPM (like we do for the overlay mentioned above) but I think that's silly - we end up compressing the data only to immediately decompress it. Plus, while there are advantages to having entries for files in the RPM database, in practice we're lying about having these files built by RPM. So let's just directly generate an OSTree commit from them and inject that. In practice for *this* use case rpm-ostree could actually learn a way to directly consume a directory, but indirecting via OSTree means it's equally easy to manage pre-generated ostree branches too in an efficient way rather than re-committing each time. --- src/cmdlib.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/cmdlib.sh b/src/cmdlib.sh index 12fc85b827..b9a843b28c 100755 --- a/src/cmdlib.sh +++ b/src/cmdlib.sh @@ -239,7 +239,7 @@ runcompose() { local overridesdir=${workdir}/overrides local tmp_overridesdir=${TMPDIR}/override local override_manifest="${tmp_overridesdir}"/coreos-assembler-override-manifest.yaml - if [ -d "${overridesdir}"/rpm ] || [ -n "${ref_is_temp}" ] || [ -d "${configdir}/overlay" ]; then + if [ -d "${overridesdir}" ] || [ -n "${ref_is_temp}" ] || [ -d "${configdir}/overlay" ]; then mkdir "${tmp_overridesdir}" cat > "${override_manifest}" <> "${override_manifest}" << EOF +ostree-override-layers: + - cosa-bin-overlay EOF fi