Skip to content

Commit

Permalink
Accept COSA_SUPERMIN_SIZE from environment to pass as rootfs size to …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
Alexander, Michael committed Nov 20, 2024
1 parent 10260a4 commit c3bf408
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cmdlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit c3bf408

Please sign in to comment.