[coreboot-gerrit] New patch to review for coreboot: genbuild_h: Show the user name who build the image
Zheng Bao (zheng.bao@amd.com)
gerrit at coreboot.org
Thu Jan 28 09:29:25 CET 2016
Zheng Bao (zheng.bao at amd.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13496
-gerrit
commit 9ffb713e14041bb0eeb0153d21f526f9e0594189
Author: Zheng Bao <fishbaozi at gmail.com>
Date: Thu Jan 28 12:06:34 2016 +0800
genbuild_h: Show the user name who build the image
Use git to check out the user name instead of whoami.
Change-Id: Ib624d17505703338dd9b2afafca056d7320efe5d
Signed-off-by: Zheng Bao <fishbaozi at gmail.com>
---
src/arch/x86/romcc_console.c | 2 ++
src/commonlib/include/commonlib/coreboot_tables.h | 1 +
src/console/init.c | 4 ++--
src/include/version.h | 1 +
src/lib/coreboot_table.c | 1 +
src/lib/version.c | 4 ++++
util/genbuild_h/genbuild_h.sh | 5 +++++
7 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/src/arch/x86/romcc_console.c b/src/arch/x86/romcc_console.c
index fa706d0..c000376 100644
--- a/src/arch/x86/romcc_console.c
+++ b/src/arch/x86/romcc_console.c
@@ -69,6 +69,8 @@ void console_init(void)
COREBOOT_EXTRA_VERSION
" "
COREBOOT_BUILD
+ " "
+ COREBOOT_BUILD_BY
" romstage starting...\n";
console_hw_init();
diff --git a/src/commonlib/include/commonlib/coreboot_tables.h b/src/commonlib/include/commonlib/coreboot_tables.h
index 43adb09..2b66a89 100644
--- a/src/commonlib/include/commonlib/coreboot_tables.h
+++ b/src/commonlib/include/commonlib/coreboot_tables.h
@@ -140,6 +140,7 @@ struct lb_mainboard {
#define LB_TAG_VERSION 0x0004
#define LB_TAG_EXTRA_VERSION 0x0005
#define LB_TAG_BUILD 0x0006
+#define LB_TAG_BUILD_BY 0x000e
#define LB_TAG_COMPILE_TIME 0x0007
#define LB_TAG_COMPILE_BY 0x0008
#define LB_TAG_COMPILE_HOST 0x0009
diff --git a/src/console/init.c b/src/console/init.c
index 8f40abb..6f8f48b 100644
--- a/src/console/init.c
+++ b/src/console/init.c
@@ -43,6 +43,6 @@ void console_init(void)
console_hw_init();
- printk(BIOS_INFO, "\n\ncoreboot-%s%s %s " ENV_STRING " starting...\n",
- coreboot_version, coreboot_extra_version, coreboot_build);
+ printk(BIOS_INFO, "\n\ncoreboot-%s%s %s %s " ENV_STRING " starting...\n",
+ coreboot_version, coreboot_extra_version, coreboot_build, coreboot_build_by);
}
diff --git a/src/include/version.h b/src/include/version.h
index f24b893..232f45c 100644
--- a/src/include/version.h
+++ b/src/include/version.h
@@ -9,6 +9,7 @@ extern const char mainboard_part_number[];
extern const char coreboot_version[];
extern const char coreboot_extra_version[];
extern const char coreboot_build[];
+extern const char coreboot_build_by[];
extern const unsigned int coreboot_version_timestamp;
/* When coreboot was compiled */
diff --git a/src/lib/coreboot_table.c b/src/lib/coreboot_table.c
index 2226f5e..233162e 100644
--- a/src/lib/coreboot_table.c
+++ b/src/lib/coreboot_table.c
@@ -362,6 +362,7 @@ static void lb_strings(struct lb_header *header)
{ LB_TAG_VERSION, coreboot_version, },
{ LB_TAG_EXTRA_VERSION, coreboot_extra_version, },
{ LB_TAG_BUILD, coreboot_build, },
+ { LB_TAG_BUILD_BY, coreboot_build_by, },
{ LB_TAG_COMPILE_TIME, coreboot_compile_time, },
};
unsigned int i;
diff --git a/src/lib/version.c b/src/lib/version.c
index b707e8c..ed5b7fe 100644
--- a/src/lib/version.c
+++ b/src/lib/version.c
@@ -14,6 +14,9 @@
#ifndef COREBOOT_BUILD
#error COREBOOT_BUILD not defined
#endif
+#ifndef COREBOOT_BUILD_BY
+#error COREBOOT_BUILD_BY not defined
+#endif
#ifndef COREBOOT_COMPILE_TIME
#error COREBOOT_COMPILE_TIME not defined
@@ -29,6 +32,7 @@ const char mainboard_part_number[] = CONFIG_MAINBOARD_PART_NUMBER;
const char coreboot_version[] = COREBOOT_VERSION;
const char coreboot_extra_version[] = COREBOOT_EXTRA_VERSION;
const char coreboot_build[] = COREBOOT_BUILD;
+const char coreboot_build_by[] = COREBOOT_BUILD_BY;
const unsigned int coreboot_version_timestamp = COREBOOT_VERSION_TIMESTAMP;
const char coreboot_compile_time[] = COREBOOT_COMPILE_TIME;
diff --git a/util/genbuild_h/genbuild_h.sh b/util/genbuild_h/genbuild_h.sh
index 7f0c768..8336b99 100755
--- a/util/genbuild_h/genbuild_h.sh
+++ b/util/genbuild_h/genbuild_h.sh
@@ -17,6 +17,8 @@
DATE=""
GITREV=""
TIMESOURCE=""
+BUILDBY=Unknown
+USERMAIL=Unknown
export LANG=C
export LC_ALL=C
@@ -28,6 +30,8 @@ if [ -e "${top}/.git" -a -x "$(command -v git)" ]; then
GITREV=$(LANG= git log -1 --format=format:%h)
TIMESOURCE=git
DATE=$(git log --pretty=format:%ct -1)
+ BUILDBY=$(git config user.name)
+ USERMAIL=$(git config user.email)
else
GITREV=Unknown
TIMESOURCE="date"
@@ -61,6 +65,7 @@ printf "#define COREBOOT_BUILD_YEAR_BCD 0x$(our_date "$DATE" +%y)\n"
printf "#define COREBOOT_BUILD_MONTH_BCD 0x$(our_date "$DATE" +%m)\n"
printf "#define COREBOOT_BUILD_DAY_BCD 0x$(our_date "$DATE" +%d)\n"
printf "#define COREBOOT_BUILD_WEEKDAY_BCD 0x$(our_date "$DATE" +%w)\n"
+printf "#define COREBOOT_BUILD_BY \"%s <%s>\"\n" "$BUILDBY" "$USERMAIL"
printf "#define COREBOOT_DMI_DATE \"$(our_date "$DATE" +%m/%d/%Y)\"\n"
printf "\n"
printf "#define COREBOOT_COMPILE_TIME \"$(our_date "$DATE" +%T)\"\n"
More information about the coreboot-gerrit
mailing list