From 5dc9de8195e316f43d785cc23bb4496cb7f9d470 Mon Sep 17 00:00:00 2001 From: pointer-to-bios Date: Thu, 7 Mar 2024 03:51:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=96=84=E7=BC=96=E8=AF=91=E6=97=B6?= =?UTF-8?q?=E7=94=9F=E6=88=90=E9=AD=94=E6=95=B0=E7=9A=84=E6=97=B6=E9=97=B4?= =?UTF-8?q?=20=E6=9B=B4=E6=94=B9=E7=BC=96=E8=AF=91=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E7=9A=84=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- {src/scripts => scripts}/colorize | 0 {src/scripts => scripts}/depcheck | 0 scripts/magicgen | 7 +++++++ src/Makefile | 6 ++++-- 4 files changed, 11 insertions(+), 2 deletions(-) rename {src/scripts => scripts}/colorize (100%) rename {src/scripts => scripts}/depcheck (100%) create mode 100755 scripts/magicgen diff --git a/src/scripts/colorize b/scripts/colorize similarity index 100% rename from src/scripts/colorize rename to scripts/colorize diff --git a/src/scripts/depcheck b/scripts/depcheck similarity index 100% rename from src/scripts/depcheck rename to scripts/depcheck diff --git a/scripts/magicgen b/scripts/magicgen new file mode 100755 index 0000000..8b9d824 --- /dev/null +++ b/scripts/magicgen @@ -0,0 +1,7 @@ +#!/usr/bin/python + +import time + +curtime = str(int(time.time() * 1000)) + +print(curtime) diff --git a/src/Makefile b/src/Makefile index 7d5a4bb..7e15c45 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2,7 +2,7 @@ ARCH := $(shell uname -m) PWD := $(shell pwd) -SOURCE := ${PWD}/scripts +SOURCE := ${PWD}/../scripts ifeq (${ARCH},x86_64) ASM = nasm ASMFLAGS = -f elf64 @@ -12,7 +12,7 @@ ifdef release release = 1 endif -ALLOCATOR_MAGIC = $(shell doas hwclock | sha512sum | head -c 128 | md5sum | head -c 8) +ALLOCATOR_MAGIC = $(shell "${SOURCE}/magicgen" | sha512sum | head -c 128 | md5sum | head -c 8) SUBOBJS = kernel/kernel.o libk/libk.o rust.o @@ -58,6 +58,8 @@ metaverse.elf: kernel libk rust metaverse.lds .PHONY: kernel libk all clear postproc rust all: postproc metaverse.elf + @echo -e "Build \e[1;32msucceeded\e[0m." + @echo -e "Build ID \e[1;31m$(shell "${SOURCE}/magicgen"|sha512sum|head -c 128|md5sum|head -c 8)\e[0m." postproc: @echo -n -e "\e[36m"