Add banner_len to store banner length. This is useful to save the banner into dumping mechanisms. Signed-off-by: Eugen Hristev <eugen.hristev@xxxxxxxxxx> --- include/linux/printk.h | 1 + init/version-timestamp.c | 1 + init/version.c | 1 + 3 files changed, 3 insertions(+) diff --git a/include/linux/printk.h b/include/linux/printk.h index 45c663124c9b..5bc617222948 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -12,6 +12,7 @@ struct console; extern const char linux_banner[]; +extern const int banner_len; extern const char linux_proc_banner[]; extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ diff --git a/init/version-timestamp.c b/init/version-timestamp.c index 043cbf80a766..1fdd795be747 100644 --- a/init/version-timestamp.c +++ b/init/version-timestamp.c @@ -28,3 +28,4 @@ struct uts_namespace init_uts_ns = { const char linux_banner[] = "Linux version " UTS_RELEASE " (" LINUX_COMPILE_BY "@" LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION "\n"; +const int banner_len = sizeof(linux_banner); diff --git a/init/version.c b/init/version.c index 94c96f6fbfe6..68d16748b081 100644 --- a/init/version.c +++ b/init/version.c @@ -48,6 +48,7 @@ BUILD_LTO_INFO; struct uts_namespace init_uts_ns __weak; const char linux_banner[] __weak; +const int banner_len __weak; #include "version-timestamp.c" -- 2.43.0