check vigorously for installed mkimage

It was briefly mentioned in QUICKSTART but somehow managed
to evade the commandlines provided.  And while at it, let's
make errors like this more explicit to avoid extra lookups.
Oh, and fix QUICKSTART so that readers miss the hassle. :)

Thanks Vladimir Karpinsky for pointing this problem out.
This commit is contained in:
Michael Shigorin 2012-01-04 22:30:56 +02:00
parent 426c985da3
commit 0ec7d7cd01
3 changed files with 10 additions and 6 deletions

View File

@ -15,7 +15,7 @@
команды команды
~~~~~~~ ~~~~~~~
- от имени root: - от имени root:
# apt-get install hasher git-core # apt-get install mkimage hasher git-core
# hasher-useradd USER # hasher-useradd USER
- от имени пользователя (после повторного входа): - от имени пользователя (после повторного входа):

View File

@ -10,8 +10,10 @@ MKI_VER_OPTIMAL = 0.2.0
include distcfg.mk include distcfg.mk
include functions.mk include functions.mk
include $(MKIMAGE_PREFIX)/config.mk
ifeq (,$(realpath $(MKIMAGE_PREFIX)/config.mk))
$(error please apt-get install mkimage and have a look at QUICKSTART as well)
endif
ifeq (-,$(shell rpmvercmp $(MKI_VERSION) $(MKI_VER_MINIMAL) | tr -d [0-9])) ifeq (-,$(shell rpmvercmp $(MKI_VERSION) $(MKI_VER_MINIMAL) | tr -d [0-9]))
$(info error: mkimage-$(MKI_VERSION) is too old, please upgrade) $(info error: mkimage-$(MKI_VERSION) is too old, please upgrade)
$(error mkimage is too old, $(MKI_VER_MINIMAL) is minimal supported version) $(error mkimage is too old, $(MKI_VER_MINIMAL) is minimal supported version)
@ -21,6 +23,8 @@ $(info warning: mkimage-$(MKI_VERSION) is suboptimal, consider upgrading)
$(warning consider upgrading mkimage to $(MKI_VER_OPTIMAL) or better) $(warning consider upgrading mkimage to $(MKI_VER_OPTIMAL) or better)
endif endif
include $(MKIMAGE_PREFIX)/config.mk
# reconstruct instead of passing yet another variable # reconstruct instead of passing yet another variable
IMAGE_LINK := $(IMAGE_NAME).$(IMAGE_TYPE) IMAGE_LINK := $(IMAGE_NAME).$(IMAGE_TYPE)
IMAGE_OUTFILE := $(IMAGE_NAME)-$(DATE)-$(ARCH).$(IMAGE_TYPE) IMAGE_OUTFILE := $(IMAGE_NAME)-$(DATE)-$(ARCH).$(IMAGE_TYPE)

View File

@ -45,8 +45,8 @@ build-image: profile/populate
if $(START) $(MAKE) -C $(BUILDDIR)/ $(LOG); then \ if $(START) $(MAKE) -C $(BUILDDIR)/ $(LOG); then \
echo "$(TIME) done (`tail -1 $(BUILDLOG) | cut -f1 -d.`)"; \ echo "$(TIME) done (`tail -1 $(BUILDLOG) | cut -f1 -d.`)"; \
tail -200 "$(BUILDLOG)" $(SHORTEN) \ tail -200 "$(BUILDLOG)" $(SHORTEN) \
| GREP_COLOR="$(ANSI_OK)" \ | GREP_COLOR="$(ANSI_OK)" GREP_OPTIONS="--color=auto" \
grep --color=auto '^\*\* image: .*' ||:; \ grep '^\*\* image: .*' ||:; \
else \ else \
echo -n "$(TIME) failed, see log"; \ echo -n "$(TIME) failed, see log"; \
if [ -z "$(DEBUG)" ]; then \ if [ -z "$(DEBUG)" ]; then \
@ -56,8 +56,8 @@ build-image: profile/populate
echo " above"; \ echo " above"; \
fi; \ fi; \
tail -200 "$(BUILDLOG)" \ tail -200 "$(BUILDLOG)" \
| GREP_COLOR="$(ANSI_FAIL)" \ | GREP_COLOR="$(ANSI_FAIL)" GREP_OPTIONS="--color=auto" \
egrep --color=auto "^(E:|[Ee]rror|[Ww]arning).*"; \ egrep "^((E:|[Ee]rror|[Ww]arning).*)|(.* Stop\.)$$"; \
df -P $(BUILDDIR) | awk 'END { if ($$4 < $(LOWSPACE)) \ df -P $(BUILDDIR) | awk 'END { if ($$4 < $(LOWSPACE)) \
{ print "NB: low space on "$$6" ("$$5" used)"}}'; \ { print "NB: low space on "$$6" ("$$5" used)"}}'; \
fi; \ fi; \