From 881796039f6a177c6d4ead77242b175e48d962ba Mon Sep 17 00:00:00 2001 From: jief666 Date: Wed, 7 Oct 2020 20:25:31 +0300 Subject: [PATCH] Build id in log and in About menu. --- ebuild.sh | 1 + rEFIt_UEFI/Platform/Settings.cpp | 4 ++-- rEFIt_UEFI/Platform/Settings.h | 1 + rEFIt_UEFI/refit/main.cpp | 2 +- rEFIt_UEFI/refit/menu.cpp | 1 + 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ebuild.sh b/ebuild.sh index 745f66679..cf1874f8e 100755 --- a/ebuild.sh +++ b/ebuild.sh @@ -931,6 +931,7 @@ export BUILD_DIR_ARCH="${BUILD_DIR}/$TARGETARCH" rm -rf ${WORKSPACE}/Build/*.efi rm -rf ${WORKSPACE}/Build/*.zip +#extract build_id from efi instead of Version.h to be 100% sure that name correspond to actual content. dstFileName=CloverX64-"$BUILDTARGET"_"$TOOLCHAIN"-"$(grep -aEo "Clover build id: [^[:cntrl:]]*" < "$BUILD_DIR_ARCH"/CLOVERX64.efi | sed "s/Clover build id: //")" copyBin "$BUILD_DIR_ARCH"/CLOVERX64.efi ${WORKSPACE}/Build/"$dstFileName".efi diff --git a/rEFIt_UEFI/Platform/Settings.cpp b/rEFIt_UEFI/Platform/Settings.cpp index c110ad943..b12f13c26 100644 --- a/rEFIt_UEFI/Platform/Settings.cpp +++ b/rEFIt_UEFI/Platform/Settings.cpp @@ -131,9 +131,9 @@ CONST CHAR8* gFirmwareBuildDate = "unknown"; CONST CHAR8* gBuildInfo = NULL; #endif #ifdef BUILD_ID -constexpr const LString8 gBuildId __attribute__((used)) = "Clover build id: " BUILD_ID; +const LString8 gBuildId __attribute__((used)) = "Clover build id: " BUILD_ID; #else -constexpr const LString8 gBuildId __attribute__((used)) = "Clover build id: " "unknown"; +const LString8 gBuildId __attribute__((used)) = "Clover build id: " "unknown"; #endif const char* path_independant __attribute__((used)) = "path_independant"; diff --git a/rEFIt_UEFI/Platform/Settings.h b/rEFIt_UEFI/Platform/Settings.h index ba295fcbc..ddd82692d 100644 --- a/rEFIt_UEFI/Platform/Settings.h +++ b/rEFIt_UEFI/Platform/Settings.h @@ -809,6 +809,7 @@ extern CONST CHAR16 *gFirmwareRevision; extern CONST CHAR8* gRevisionStr; extern CONST CHAR8* gFirmwareBuildDate; extern CONST CHAR8* gBuildInfo; +extern const LString8 gBuildId; extern BOOLEAN ResumeFromCoreStorage; extern BOOLEAN gRemapSmBiosIsRequire; // syscl: pass argument for Dell SMBIOS here diff --git a/rEFIt_UEFI/refit/main.cpp b/rEFIt_UEFI/refit/main.cpp index 8b5ae689d..9c61faac8 100644 --- a/rEFIt_UEFI/refit/main.cpp +++ b/rEFIt_UEFI/refit/main.cpp @@ -2380,7 +2380,7 @@ RefitMain (IN EFI_HANDLE ImageHandle, } //MsgLog("Starting Clover rev %ls on %ls EFI\n", gFirmwareRevision, gST->FirmwareVendor); MsgLog("Starting %s on %ls EFI\n", gRevisionStr, gST->FirmwareVendor); - + MsgLog("Build id: %s\n", gBuildId.c_str()); if ( gBuildInfo ) DBG("Build with: [%s]\n", gBuildInfo); diff --git a/rEFIt_UEFI/refit/menu.cpp b/rEFIt_UEFI/refit/menu.cpp index 6afda0fc7..48eb49b2f 100644 --- a/rEFIt_UEFI/refit/menu.cpp +++ b/rEFIt_UEFI/refit/menu.cpp @@ -1096,6 +1096,7 @@ void AboutRefit(void) // AboutMenu.AddMenuInfo_f(("Clover Version 5.0")); if ( "unknown"_XS8 != LString8(gRevisionStr) ) AboutMenu.AddMenuInfo_f("%s", gRevisionStr); if ( "unknown"_XS8 != LString8(gFirmwareBuildDate) ) AboutMenu.AddMenuInfo_f(" Build: %s", gFirmwareBuildDate); + if ( "unknown"_XS8 != gBuildId ) AboutMenu.AddMenuInfo_f(" Build id: %s", gBuildId.c_str()); AboutMenu.AddMenuInfo_f(" "); AboutMenu.AddMenuInfo_f("Based on rEFIt (c) 2006-2010 Christoph Pfisterer"); AboutMenu.AddMenuInfo_f("Portions Copyright (c) Intel Corporation");