diff --git a/source/firmware/kernel/shell_commands.c b/source/firmware/kernel/shell_commands.c index 4c7683e..324e526 100644 --- a/source/firmware/kernel/shell_commands.c +++ b/source/firmware/kernel/shell_commands.c @@ -21,7 +21,7 @@ static void *cmd_echo_on_cb(const char *cmd); static void *cmd_echo_off_cb(const char *cmd); struct command cmd_kosmos_version = { - .command = "uname", + .command = "kname", .description = "Print current kosmos version.", .command_callback = cmd_kosmos_version_cb }; @@ -55,6 +55,8 @@ static void *cmd_kosmos_version_cb(const char *cmd) write(shell_object.shell_device, MAJOR_VERSION, strlen(MAJOR_VERSION)); write(shell_object.shell_device, ".", 1); write(shell_object.shell_device, MINOR_VERSION, strlen(MINOR_VERSION)); + write(shell_object.shell_device, ".", 1); + write(shell_object.shell_device, BUILD_NUMBER, strlen(BUILD_NUMBER)); return NULL; } diff --git a/source/firmware/version.h b/source/firmware/version.h index 003a627..128e903 100644 --- a/source/firmware/version.h +++ b/source/firmware/version.h @@ -6,5 +6,5 @@ #define KERNEL_VERSION "unknown" #define MAJOR_VERSION "unknown" #define MINOR_VERSION "unknown" - +#define BUILD_NUMBER "unknown" #endif /* VERSION_H */ diff --git a/source/scripts/release_number.py b/source/scripts/release_number.py index 44c235d..d333730 100755 --- a/source/scripts/release_number.py +++ b/source/scripts/release_number.py @@ -12,6 +12,8 @@ def get_current_numbers(): config["sw_major"] = os.environ["SW_MAJOR"] if os.environ.has_key("SW_MINOR"): config["sw_minor"] = os.environ["SW_MINOR"] + if os.environ.has_key("CI_BUILD_ID"): + config["build_id"] = os.environ["CI_BUILD_ID"] return config def generate_include(numbers): @@ -31,6 +33,10 @@ def generate_include(numbers): f.write("#define MINOR_VERSION\t\"" + numbers["sw_minor"] + "\"\n") else: f.write("#define MINOR_VERSION\t\"unknown\"\n") + if numbers.has_key("build_id"): + f.write("#define BUILD_NUMBER\t\"" + numbers["build_id"] + "\"\n") + else: + f.write("#define BUILD_NUMBER\t\"unknown\"\n") f.write("\n#endif /* VERSION_H */\n") f.close()