Commit b474bff4 authored by Michael Shigorin's avatar Michael Shigorin

iso.mk: low space hint on build failure

Just in case the build.log will be inobvious, and it's easy to diagnose automatically. Thanks Andrey Stroganov for this use case. Thanks for improving the initial implementation go to raorn@ for kind commit lynch and to Yuri Bushmelev for actually suggesting something more concise. BTW the "1024" magic number was taken out of thin air: the "no free space" errors are most likely to happen while forming/populating a chroot (apt/rpm errors out) and chroots are roughly two orders of magnitude heftier than a megabyte.
parent 368cfd26
......@@ -26,4 +26,4 @@ choose_tmpdir() {
}
DIR="`choose_tmpdir`"
mktemp -d "${1:-tmpdir}.XXXXXXXXXX" --tmpdir="${DIR:-..}"
mktemp -d "${1:-tmpdir}.XXXXXXXXXX" --tmpdir="${DIR:-`realpath ..`}"
......@@ -14,7 +14,7 @@ export ARCH ?= $(shell arch | sed 's/i686/i586/')
iso:
@echo -n "** starting image build"
@if test -n "$(DEBUG)"; then \
@if [ -n "$(DEBUG)" ]; then \
echo ": tail -f $(BUILDLOG)" $(SHORTEN); \
else \
echo " (coffee time)"; \
......@@ -26,8 +26,10 @@ iso:
|| echo "no log"`)"; \
else \
echo "** build failed, see log: $(BUILDLOG)" $(SHORTEN); \
if test -z "$(DEBUG)"; then \
if [ -z "$(DEBUG)" ]; then \
echo " (you might want to re-run with DEBUG=1)"; \
fi; \
tail -100 "$(BUILDLOG)" | egrep "^E:|[Ee]rror|[Ww]arning"; \
df -P $(BUILDDIR) | awk 'END { if ($$4 < 1024) \
{ print "** NB: low space on "$$6" ("$$5" used)"}}'; \
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment