From 632c064f86e8b8b632d87dce5fe3df558b6114d5 Mon Sep 17 00:00:00 2001 From: Ellis Low Date: Thu, 18 Jul 2024 09:17:15 -0400 Subject: [PATCH] Don't use tmpfs in build if not enough RAM Make targets `container-iso-build` and `container-live-iso-build` were running out of memory on a 4GB machine. Check if the machine has 12GB ram for `container-iso-build` or 16GB ram for `container-live-iso-build` before giving podman a tmpfs for build. --- Makefile.am | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index b963fee37c0..7f7fc6d1e95 100644 --- a/Makefile.am +++ b/Makefile.am @@ -367,7 +367,8 @@ container-iso-build: sudo $(CONTAINER_ENGINE) run \ --rm \ --privileged \ - --tmpfs /var/tmp:rw,mode=1777 \ + $(shell test $(shell grep MemTotal /proc/meminfo | awk '{print $$2}') -gt 11000000 && \ + echo --tmpfs /var/tmp:rw,mode=1777) \ -v $(srcdir)/result/build/01-rpm-build:/anaconda-rpms:ro \ -v $(srcdir)/result/iso:/images:z \ $(CONTAINER_ADD_ARGS) \ @@ -397,7 +398,8 @@ container-live-iso-build: --rm \ --tty \ --privileged \ - --tmpfs /var/tmp:rw,mode=1777 \ + $(shell test $(shell grep MemTotal /proc/meminfo | awk '{print $$2}') -gt 15000000 && \ + echo --tmpfs /var/tmp:rw,mode=1777) \ --device /dev/kvm \ -v $(srcdir)/result/build/01-rpm-build:/anaconda-rpms:ro \ -v $(srcdir)/result/iso:/images:z \