forked from altcloud/mkimage-profiles
downstream postprocessing symlinks tweaked
The bigger goal was being able to set up build in a way that would allow for images (with configs and logs) be deposited in per-IMAGE_NAME subdirectories of IMAGEDIR; that's not done yet but a part of it is ready. NB: in BUILDDIR, symlinking the just-built image is now replaced with symlinking the IMAGEDIR since its location is then predictable thus .gitignore-able for further work on a generated profile, and more documentable as well. It's not a hard change though, if you miss the image link just drop me a note (or a commit).
This commit is contained in:
parent
07fdc6dd9b
commit
3c1bca535c
@ -1,14 +1,15 @@
|
||||
# stage 4: dive into mkimage
|
||||
|
||||
GLOBAL_BUILDDIR ?= $(shell pwd)
|
||||
LINKPREFIX := mkimage-profiles
|
||||
CURRENT_LINK := mkimage-profiles
|
||||
OUT_LINK := out
|
||||
|
||||
include distcfg.mk
|
||||
include functions.mk
|
||||
include $(MKIMAGE_PREFIX)/config.mk
|
||||
|
||||
# reconstruct instead of passing yet another variable
|
||||
IMAGE_FILE := $(IMAGE_NAME).$(IMAGE_TYPE)
|
||||
IMAGE_LINK := $(IMAGE_NAME).$(IMAGE_TYPE)
|
||||
IMAGE_OUTFILE := $(IMAGE_NAME)-$(DATE)-$(ARCH).$(IMAGE_TYPE)
|
||||
MKI_PACK_RESULTS = $(IMAGE_PACKTYPE):$(IMAGE_OUTFILE)
|
||||
|
||||
@ -34,9 +35,9 @@ $(IMAGEDIR):
|
||||
postprocess:
|
||||
@OUTPATH="$(IMAGEDIR)/$(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)"; \
|
||||
ln -sf "$(IMAGE_OUTFILE)" "$(IMAGEDIR)/$(IMAGE_LINK)" && \
|
||||
ln -sf "$${IMAGEDIR#`pwd`/}" "$(OUT_LINK)"; \
|
||||
ln -sf "$(IMAGE_LINK)" $(OUT_LINK)/"$(CURRENT_LINK).$(IMAGE_TYPE)"; \
|
||||
if [ -n "$(GLOBAL_DEBUG)" ]; then \
|
||||
cp -a build.log "$$OUTPATH.log"; \
|
||||
cp -a distcfg.mk "$$OUTPATH.cfg"; \
|
||||
|
Loading…
Reference in New Issue
Block a user