commit: 3abb33bf0e12e38f453e262392572b0c6d47ea7c Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> AuthorDate: Thu Mar 28 20:37:17 2019 +0000 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> CommitDate: Thu Mar 28 20:37:17 2019 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=3abb33bf
genkernel: tell user that shown kernel version is subject to change When you start with fresh (unused) kernel sources, we will get Kernel Version from KERNEL_DIR. If you already have compiled that KV, genkernel maybe use your existing configuration from /etc/kernels (depends on other settings like --mrproper). Once your new kernel was built and you are saving configs (--save-config), we will save the used configuration in /etc/kernels/kernel-config-${ARCH}-${KV}. If you used --menuconfig during genkernel run to change kernel options like CONFIG_LOCALVERSION or CONFIG_LOCALVERSION_AUTO or have modified kernel's Makefile manually to change version, KV is subject to change once genkernel has called 'make prepare'. With this change we will tell user when KV has changed to end confusion like shown in bug 521778. Closes: https://bugs.gentoo.org/521778 Closes: https://bugs.gentoo.org/352787 Closes: https://bugs.gentoo.org/263927 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> genkernel | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/genkernel b/genkernel index 44c34ba..65b7820 100755 --- a/genkernel +++ b/genkernel @@ -158,9 +158,23 @@ check_distfiles dump_debugcache +KERNCACHE_IS_VALID="no" +if [ "${KERNCACHE}" != "" ] +then + gen_kerncache_is_valid +fi + NORMAL=${BOLD} print_info 1 "Linux Kernel ${BOLD}${KV}${NORMAL} for ${BOLD}${ARCH}${NORMAL}..." print_info 1 ".. with config file ${KERNEL_CONFIG}" +if isTrue "${BUILD_KERNEL}" && ! isTrue "${KERNCACHE_IS_VALID}" +then + print_info 1 "" + print_info 1 "Note: The version above is subject to change (depends on config and status of kernel sources)." + print_info 1 "" +fi + + # Check if BOOTDIR is mounted if ! isTrue "${CMD_INSTALL}" then @@ -203,12 +217,6 @@ else fi fi -KERNCACHE_IS_VALID="no" -if [ "${KERNCACHE}" != "" ] -then - gen_kerncache_is_valid -fi - if isTrue "${BUILD_KERNEL}" && ! isTrue "${KERNCACHE_IS_VALID}" then # Configure kernel @@ -224,6 +232,14 @@ then # KV may have changed due to the configuration get_KV + if [ -f "${TEMP}/.old_kv" ] + then + old_KV=$(cat "${TEMP}/.old_kv") + print_info 1 "Kernel version has changed (probably due to config change) since genkernel start:" + print_info 1 "We are now building Linux kernel ${BOLD}${KV}${NORMAL} for ${BOLD}${ARCH}${NORMAL}..." + else + print_info 2 "Kernel version has not changed since genkernel start." + fi compile_kernel