Skip to content

Commit

Permalink
kernel: banner: Allow for customising version
Browse files Browse the repository at this point in the history
This allows for further (out of tree) customisation of the boot
banner version string when devices boot.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
  • Loading branch information
nordicjm authored and carlescufi committed Aug 21, 2023
1 parent 67ca6e5 commit 77a00f1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ add_custom_command(
-DOUT_FILE=${PROJECT_BINARY_DIR}/include/generated/version.h
-DVERSION_TYPE=KERNEL
-DVERSION_FILE=${ZEPHYR_BASE}/VERSION
-DKERNEL_VERSION_CUSTOMIZATION="${KERNEL_VERSION_CUSTOMIZATION}"
${build_version_argument}
-P ${ZEPHYR_BASE}/cmake/gen_version_h.cmake
DEPENDS ${ZEPHYR_BASE}/VERSION ${git_dependency}
Expand All @@ -570,6 +571,7 @@ if(EXISTS ${APPLICATION_SOURCE_DIR}/VERSION)
-DOUT_FILE=${PROJECT_BINARY_DIR}/include/generated/app_version.h
-DVERSION_TYPE=APP
-DVERSION_FILE=${APPLICATION_SOURCE_DIR}/VERSION
-DAPP_VERSION_CUSTOMIZATION="${APP_VERSION_CUSTOMIZATION}"
${build_version_argument}
-P ${ZEPHYR_BASE}/cmake/gen_version_h.cmake
DEPENDS ${APPLICATION_SOURCE_DIR}/VERSION ${git_dependency}
Expand Down
2 changes: 2 additions & 0 deletions kernel/banner.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
#define BANNER_POSTFIX ""
#endif

#ifndef BANNER_VERSION
#ifdef BUILD_VERSION
#define BANNER_VERSION STRINGIFY(BUILD_VERSION)
#else
#define BANNER_VERSION KERNEL_VERSION_STRING
#endif
#endif

void boot_banner(void)
{
Expand Down
1 change: 1 addition & 0 deletions version.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
#define @VERSION_TYPE@_VERSION_STRING "@@VERSION_TYPE@_VERSION_STRING@"

#define @BUILD_VERSION_NAME@ @@BUILD_VERSION_NAME@@
@@VERSION_TYPE@_VERSION_CUSTOMIZATION@

#endif /* _@VERSION_TYPE@_VERSION_H_ */

0 comments on commit 77a00f1

Please sign in to comment.