diff options
author | 2017-01-07 17:13:02 -0800 | |
---|---|---|
committer | 2017-01-07 17:50:38 -0800 | |
commit | 11da80066b6f5c6bc264ab1c80d8716cb7782282 (patch) | |
tree | 0e3c04cbb74d965fe8875d5389f240af3d196c63 | |
parent | gen_cmdline: missing actual commandline option for SSH. (diff) | |
download | genkernel-11da80066b6f5c6bc264ab1c80d8716cb7782282.tar.gz genkernel-11da80066b6f5c6bc264ab1c80d8716cb7782282.tar.bz2 genkernel-11da80066b6f5c6bc264ab1c80d8716cb7782282.zip |
Enhacements and fixes for kernel configuration file handling
1. Default configuration file should be used as last resort [fix]
2. User should be informed which configuration file will be used when compiling kernel (now if ${KERNEL_OUTPUTDIR}/.config is present user is misinformed) [fix]
3. ${KERNEL_OUTPUTDIR}/.config backup if we are going to mrpoper ${KERNEL_OUTPUTDIR} [fix]
Fixes: https://bugs.gentoo.org/show_bug.cgi?id=496512#c1
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-x | gen_configkernel.sh | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/gen_configkernel.sh b/gen_configkernel.sh index 6ca02003..8d53d20a 100755 --- a/gen_configkernel.sh +++ b/gen_configkernel.sh @@ -7,10 +7,10 @@ determine_config_file() { "${CMD_KERNEL_CONFIG}" \ "/etc/kernels/kernel-config-${ARCH}-${KV}" \ "${GK_SHARE}/arch/${ARCH}/kernel-config-${KV}" \ - "${DEFAULT_KERNEL_CONFIG}" \ "${GK_SHARE}/arch/${ARCH}/kernel-config-${VER}.${PAT}" \ "${GK_SHARE}/arch/${ARCH}/generated-config" \ "${GK_SHARE}/arch/${ARCH}/kernel-config" \ + "${DEFAULT_KERNEL_CONFIG}" \ ; do if [ -n "${f}" -a -f "${f}" ] then @@ -36,24 +36,30 @@ config_kernel() { determine_config_file cd "${KERNEL_DIR}" || gen_die 'Could not switch to the kernel directory!' - # Backup current kernel .config - if isTrue "${MRPROPER}" || [ ! -f "${KERNEL_OUTPUTDIR}/.config" ] + if isTrue ${MRPROPER} then - print_info 1 "kernel: Using config from ${KERNEL_CONFIG}" + # Backup current kernel .config if [ -f "${KERNEL_OUTPUTDIR}/.config" ] then - NOW=`date +--%Y-%m-%d--%H-%M-%S` - cp "${KERNEL_OUTPUTDIR}/.config" "${KERNEL_OUTPUTDIR}/.config${NOW}.bak" \ + # Current .config is different then one we are going to use + if ! diff -q "${KERNEL_OUTPUTDIR}"/.config ${KERNEL_CONFIG} + then + NOW=`date +--%Y-%m-%d--%H-%M-%S` + cp "${KERNEL_OUTPUTDIR}/.config" "${KERNEL_OUTPUTDIR}/.config${NOW}.bak" \ || gen_die "Could not backup kernel config (${KERNEL_OUTPUTDIR}/.config)" - print_info 1 " Previous config backed up to .config${NOW}.bak" + print_info 1 " Previous config backed up to .config${NOW}.bak" + fi fi - fi - - if isTrue ${MRPROPER} - then + print_info 1 "kernel: Using config from ${KERNEL_CONFIG}" print_info 1 'kernel: >> Running mrproper...' compile_generic mrproper kernel else + if [ -f "${KERNEL_OUTPUTDIR}/.config" ] + then + print_info 1 "kernel: Using config from ${KERNEL_OUTPUTDIR}/.config" + else + print_info 1 "kernel: Using config from ${KERNEL_CONFIG}" + fi print_info 1 "kernel: --mrproper is disabled; not running 'make mrproper'." fi |