embed build details into build as splash screen

This commit is contained in:
Lance Vick 2020-07-16 19:15:03 -07:00
parent bee4c289ca
commit cf88d7ba72
Signed by: lrvick
GPG Key ID: 8E47A1EC35A1551D
4 changed files with 50 additions and 7 deletions

View File

@ -2,8 +2,16 @@ NAME := airgap
IMAGE := local/$(NAME):latest
TARGET := librem13v4
GIT_DATETIME := \
$(shell git log -1 --format=%cd --date=format:'%Y-%m-%d %H:%M:%S')
GIT_EPOCH := $(shell git log -1 --format=%at)
$(shell git log -1 --format=%cd --date=format:'%Y-%m-%d %H:%M:%S' config)
GIT_REF := $(shell git log -1 --format=%H config)
GIT_AUTHOR := $(shell git log -1 --format=%an config)
GIT_KEY := $(shell git log -1 --format=%GP config)
GIT_EPOCH := $(shell git log -1 --format=%at config)
ifeq ($(strip $(shell git status --porcelain 2>/dev/null)),)
GIT_STATE=clean
else
GIT_STATE=dirty
endif
OUT_DIR := build/buildroot/output/images
docker = docker
executables = $(docker)
@ -95,6 +103,10 @@ contain := \
--env TARGET=$(TARGET) \
--env GIT_DATETIME="$(GIT_DATETIME)" \
--env GIT_EPOCH="$(GIT_EPOCH)" \
--env GIT_REF="$(GIT_REF)" \
--env GIT_AUTHOR="$(GIT_AUTHOR)" \
--env GIT_KEY="$(GIT_KEY)" \
--env GIT_STATE="$(GIT_STATE)" \
--security-opt seccomp=unconfined \
--volume $(PWD)/build:/home/build/build \
--volume $(PWD)/config:/home/build/config \

View File

@ -1,27 +1,27 @@
set default="0"
set timeout="10"
menuentry "Buildroot (qwerty)" {
menuentry "AirgapOS (qwerty)" {
linux /boot/bzImage root=/dev/sr0 keymap=qwerty/us
initrd /boot/initrd
}
menuentry "Buildroot (dvorak)" {
menuentry "AirgapOS (dvorak)" {
linux /boot/bzImage root=/dev/sr0 keymap=dvorak
initrd /boot/initrd
}
menuentry "Buildroot (colemak)" {
menuentry "AirgapOS (colemak)" {
linux /boot/bzImage root=/dev/sr0 keymap=colemak/en-latin9
initrd /boot/initrd
}
menuentry "Buildroot (qwertz)" {
menuentry "AirgapOS (qwertz)" {
linux /boot/bzImage root=/dev/sr0 keymap=qwertz/de
initrd /boot/initrd
}
menuentry "Buildroot (azerty)" {
menuentry "AirgapOS (azerty)" {
linux /boot/bzImage root=/dev/sr0 keymap=azerty/fr
initrd /boot/initrd
}

View File

@ -8,4 +8,11 @@ BOARD_DIR="$(dirname $0)"
cp -f ${BOARD_DIR}/grub.cfg ${TARGET_DIR}/boot/grub/grub.cfg
echo "export GIT_REF=\"${GIT_REF}\"" > ${TARGET_DIR}/etc/environment
echo "export GIT_AUTHOR=\"${GIT_AUTHOR}\"" >> ${TARGET_DIR}/etc/environment
echo "export GIT_KEY=\"${GIT_KEY}\"" >> ${TARGET_DIR}/etc/environment
echo "export GIT_DATETIME=\"${GIT_DATETIME}\"" >> ${TARGET_DIR}/etc/environment
echo "export GIT_EPOCH=\"${GIT_EPOCH}\"" >> ${TARGET_DIR}/etc/environment
echo "export GIT_STATE=\"${GIT_STATE}\"" >> ${TARGET_DIR}/etc/environment
exit $?

View File

@ -0,0 +1,24 @@
export EDITOR=/bin/vi
export PATH="/bin:/sbin:/usr/bin:/usr/sbin"
export PS1="[\h \t] \\$ "
source /etc/environment
clear
cat << "EOF"
___ _ _____ _____
/ _ \ (_) | _ / ___|
/ /_\ \_ __ _ __ _ __ _ _ __ | | | \ `--.
| _ | '__| |/ _` |/ _` | '_ \| | | |`--. \
| | | | | | | (_| | (_| | |_) \ \_/ /\__/ /
\_| |_/_| |_|\__, |\__,_| .__/ \___/\____/
__/ | | |
|___/ |_|
EOF
echo "Build Details:"
echo " - Date: $GIT_DATETIME"
echo " - Tree State: $GIT_STATE"
echo " - Committer: $GIT_AUTHOR"
echo " - Commit: $GIT_REF"
echo " - Key: $GIT_KEY"
echo ""