aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--com32/sysdump/Makefile9
-rw-r--r--com32/sysdump/main.c7
2 files changed, 15 insertions, 1 deletions
diff --git a/com32/sysdump/Makefile b/com32/sysdump/Makefile
index a64414ad..4ac235a8 100644
--- a/com32/sysdump/Makefile
+++ b/com32/sysdump/Makefile
@@ -26,6 +26,15 @@ TESTFILES =
OBJS = $(patsubst %.c,%.o,$(wildcard *.c))
+# The DATE is set on the make command line when building binaries for
+# official release. Otherwise, substitute a hex string that is pretty much
+# guaranteed to be unique to be unique from build to build.
+ifndef DATE
+DATE := $(shell sh ../gen-id.sh $(VERSION) $(HEXDATE))
+endif
+
+CFLAGS += -DDATE='"$(DATE)"'
+
all: $(MODULES) $(TESTFILES)
sysdump.elf : $(OBJS) $(LIBS) $(C_LIBS)
diff --git a/com32/sysdump/main.c b/com32/sysdump/main.c
index c231c29e..4c58f5f4 100644
--- a/com32/sysdump/main.c
+++ b/com32/sysdump/main.c
@@ -19,10 +19,11 @@
#include <dprintf.h>
#include <console.h>
#include <sys/cpu.h>
+#include "../../version.h"
#include "backend.h"
#include "sysdump.h"
-const char *program = "sysdump";
+const char program[] = "sysdump";
__noreturn die(const char *msg)
{
@@ -32,8 +33,12 @@ __noreturn die(const char *msg)
static void dump_all(struct backend *be, const char *argv[], size_t len)
{
+ static const char version[] = "SYSDUMP " VERSION_STR " " DATE "\n";
+
cpio_init(be, argv, len);
+ cpio_writefile(be, "sysdump", version, sizeof version);
+
dump_memory_map(be);
dump_memory(be);
dump_dmi(be);