lib/profile.mk, build-distro: save current commit, when generating a profile

Images building from the generated profile will have mkimage-profiles
commit information.
This commit is contained in:
Anton Midyukov 2022-02-18 21:48:39 +07:00
parent 7318e05d57
commit 05c3dafcf7
2 changed files with 4 additions and 5 deletions

View File

@ -40,8 +40,4 @@ dot-disk:
fi
@echo "$(ARCH)" >files/.disk/arch
@echo "$(DATE)" >files/.disk/date
@if type -t git >&/dev/null; then \
( cd $(TOPDIR) && test -d .git && \
git show-ref --head -ds -- HEAD ||:) \
>files/.disk/commit 2>/dev/null; \
fi
@if [ -s commit ]; then cp commit files/.disk/; fi

View File

@ -71,6 +71,9 @@ profile/init: distclean
[ "$(CHECK)" = 0 ] || exit 1; \
fi; \
fi; \
if type -t git >&/dev/null && [ -d .git ]; then \
git show -s --format=%H > "$(BUILDDIR)"/commit; \
fi; \
mp-commit -i "$(BUILDDIR)" "derivative profile initialized"; \
if [ -w . ]; then \
rm -f "$(SYMLINK)" && \