main: spew out a "versioning" tag that's defined in root makefile

This will be useful for tracking bugs of users in the future. Also
lowercase each print and drop exclamation marks because I like this
aesthetic of unofficialness a bit better.
This commit is contained in:
Ivaylo Ivanov
2025-07-08 19:04:34 +03:00
parent 280972aec2
commit 925a60bbf9
2 changed files with 9 additions and 3 deletions

View File

@@ -10,6 +10,7 @@
# o use make's built-in rules and variables
# (this increases performance and avoids hard-to-debug behaviour);
# o print "Entering directory ...";
ARCH ?= aarch64
MAKEFLAGS += -rR --no-print-directory
@@ -204,6 +205,11 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-Wno-builtin-declaration-mismatch -Wno-main -nostdinc \
-I$(srctree)/lib/unic
# Try to get the version from Git has
GIT_VERSION_TAG ?= $(shell git rev-parse --short HEAD 2>/dev/null)
BUILD_DATE ?= $(shell date "+%Y-%m-%d %H:%M:%S" 2>/dev/null)
KBUILD_CFLAGS += -DVER_TAG="\"($(GIT_VERSION_TAG)) - date $(BUILD_DATE)\""
KBUILD_AFLAGS_KERNEL :=
KBUILD_CFLAGS_KERNEL :=
KBUILD_AFLAGS := -D__ASSEMBLY__

View File

@@ -39,11 +39,11 @@ void main(void* dt, void* kernel, void* ramdisk)
printk(-1, "|____/|___| /__|_______ \\____(____ /\\____ |\\___ >__|\n");
printk(-1, " \\/ \\/ \\/ \\/ \\/\n");
printk(-1, "Passed board initialization!\n");
printk(-1, "Welcome to uniLoader!\n");
printk(-1, "passed board initialization\n");
printk(-1, "welcome to uniLoader %s\n", VER_TAG);
/* Copy kernel to memory and boot */
printk(-1, "Booting linux...\n");
printk(-1, "booting linux...\n");
#ifdef __aarch64__
memcpy((void*)CONFIG_PAYLOAD_ENTRY, kernel, (unsigned long) &kernel_size);