Commit 31c79183 authored by Alessandro Rubini's avatar Alessandro Rubini

cmd_version: better output, report unsupported builds

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 992dc8d7
...@@ -4,6 +4,6 @@ const char *build_revision = GIT_REVISION; ...@@ -4,6 +4,6 @@ const char *build_revision = GIT_REVISION;
#ifdef CONFIG_DETERMINISTIC_BINARY #ifdef CONFIG_DETERMINISTIC_BINARY
const char *build_date = ""; const char *build_date = "";
#else #else
const char *build_date = ", compiled on: " __DATE__ " " __TIME__; const char *build_date = "Built on " __DATE__ ", " __TIME__ "\n";
#endif #endif
...@@ -5,10 +5,25 @@ ...@@ -5,10 +5,25 @@
extern const char *build_revision, *build_date; extern const char *build_revision, *build_date;
#ifdef CONFIG_DEVELOPER
#define SUPPORT " (unsupported developer build)"
#else
#define SUPPORT ""
#endif
static int cmd_ver(const char *args[]) static int cmd_ver(const char *args[])
{ {
mprintf("WR Core build: %s%s (memory size: %d kB)\n", int hwram = sysc_get_memsize();
build_revision, build_date, sysc_get_memsize());
pp_printf("WR Core build: %s%s\n", build_revision, SUPPORT);
pp_printf("%s", build_date); /* may be empty, or complete with \n */
pp_printf("Built for %d kB RAM, stack is %d bytes\n",
CONFIG_RAMSIZE / 1024, CONFIG_STACKSIZE);
/* hardware reports memory size, with a 16kB granularity */
if ( hwram / 16 != CONFIG_RAMSIZE / 1024 / 16)
pp_printf("WARNING: hardware says %ikB <= RAM < %ikB\n",
hwram, hwram + 16);
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment