Commit 07fdc6dd authored by Michael Shigorin's avatar Michael Shigorin

further toplevel logging tweaks

Essentially some more polishing: - image path extracted from downstream build log; - extended error/warning regexp a bit so those with color grep options get even prettier output. Notes: - "1024" a magic number (briefly explained when introduced) moved to a sort of variable; - "100 lines" for tail(1) is a rule-of-thumb taking into account typical amount of hasher/mkimage exhaust given GLOBAL_VERBOSE.
parent cc8982dd
......@@ -33,7 +33,7 @@ $(IMAGEDIR):
postprocess:
@OUTPATH="$(IMAGEDIR)/$(IMAGE_OUTFILE)"; \
echo "** image: $(IMAGE_OUTFILE)" && \
echo "** image: $$OUTPATH" >&2 && \
ln -sf "$(IMAGE_OUTFILE)" "$(IMAGEDIR)/$(IMAGE_FILE)" && \
ln -sf "$(IMAGE_FILE)" "$(IMAGEDIR)/$(LINKPREFIX).$(IMAGE_TYPE)"; \
ln -sf "$${OUTPATH#`pwd`/}" "$(IMAGE_FILE)"; \
......
......@@ -11,6 +11,9 @@ ifdef NICE
START := nice $(shell ionice -c3 echo "ionice -c3" 2>/dev/null)
endif
# in kilobytes (a kilometer is 1024 meters, you know)
LOWSPACE = 1024
# it's also nice to know how long and much it takes
START += time -f "%E %PCPU %Mk"
......@@ -34,15 +37,16 @@ build: profile/populate
fi; \
fi
@if $(START) $(MAKE) -C $(BUILDDIR)/ $(LOG); then \
echo "$(TIME) build done (`tail -1 $(BUILDLOG) | cut -f1 -d. \
|| echo "no log"`)"; \
echo "$(TIME) done (`tail -1 $(BUILDLOG) | cut -f1 -d.`)"; \
tail -200 "$(BUILDLOG)" \
| grep --color=always '^\*\* image: .*' $(SHORTEN) ||:; \
else \
echo "$(TIME) build failed, see log: $(BUILDLOG)" $(SHORTEN); \
echo "$(TIME) failed, see log: $(BUILDLOG)" $(SHORTEN); \
if [ -z "$(DEBUG)" ]; then \
echo "$(TIME) (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) \
tail -200 "$(BUILDLOG)" | egrep "^(E:|[Ee]rror|[Ww]arning).*"; \
df -P $(BUILDDIR) | awk 'END { if ($$4 < $(LOWSPACE)) \
{ print "NB: low space on "$$6" ("$$5" used)"}}'; \
fi
@if [ -n "$(BELL)" ]; then echo -ne '\a' >&2; fi
......@@ -71,7 +71,8 @@ profile/init: distclean
fi $(SHORTEN)
profile/bare: profile/init
@echo "$(TIME) preparing distro config$${DEBUG:+: see $(CONFIG)}" \
@NOTE="$${GLOBAL_VERBOSE:+: $(CONFIG)}"; \
echo "$(TIME) preparing distro config$$NOTE" \
$(SHORTEN)
@$(call try,MKIMAGE_PREFIX,/usr/share/mkimage)
@$(call try,GLOBAL_VERBOSE,)
......
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