[coreboot-gerrit] Patch set updated for coreboot: 365aa68 Export board-status info.
Vladimir Serbinenko (phcoder@gmail.com)
gerrit at coreboot.org
Sun Nov 23 17:19:53 CET 2014
Vladimir Serbinenko (phcoder at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6747
-gerrit
commit 365aa68348793e1e3730a6d38a1814ea39293110
Author: Vladimir Serbinenko <phcoder at gmail.com>
Date: Sat Aug 23 01:08:09 2014 +0200
Export board-status info.
Rather than hunting version across compile tree in board_status,
export it by coreboot itself.
Change-Id: I7f055e6fc077134001ebdb11df7381bbdc71a1fc
Signed-off-by: Vladimir Serbinenko <phcoder at gmail.com>
---
Makefile.inc | 10 ++++++++++
src/include/boot/coreboot_tables.h | 8 ++++++++
src/include/version.h | 1 +
src/lib/coreboot_table.c | 10 ++++++++++
src/lib/version.c | 1 +
5 files changed, 30 insertions(+)
diff --git a/Makefile.inc b/Makefile.inc
index 3b662ef..3719dd5 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -267,6 +267,14 @@ $(obj)/build.h: .xcompile
printf "#ifndef __BUILD_H\n" >> $(obj)/build.ht
printf "#define __BUILD_H\n\n" >> $(obj)/build.ht
printf "#define COREBOOT_VERSION \"$(KERNELVERSION)\"\n" >> $(obj)/build.ht
+ if git update-index -q --refresh >/dev/null; ! git diff-index --quiet HEAD; then \
+ printf "/* `LANG= TZ=UTC git log --date=local --pretty=format:%cd -1` UTC */\n" >> $(obj)/build.ht; \
+ printf "#define COREBOOT_VERSION_TIMESTAMP `LANG= git log --pretty=format:%ct -1`\n" >> $(obj)/build.ht; \
+ else \
+ printf "/* `LANG= TZ=UTC date` */\n" >> $(obj)/build.ht; \
+ printf "#define COREBOOT_VERSION_TIMESTAMP `LANG= date +%s`\n" >> $(obj)/build.ht; \
+ fi
+ printf "#define COREBOOT_ORIGIN_GIT_REVISION \"`LANG= git log remotes/origin/master -1 --format=format:%h`\"\n" >> $(obj)/build.ht
printf "#define COREBOOT_EXTRA_VERSION \"$(COREBOOT_EXTRA_VERSION)\"\n" >> $(obj)/build.ht
printf "#define COREBOOT_BUILD \"`LANG= date`\"\n" >> $(obj)/build.ht
printf "#define COREBOOT_BUILD_YEAR_BCD 0x`LANG= date +"%y"`\n" >> $(obj)/build.ht
@@ -568,6 +576,8 @@ ifeq ($(CONFIG_INCLUDE_CONFIG_FILE),y)
echo "# This image was built using git revision" `git rev-parse HEAD` > $(obj)/config.tmp ; \
sed -e '/^#/d' -e '/^ *$$/d' $(DOTCONFIG) >> $(obj)/config.tmp ; \
$(CBFSTOOL) $@.tmp add -f $(obj)/config.tmp -n config -t raw; rm -f $(obj)/config.tmp ; fi
+ @printf " REVISION build.h\n"
+ if [ -f $(obj)/build.h ]; then $(CBFSTOOL) $@.tmp add -f $(obj)/build.h -n revision -t raw; fi
endif
ifeq ($(CONFIG_VBOOT_VERIFY_FIRMWARE),y)
$(CBFSTOOL) $@.tmp add-stage -f $(VBOOT_STUB) -n $(CONFIG_CBFS_PREFIX)/vboot -c $(CBFS_COMPRESS_FLAG)
diff --git a/src/include/boot/coreboot_tables.h b/src/include/boot/coreboot_tables.h
index 19fc10c..3dc8fb6 100644
--- a/src/include/boot/coreboot_tables.h
+++ b/src/include/boot/coreboot_tables.h
@@ -140,6 +140,14 @@ struct lb_string {
uint8_t string[0];
};
+#define LB_TAG_VERSION_TIMESTAMP 0x0026
+struct lb_timestamp {
+ uint32_t tag;
+ uint32_t size;
+ uint32_t timestamp;
+};
+
+
/* 0xe is taken by v3 */
#define LB_TAG_SERIAL 0x000f
diff --git a/src/include/version.h b/src/include/version.h
index 250cb27..2a70842 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 unsigned int coreboot_version_timestamp;
/* When coreboot was compiled */
extern const char coreboot_compile_time[];
diff --git a/src/lib/coreboot_table.c b/src/lib/coreboot_table.c
index 8d8d970..12090dc 100644
--- a/src/lib/coreboot_table.c
+++ b/src/lib/coreboot_table.c
@@ -298,6 +298,15 @@ static void lb_strings(struct lb_header *header)
}
+static void lb_record_version_timestamp(struct lb_header *header)
+{
+ struct lb_timestamp *rec;
+ rec = (struct lb_timestamp *)lb_new_record(header);
+ rec->tag = LB_TAG_VERSION_TIMESTAMP;
+ rec->size = sizeof(*rec);
+ rec->timestamp = coreboot_version_timestamp;
+}
+
void __attribute__((weak)) lb_board(struct lb_header *header) { /* NOOP */ }
static struct lb_forward *lb_forward(struct lb_header *header, struct lb_header *next_header)
@@ -409,6 +418,7 @@ unsigned long write_coreboot_table(
/* Record our various random string information */
lb_strings(head);
+ lb_record_version_timestamp(head);
/* Record our framebuffer */
lb_framebuffer(head);
diff --git a/src/lib/version.c b/src/lib/version.c
index eb5bbb8..19c14c6 100644
--- a/src/lib/version.c
+++ b/src/lib/version.c
@@ -35,6 +35,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 unsigned int coreboot_version_timestamp = COREBOOT_VERSION_TIMESTAMP;
const char coreboot_compile_time[] = COREBOOT_COMPILE_TIME;
const char coreboot_compile_by[] = COREBOOT_COMPILE_BY;
More information about the coreboot-gerrit
mailing list