From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id BA583139086 for ; Sun, 8 Jan 2017 01:57:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7A0F021C06A; Sun, 8 Jan 2017 01:57:53 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3E12421C06A for ; Sun, 8 Jan 2017 01:57:53 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E9F0C3412F9 for ; Sun, 8 Jan 2017 01:57:51 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E06D1253B for ; Sun, 8 Jan 2017 01:57:49 +0000 (UTC) From: "Robin H. Johnson" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Robin H. Johnson" Message-ID: <1483840238.11da80066b6f5c6bc264ab1c80d8716cb7782282.robbat2@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: / X-VCS-Repository: proj/genkernel X-VCS-Files: gen_configkernel.sh X-VCS-Directories: / X-VCS-Committer: robbat2 X-VCS-Committer-Name: Robin H. Johnson X-VCS-Revision: 11da80066b6f5c6bc264ab1c80d8716cb7782282 X-VCS-Branch: master Date: Sun, 8 Jan 2017 01:57:49 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 32a1be34-064f-442c-afea-8bd9bab60b0b X-Archives-Hash: 5a97f6818743aea680d6936d48c48841 commit: 11da80066b6f5c6bc264ab1c80d8716cb7782282 Author: Tomasz Wasiak poczta onet pl> AuthorDate: Sun Jan 8 01:13:02 2017 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Sun Jan 8 01:50:38 2017 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=11da8006 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 gentoo.org> gen_configkernel.sh | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/gen_configkernel.sh b/gen_configkernel.sh index 6ca0200..8d53d20 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