File tree Expand file tree Collapse file tree 3 files changed +17
-5
lines changed
Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -160,6 +160,7 @@ build_with_buildah() {
160160 # For the source: check if there's only one remote, if so use it with get-url
161161 # For revision: rev-parse
162162 set -- build --security-opt=label=disable --cap-add=all --device /dev/fuse \
163+ --pull=newer --layers=true \
163164 --build-arg-file " $argsfile " -v " $( realpath " ${tempdir} /src" ) " :/run/src \
164165 --build-arg VERSION=" ${VERSION} " \
165166 --label org.opencontainers.image.source=" ${source} " \
@@ -197,9 +198,6 @@ build_with_buildah() {
197198 fi
198199
199200 if [ -n " $DIRECT " ]; then
200- # turn on layer caching in the direct case; it wouldn't hurt in the
201- # supermin path, but it'd be a waste of space on the rootfs
202- set -- " $@ " --layers=true
203201 # output to a tag since it's more convenient for development;
204202 # buildah doesn't support doing both at once
205203 osname=$( eval " $( grep ' NAME=' " src/config/${argsfile} " ) " ; echo " ${NAME} " )
Original file line number Diff line number Diff line change @@ -635,7 +635,7 @@ runcompose_tree() {
635635
636636# Run with cache disk.
637637runvm_with_cache () {
638- local cache_size=${RUNVM_CACHE_SIZE:- 45G }
638+ local cache_size=${RUNVM_CACHE_SIZE:- 50G }
639639 # "cache2" has an explicit label so we can find it in qemu easily
640640 if [ ! -f " ${workdir} " /cache/cache2.qcow2 ]; then
641641 qemu-img create -f qcow2 cache2.qcow2.tmp " $cache_size "
@@ -795,7 +795,7 @@ if [ -n "\${cachedev}" ]; then
795795 mount -o remount,ro ${workdir} /cache
796796 fsfreeze -f ${workdir} /cache
797797 fsfreeze -u ${workdir} /cache
798- umount ${workdir} /cache
798+ umount -R ${workdir} /cache
799799fi
800800umount ${workdir}
801801/sbin/reboot -f
Original file line number Diff line number Diff line change 5555cachedev=$( blkid -lt LABEL=cosa-cache -o device || true)
5656if [ -n " ${cachedev} " ]; then
5757 mount " ${cachedev} " " ${workdir} " /cache
58+ # Also set up container storage on the cache. We use a symlink
59+ # rather than configuring graphroot in containers/storage.conf
60+ # because when osbuild runs it will use the /etc/containers/storage.conf
61+ # from the host (if using host as buildroot) and then will run out
62+ # of space in "${workdir}"/cache/cache-containers-storage inside
63+ # the bwrap environment. Doing it with a symlink means we can
64+ # still use the cache from the host, but inside osbuild it will
65+ # just get a blank /var/lib/containers to operate on.
66+ mkdir -p " ${workdir} " /cache/cache-containers-storage
67+ rm -rf /var/lib/containers
68+ ln -s " ${workdir} " /cache/cache-containers-storage /var/lib/containers
69+ # Prune all containers and images more than a few days old. Our
70+ # inputs here change daily so this should be reasonable.
71+ podman system prune --all --force --filter until=72h
5872else
5973 echo " No cosa-cache filesystem found!"
6074fi
You can’t perform that action at this time.
0 commit comments