From 4d44e55c952b6d56c04cda56e83b551d93e561a9 Mon Sep 17 00:00:00 2001 From: cheng2000160 Date: Tue, 11 Jun 2024 21:43:47 +0800 Subject: [PATCH 1/2] Makefile: make sure name of image generated using TN --- Config.uk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Config.uk b/Config.uk index 7d71cd2b..3da6b944 100644 --- a/Config.uk +++ b/Config.uk @@ -233,6 +233,6 @@ endmenu config UK_NAME string "Image name" - default UK_DEFNAME + default tenonos help Name to be used for final image -- Gitee From f4f008078ff207d498a88757263622beb8ee526d Mon Sep 17 00:00:00 2001 From: cheng2000160 Date: Tue, 11 Jun 2024 18:04:11 +0800 Subject: [PATCH 2/2] Makefile:Use TN version information instead of UK version information --- Config.uk | 10 ++-- Makefile | 11 ++--- Makefile.uk | 8 ++-- lib/posix-sysinfo/sysinfo.c | 3 +- lib/ukboot/banner.c | 16 +++---- lib/ukboot/exportsyms.uk | 2 +- lib/ukboot/include/uk/version.h | 8 ++-- lib/ukboot/tenonos_banner.c | 85 +++++++++++++++++++++++++++++++++ lib/ukboot/version.c | 5 +- lib/uklibid/libinfo.S | 14 ++---- plat/common/bootinfo.c | 3 +- version.mk | 8 ++-- 12 files changed, 118 insertions(+), 55 deletions(-) create mode 100644 lib/ukboot/tenonos_banner.c diff --git a/Config.uk b/Config.uk index 3da6b944..dd388219 100644 --- a/Config.uk +++ b/Config.uk @@ -2,15 +2,11 @@ # For a description of the syntax of this configuration file, # see https://www.kernel.org/doc/Documentation/kbuild/Config.in-language.txt. # -mainmenu "Unikraft/$(UK_FULLVERSION) Configuration" +mainmenu "Unikraft/$(_FULLVERSION) Configuration" -config UK_FULLVERSION +config TN_FULLVERSION string - default "$(UK_FULLVERSION)" - -config UK_CODENAME - string - default "$(UK_CODENAME)" + default "$(TN_FULLVERSION)" config UK_ARCH string diff --git a/Makefile b/Makefile index b936d11e..ccb0cbf9 100644 --- a/Makefile +++ b/Makefile @@ -266,10 +266,10 @@ include $(CONFIG_UK_BASE)/version.mk # Compute the full local version string so packages can use it as-is # Need to export it, so it can be got from environment in children (eg. mconf) -ifdef UK_EXTRAVERSION -export UK_FULLVERSION := $(UK_VERSION).$(UK_SUBVERSION).$(UK_EXTRAVERSION)$(shell cd $(CONFIG_UK_BASE); $(SCRIPTS_DIR)/gitsha1) +ifdef TN_EXTRAVERSION +export TN_FULLVERSION := $(TN_VERSION).$(TN_SUBVERSION).$(TN_EXTRAVERSION)$(shell cd $(CONFIG_UK_BASE); $(SCRIPTS_DIR)/gitsha1) else -export UK_FULLVERSION := $(UK_VERSION).$(UK_SUBVERSION)$(shell cd $(CONFIG_UK_BASE); $(SCRIPTS_DIR)/gitsha1) +export TN_FULLVERSION := $(TN_VERSION).$(TN_SUBVERSION)$(shell cd $(CONFIG_UK_BASE); $(SCRIPTS_DIR)/gitsha1) endif # Makefile targets @@ -910,8 +910,7 @@ COMMON_CONFIG_ENV = \ UK_BASE="$(CONFIG_UK_BASE)" \ UK_APP="$(CONFIG_UK_APP)" \ UK_CONFIG="$(UK_CONFIG)" \ - UK_FULLVERSION="$(UK_FULLVERSION)" \ - UK_CODENAME="$(UK_CODENAME)" \ + TN_FULLVERSION="$(TN_FULLVERSION)" \ UK_ARCH="$(CONFIG_UK_ARCH)" \ KCONFIG_DIR="$(KCONFIG_DIR)" \ KCONFIG_LIB_BASE="$(KCONFIG_LIB_BASE)" \ @@ -1090,7 +1089,7 @@ print-vars: $(info [$(origin $V)] $V = <$(flavor $V)>)))) print-version: - @echo $(UK_FULLVERSION) + @echo $(TN_FULLVERSION) ifeq ($(UK_HAVE_DOT_CONFIG),y) print-libs: diff --git a/Makefile.uk b/Makefile.uk index 6689fbf5..a0e17d45 100644 --- a/Makefile.uk +++ b/Makefile.uk @@ -78,13 +78,11 @@ DBGFLAGS-$(CONFIG_DEBUG_SYMBOLS_LVL1) += -g1 DBGFLAGS-$(CONFIG_DEBUG_SYMBOLS_LVL2) += -g2 DBGFLAGS-$(CONFIG_DEBUG_SYMBOLS_LVL3) += -g3 -COMPFLAGS += -D __Unikraft__ -DUK_CODENAME="$(UK_CODENAME)" -COMPFLAGS += -DUK_VERSION=$(UK_VERSION).$(UK_SUBVERSION) -COMPFLAGS += -DUK_FULLVERSION=$(UK_FULLVERSION) +COMPFLAGS += -DTN_VERSION=$(TN_VERSION).$(TN_SUBVERSION) +COMPFLAGS += -DTN_FULLVERSION=$(TN_FULLVERSION) ISR_ARCHFLAGS += -D__INTERRUPTSAFE__ -M4FLAGS += -D __Unikraft__ -DUK_CODENAME="$(UK_CODENAME)" -M4FLAGS += -DUK_VERSION=$(UK_VERSION).$(UK_SUBVERSION) +M4FLAGS += -DTN_VERSION=$(TN_VERSION).$(TN_SUBVERSION) # If GCC supports "-no-pie" flag, we will add this flag to link flags to # override "pie" option, because some distributions will set diff --git a/lib/posix-sysinfo/sysinfo.c b/lib/posix-sysinfo/sysinfo.c index 1d9e6879..586d4a92 100644 --- a/lib/posix-sysinfo/sysinfo.c +++ b/lib/posix-sysinfo/sysinfo.c @@ -67,8 +67,7 @@ static struct utsname utsname = { /* glibc looks into the release field to check the kernel version: * We prepend '5-' in order to be "new enough" for it. */ - .release = "5-" STRINGIFY(UK_CODENAME), - .version = STRINGIFY(UK_FULLVERSION), + .version = STRINGIFY(TN_FULLVERSION), #ifdef CONFIG_ARCH_X86_64 .machine = "x86_64" #elif CONFIG_ARCH_ARM_64 diff --git a/lib/ukboot/banner.c b/lib/ukboot/banner.c index 16660822..a41324ba 100644 --- a/lib/ukboot/banner.c +++ b/lib/ukboot/banner.c @@ -90,8 +90,7 @@ void print_banner(FILE *out) { B_LTR "| | | | | (| | | (_) | _) :_\n"); fprintf(out, B_HL3 " O" B_HL0 "o" B_HL3 "O" B_HL2 "o" B_HL3 "O " B_LTR "._, ._:_:_,\\_._, .__,_:_, \\___)\n"); - fprintf(out, B_TXT "%39s" B_RST "\n", - STRINGIFY(UK_CODENAME) " " STRINGIFY(UK_FULLVERSION)); + fprintf(out, B_TXT "%39s" B_RST "\n", STRINGIFY(TN_FULLVERSION)); #elif CONFIG_LIBUKBOOT_BANNER_POWEREDBY_EA || \ CONFIG_LIBUKBOOT_BANNER_POWEREDBY_EAANSI || \ @@ -107,8 +106,7 @@ void print_banner(FILE *out) { B_LTR "| | | | | (| | | (_) | _) :_\n"); fprintf(out, B_HL3 " \xFE" B_HL0 "\xDC" B_HL3 "\xDF" B_HL2 "\xDC" B_HL3 "\xFE " B_LTR "._, ._:_:_,\\_._, .__,_:_, \\___)\n"); - fprintf(out, B_TXT "%39s" B_RST "\n", - STRINGIFY(UK_CODENAME) " " STRINGIFY(UK_FULLVERSION)); + fprintf(out, B_TXT "%39s" B_RST "\n", STRINGIFY(TN_FULLVERSION)); #elif CONFIG_LIBUKBOOT_BANNER_POWEREDBY_U8 || \ CONFIG_LIBUKBOOT_BANNER_POWEREDBY_U8ANSI || \ @@ -124,19 +122,17 @@ void print_banner(FILE *out) { B_LTR "| | | | | (| | | (_) | _) :_\n"); fprintf(out, B_HL3 " ▚" B_HL0 "▄" B_HL3 "■" B_HL2 "▄" B_HL3 "▞" B_LTR " ._, ._:_:_,\\_._, .__,_:_, \\___)\n"); - fprintf(out, B_TXT "%39s" B_RST "\n", - STRINGIFY(UK_CODENAME) " " STRINGIFY(UK_FULLVERSION)); + fprintf(out, B_TXT "%39s" B_RST "\n", STRINGIFY(TN_FULLVERSION)); #elif CONFIG_LIBUKBOOT_BANNER_CLASSIC fprintf(out, "Welcome to _ __ _____\n"); fprintf(out, " __ _____ (_) /__ _______ _/ _/ /_\n"); fprintf(out, "/ // / _ \\/ / '_// __/ _ `/ _/ __/\n"); fprintf(out, "\\_,_/_//_/_/_/\\_\\/_/ \\_,_/_/ \\__/\n"); - fprintf(out, "%35s\n", - STRINGIFY(UK_CODENAME) " " STRINGIFY(UK_FULLVERSION)); + fprintf(out, "%35s\n", STRINGIFY(TN_FULLVERSION)); #else /* CONFIG_LIBUKBOOT_BANNER_MINIMAL */ - fprintf(out, "Powered by Unikraft " STRINGIFY(UK_CODENAME) - " (" STRINGIFY(UK_FULLVERSION) ")\n"); + fprintf(out, "Powered by Unikraft + (" STRINGIFY(TN_FULLVERSION) ")\n"); #endif } diff --git a/lib/ukboot/exportsyms.uk b/lib/ukboot/exportsyms.uk index 002ed253..705a1165 100644 --- a/lib/ukboot/exportsyms.uk +++ b/lib/ukboot/exportsyms.uk @@ -1,5 +1,5 @@ ukplat_entry_argp ukplat_entry main -uk_version +tn_version uk_boot_shutdown_req diff --git a/lib/ukboot/include/uk/version.h b/lib/ukboot/include/uk/version.h index a1b31c3d..bfeb462d 100644 --- a/lib/ukboot/include/uk/version.h +++ b/lib/ukboot/include/uk/version.h @@ -1,6 +1,6 @@ -#ifndef _UK_VERSION_H -#define _UK_VERSION_H +#ifndef _TN_VERSION_H +#define _TN_VERSION_H -void uk_version(void); +void tn_version(void); -#endif /* _UK_VERSION_H */ +#endif /* _TN_VERSION_H */ diff --git a/lib/ukboot/tenonos_banner.c b/lib/ukboot/tenonos_banner.c new file mode 100644 index 00000000..4f8606e2 --- /dev/null +++ b/lib/ukboot/tenonos_banner.c @@ -0,0 +1,85 @@ +/* Copyright 2024 Hangzhou Yingyi Technology Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ssANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +void print_banner(FILE *out) +{ + fprintf(out, "\n __ __ _ _ _______ ____ _____\n"); + fprintf(out, " \\ \\ / / | | | | |__ __| / __ \\ / ____|\n"); + fprintf(out, " \\ \\ /\\ / /__| | ___ ___ _ __ ___ ___ | |_ ___ | | ___ _ __ ___ _ __ | | | | (___ \n"); + fprintf(out, " \\ \\/ \\/ / _ \\ |/ __/ _ \\| '_ ` _ \\ / _ \\ | __/ _ \\ | |/ _ \\ '_ \\ / _ \\| '_ \\| | | |\\___ \\ \n"); + fprintf(out, " \\ /\\ / __/ | (_| (_) | | | | | | __/ | || (_) | | | __/ | | | (_) | | | | |__| |____) |\n"); + fprintf(out, " \\/ \\/ \\___|_|\\___\\___/|_| |_| |_|\\___| \\__\\___/ |_|\\___|_| |_|\\___/|_| |_|\\____/|_____/ \n\n\n\n"); +#ifdef CONFIG_LIBTNBOOT_BANNER_WELCOME_IMG_AND_TXT + fprintf(out, " ::::: :\n"); + fprintf(out, " :::::::: :::\n"); + fprintf(out, " ::::::::: :::::\n"); + fprintf(out, " .:::::::: ::::::::\n"); + fprintf(out, " :::::::: :::::::::\n"); + fprintf(out, " ::::. ::::::::.\n"); + fprintf(out, " :::::::::: :::::: G:\n"); + fprintf(out, " ::::::::::: :::: GGGGGLG;\n"); + fprintf(out, " :::::::::: :. DGGGGGGGGGGGL\n"); + fprintf(out, " :::::::::: GDGGGGGGGGGGGGGG.E\n"); + fprintf(out, " GDDDDGGGGGGGGGGG:KWWW\n"); + fprintf(out, " DDDDDDDDDGGGGGGGGGG: WWW\n"); + fprintf(out, " W DDDDDDDDGGGGGGGGGGGG L GGGG\n"); + fprintf(out, " GGG. WWW DDDDDDDGGGGGGGGGGGGG LLLLLLLLLL\n"); + fprintf(out, " GDDDDGGGG. KWWWWW DDDDDGGGGGGGGGGGGGGGLLLLLLLLLLLLG\n"); + fprintf(out, " DDDDDDDDGGGGGGGj DWK DDDDDDDDDGGGGGGGGGGGGGGGLLLLLLLLLLLLLL\n"); + fprintf(out, " DEDDDDDDDDGGGGGGGGG DDDDDDDDDDDDGGGGGGGGGGGGGGGGLLLLLLLLLL ED\n"); + fprintf(out, " LGL LDDDDDDDGGGGGGGGGG EEEDDDDDDDDDDDDDDGGGGGGGGGGGGGGGGLLLLG DDDDD\n"); + fprintf(out, " GLLLGG. :DDDDDGGGGGG EEEEEEEDDDDDDDDDDD GGL :GGGGGGGGGGGLG DDDDDDDD\n"); + fprintf(out, " LLLLLLGGLt GDDGG KEEEEEEEEEDDDDDDDD DDDDDGGGG GGGGGGG DDDDDDDDDDD\n"); + fprintf(out, " LLLLLGGGGGGGG DKKKEEEEEEEEEEEDDE DDDDDDDDGGGGGGG G DDDDDDDDDDDDDD\n"); + fprintf(out, " LLLLGGGGGGGGGGG KKKEEEEEEEEEE t K DDDDDDDGGGGGG DDDDDDDDDDDDGGGG;\n"); + fprintf(out, " LGLGGGGGGGGGGG GGD KEEEEEE iEEE;KKKK, LDDDDDG. EEE DDDDDDGGGGGGGGt\n"); + fprintf(out, " GGGGGGGGGGG GGGGGD E LKKKKKKLWWKKKEEi t. KEEEEE DGGGGGGGGGGt\n"); + fprintf(out, " GGGGGGGGG GGGDDDDD jKKKKKKKKEEWWKKKEEEjDEEEEEEE GGGGGGGGj :j\n"); + fprintf(out, " GGGGGGGGG GDDDDDDD .KWWWWWWWWGWWWKKKEEE,EEEEEEEfiGGGGj f LLLLLLLLLL\n"); + fprintf(out, " GGGGGGGGG GDDDDDDD. WWWWWWWWW;WWWWKKKEE EEEEEDED:Gf LL LLLLLLLLLL\n"); + fprintf(out, " :WW GGGGGGGGG fGDDDDDD. WWWWWWWK DKWWWKKKE DDDDDDDD LLLL LLLLLLLLLL.\n"); + fprintf(out, " .WWWW GGGGGGGGGGDG iDDDDt WWWWK iWWKKK jKWKKK DDDDDDDD LLLLLL LLLLLLLLLLL\n"); + fprintf(out, " GG W GGGGGGGDGDDDDDD ,DD WE ,WWWWKKKEEEE ,KK DDDDDDDD K; LLLLLLLG ; f\n"); + fprintf(out, " GGGGG GGGGGGGDDDDDDDDDDD jWWWWWKKKKEEEEDDDD DDDDDDDD WWWW: iLLLLLLL :LLLLLLLL\n"); + fprintf(out, " GGGGGGGGGGGDDDDDDDDDDDDDDDD WKKKKKEEEEDDD D DDDDDDDD WWWWWWW LLLLLG LLLLLLLL\n"); + fprintf(out, " GGGGGGGGGGDDDDDDDDDDDDDDDDEEEE KEEEEED DDDD DDDDDDDD WWWW DG LLLL LLLLLLLL\n"); + fprintf(out, " GGGGGGGGGGGDDDDDDDDDDDDDDEEEEEEEE D DDDDDDD DDDDDDGG K GGGGG LL LLLLLLLL.\n"); + fprintf(out, " GGGGGGGDDDDDD GDDDDDDEEEEEEEEEEE DDDDDDDDG GGGGGGGGjLGGGGGGG jf\n"); + fprintf(out, " DGDDDDDDDD WWW jDDEEEEEEEEEEEE DGDDDGGGG GGGGGGGGGGGGGGGGG\n"); + fprintf(out, " GDDDDDD WWWW; ,EEEEEEEEEEE GGGGGGGGG GGGGGGGGGGGGGGGGG\n"); + fprintf(out, " fDDD KW EEEEEEKK GGGGGGGG GGGGGGGGGGGGGGGGG\n"); + fprintf(out, " ; GD EEKKK GGGGG DGGGGGGGGGGGGGGGGGGG\n"); + fprintf(out, " DDDDD: KK GG DGGGGGGGGGGGGGGGGGGGGGG\n"); + fprintf(out, " GDDDDDDE jGGGGGGGGGGGGGGGG.GGGGGGGG\n"); + fprintf(out, " GDDDDDDEE GGGGGGGGGGGGGGG W GGGGGGGG\n"); + fprintf(out, " DDDDDDEEE GGGGGGGGGGGL. KWWW GLLGGLf\n"); + fprintf(out, " ,LLLLLLLLLL DDDDDDEEE LGGGGGGGGG iWWWW GLLL\n"); + fprintf(out, " LL LLLLLLLLLL DDDDDDEEE.GGLLLGGGGL . L\n"); + fprintf(out, " GLLL LLLLLLLLLLL DDDDDEEEE:GLLLLLLLLL\n"); + fprintf(out, " LLLLG ,LLLLLLLLLL DDDDDEEEE,GLLLLLLLLL\n"); + fprintf(out, " LLLLLLLL LLLLLLt: DDDDDEEEE;GLLLLLLLLL\n"); + fprintf(out, " LLLLLLLL. fLLLLLLLL .DDEEEEEtLLLLLLG;\n"); + fprintf(out, " LLLLLLL LLLLLLLLL EEEEfLLLL;\n"); + fprintf(out, " LLLLL tLLLLLLLL. KGLi\n"); + fprintf(out, " LLLf LLLLLLLLL\n"); + fprintf(out, " GL LLLLLLLLL\n\n\n"); +#endif + fprintf(out, "Powered by tenonos (" STRINGIFY(TN_FULLVERSION) ")\n"); +} + diff --git a/lib/ukboot/version.c b/lib/ukboot/version.c index 559e842d..85f4d69e 100644 --- a/lib/ukboot/version.c +++ b/lib/ukboot/version.c @@ -2,10 +2,9 @@ #include #include -void uk_version(void) +void tn_version(void) { printf("Unikraft " - STRINGIFY(UK_CODENAME) " " - STRINGIFY(UK_FULLVERSION) "\n"); + STRINGIFY(TN_FULLVERSION) "\n"); } diff --git a/lib/uklibid/libinfo.S b/lib/uklibid/libinfo.S index 069600e5..af167a8d 100644 --- a/lib/uklibid/libinfo.S +++ b/lib/uklibid/libinfo.S @@ -23,13 +23,10 @@ /* Only one global header per unikernel is generated */ /* NOTE: Global metadata do not have a libname record */ #if CONFIG_LIBUKLIBID_INFO_UKFULLVERSION - RECORD(UKLI_REC_UKFULLVERSION, .asciz STRINGIFY(UK_FULLVERSION)) + RECORD(UKLI_REC_UKFULLVERSION, .asciz STRINGIFY(TN_FULLVERSION)) #else /* !CONFIG_LIBUKLIBID_INFO_UKFULLVERSION */ - RECORD(UKLI_REC_UKVERSION, .asciz STRINGIFY(UK_VERSION)) + RECORD(UKLI_REC_UKVERSION, .asciz STRINGIFY(TN_VERSION)) #endif /* !CONFIG_LIBUKLIBID_INFO_UKFULLVERSION */ -#if CONFIG_LIBUKLIBID_INFO_UKCODENAME - RECORD(UKLI_REC_UKCODENAME, .asciz STRINGIFY(UK_CODENAME)) -#endif /* CONFIG_LIBUKLIBID_INFO_UKCODENAME */ #if CONFIG_LIBUKLIBID_INFO_COMPILER RECORD(UKLI_REC_COMPILER, .asciz STRINGIFY(__LIBUKLIBID_COMPILER__)) @@ -48,14 +45,11 @@ RECORD(UKLI_REC_LIBNAME, .asciz STRINGIFY(__LIBNAME__)) #if CONFIG_LIBUKLIBID_INFO_LIB_UKVERSION #if CONFIG_LIBUKLIBID_INFO_LIB_UKFULLVERSION - RECORD(UKLI_REC_UKFULLVERSION, .asciz STRINGIFY(UK_FULLVERSION)) + RECORD(UKLI_REC_UKFULLVERSION, .asciz STRINGIFY(TN_FULLVERSION)) #else /* !CONFIG_LIBUKLIBID_INFO_LIB_UKVERSION */ - RECORD(UKLI_REC_UKVERSION, .asciz STRINGIFY(UK_VERSION)) + RECORD(UKLI_REC_UKVERSION, .asciz STRINGIFY(TN_VERSION)) #endif /* !CONFIG_LIBUKLIBID_INFO_LIB_UKVERSION */ #endif /* CONFIG_LIBUKLIBID_INFO_LIB_UKVERSION */ -#if CONFIG_LIBUKLIBID_INFO_LIB_UKCODENAME - RECORD(UKLI_REC_UKCODENAME, .asciz STRINGIFY(UK_CODENAME)) -#endif /* CONFIG_LIBUKLIBID_INFO_LIB_UKCODENAME */ #if CONFIG_LIBUKLIBID_INFO_LIB_COMPILER RECORD(UKLI_REC_COMPILER, .asciz STRINGIFY(__LIBUKLIBID_COMPILER__)) diff --git a/plat/common/bootinfo.c b/plat/common/bootinfo.c index d946a30e..e1baf5bd 100644 --- a/plat/common/bootinfo.c +++ b/plat/common/bootinfo.c @@ -53,8 +53,7 @@ void ukplat_bootinfo_print(void) UK_ASSERT(bi); - uk_pr_info("Unikraft " STRINGIFY(UK_CODENAME) - " (" STRINGIFY(UK_FULLVERSION) ")\n"); + uk_pr_info("Tenonos (" STRINGIFY(TN_FULLVERSION) ")\n"); uk_pr_info("Architecture: " CONFIG_UK_ARCH "\n"); diff --git a/version.mk b/version.mk index cf6a50d9..217bfba6 100644 --- a/version.mk +++ b/version.mk @@ -1,5 +1,3 @@ -UK_VERSION = 0 -UK_SUBVERSION = 16 -UK_EXTRAVERSION = 0 -UK_CODENAME = Telesto -# https://en.wikipedia.org/wiki/Moons_of_Saturn (by discovery year) +TN_VERSION = 0 +TN_SUBVERSION = 1 +TN_EXTRAVERSION = 0 -- Gitee