Skip to content

Commit 14fa9f3

Browse files
shell: modules: kernel: include EXTRAVERSION when printing version
Include the full version in the output of the "kernel version" shell subcommand. Previously, EXTRAVERSION was not included, causing e.g. "3.6.0-rc1" to be printed as "3.6.0". Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
1 parent 1d9441c commit 14fa9f3

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

subsys/shell/modules/kernel_service.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* SPDX-License-Identifier: Apache-2.0
66
*/
77

8+
#include <version.h>
9+
810
#include <zephyr/sys/printk.h>
911
#include <zephyr/shell/shell.h>
1012
#include <zephyr/init.h>
@@ -32,15 +34,10 @@
3234
static int cmd_kernel_version(const struct shell *sh,
3335
size_t argc, char **argv)
3436
{
35-
uint32_t version = sys_kernel_version_get();
36-
3737
ARG_UNUSED(argc);
3838
ARG_UNUSED(argv);
3939

40-
shell_print(sh, "Zephyr version %d.%d.%d",
41-
SYS_KERNEL_VER_MAJOR(version),
42-
SYS_KERNEL_VER_MINOR(version),
43-
SYS_KERNEL_VER_PATCHLEVEL(version));
40+
shell_print(sh, "Zephyr version %s", KERNEL_VERSION_STRING);
4441
return 0;
4542
}
4643

0 commit comments

Comments
 (0)