diff --git a/include/linux/printk.h b/include/linux/printk.h index e4878bb58f663..c12ac4225f31f 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -11,6 +11,7 @@ extern const char linux_banner[]; extern const char linux_proc_banner[]; +extern const char linux_commitid_banner[]; extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ diff --git a/init/main.c b/init/main.c index c787e94cc8982..4f7432755b267 100644 --- a/init/main.c +++ b/init/main.c @@ -894,7 +894,7 @@ void start_kernel(void) */ boot_cpu_init(); page_address_init(); - pr_notice("%s", linux_banner); + pr_notice("%s", linux_commitid_banner); early_security_init(); setup_arch(&command_line); setup_boot_config(); diff --git a/init/version-timestamp.c b/init/version-timestamp.c index 043cbf80a766d..bb6ecbc7ee726 100644 --- a/init/version-timestamp.c +++ b/init/version-timestamp.c @@ -28,3 +28,7 @@ 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 char linux_commitid_banner[] = + "Linux version " UTS_RELEASE " (" LINUX_COMPILE_BY "@" + LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") (" GIT_COMMITID ") " UTS_VERSION "\n"; diff --git a/init/version.c b/init/version.c index f117921811b45..77f80f9000685 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 char linux_commitid_banner[] __weak; #include "version-timestamp.c" diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h index 2596f78e52ef9..ddf90f272530e 100755 --- a/scripts/mkcompile_h +++ b/scripts/mkcompile_h @@ -19,9 +19,12 @@ fi LD_VERSION=$(LC_ALL=C $LD -v | head -n1 | sed -e 's/(compatible with [^)]*)//' -e 's/[[:space:]]*$//') +GIT_COMMITID=$(git log -1 --pretty=format:%h 2>/dev/null) + cat < debian/changelog $sourcename ($packageversion) $distribution; urgency=low * Custom built Linux kernel. + * Git:$(git symbolic-ref --short HEAD 2>/dev/null || true) $(git rev-parse --short HEAD) $(git diff --quiet HEAD || echo "dirty") -- $maintainer $(date -R) EOF