From c3bf40839837024ba39e9dc087b7e32cc48bbf92 Mon Sep 17 00:00:00 2001 From: "Alexander, Michael" Date: Wed, 20 Nov 2024 11:17:49 -0500 Subject: [PATCH] Accept COSA_SUPERMIN_SIZE from environment to pass as rootfs size to supermin. When 'supermin --build ...' generates the rootfs, kernel, and initrd, it's passed a size to use for the rootfs. That sets the upper bound on the ostree that can be added to the rootfs of the images cosa generates. It was hardcoded to 10G, which is a reasonable starting point, but different use conditions can easily exceed that. For now, follow the COSA_SUPERMIN_MEMORY example and expose an optional COSA_SUPERMIN_SIZE environment variable that allows a caller to override the rootfs size in case they need the rootfs to be bigger or smaller than the default 10G. --- src/cmdlib.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cmdlib.sh b/src/cmdlib.sh index 2466be8470..c330678183 100755 --- a/src/cmdlib.sh +++ b/src/cmdlib.sh @@ -770,8 +770,10 @@ umount ${workdir} EOF chmod a+x "${vmpreparedir}"/init (cd "${vmpreparedir}" && tar -czf init.tar.gz --remove-files init) + + size_default=10G # put the supermin output in a separate file since it's noisy - if ! supermin --build "${vmpreparedir}" --size 10G -f ext2 -o "${vmbuilddir}" \ + if ! supermin --build "${vmpreparedir}" --size "${COSA_SUPERMIN_SIZE:-${size_default}}" -f ext2 -o "${vmbuilddir}" \ &> "${tmp_builddir}/supermin.out"; then cat "${tmp_builddir}/supermin.out" fatal "Failed to run: supermin --build"