From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 6EF1B58973 for ; Sat, 23 Jan 2016 22:15:05 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 10F9FE087D; Sat, 23 Jan 2016 22:15:05 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7AA2EE087D for ; Sat, 23 Jan 2016 22:15:04 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9E77A3403C1 for ; Sat, 23 Jan 2016 22:15:03 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E06B3106A for ; Sat, 23 Jan 2016 22:14:58 +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: <1453587267.7eb2709abef8e9774f42a5a43b362125bc5aa82a.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: 7eb2709abef8e9774f42a5a43b362125bc5aa82a X-VCS-Branch: master Date: Sat, 23 Jan 2016 22:14:58 +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: 3ead2ed6-b8dd-4b01-abd1-8c7d34001354 X-Archives-Hash: 38a0eff9a32c3e6fe365a9710b5c7e49 commit: 7eb2709abef8e9774f42a5a43b362125bc5aa82a Author: Robin H. Johnson gentoo org> AuthorDate: Sat Jan 23 22:14:27 2016 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Sat Jan 23 22:14:27 2016 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=7eb2709a gen_configkernel: clean up logic, and correctly fall back to non-generated kconfig for arches where the "generated" kconfig is unusable. Signed-off-by: Robin H. Johnson gentoo.org> gen_configkernel.sh | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/gen_configkernel.sh b/gen_configkernel.sh index 98b6e9c..ac29852 100755 --- a/gen_configkernel.sh +++ b/gen_configkernel.sh @@ -3,28 +3,33 @@ # Fills variable KERNEL_CONFIG determine_config_file() { - if [ "${CMD_KERNEL_CONFIG}" != "" ] - then - KERNEL_CONFIG="${CMD_KERNEL_CONFIG}" - elif [ -f "/etc/kernels/kernel-config-${ARCH}-${KV}" ] - then - KERNEL_CONFIG="/etc/kernels/kernel-config-${ARCH}-${KV}" - elif [ -f "${GK_SHARE}/arch/${ARCH}/kernel-config-${KV}" ] - then - KERNEL_CONFIG="${GK_SHARE}/arch/${ARCH}/kernel-config-${KV}" - elif [ "${DEFAULT_KERNEL_CONFIG}" != "" -a -f "${DEFAULT_KERNEL_CONFIG}" ] - then - KERNEL_CONFIG="${DEFAULT_KERNEL_CONFIG}" - elif [ -f "${GK_SHARE}/arch/${ARCH}/kernel-config-${VER}.${PAT}" ] - then - KERNEL_CONFIG="${GK_SHARE}/arch/${ARCH}/kernel-config-${VER}.${PAT}" - elif [ -f "${GK_SHARE}/arch/${ARCH}/kernel-config" ] + for f in \ + "${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" \ + ; do + if [ -n "${f}" -a -f "${f}" ] + then + if ! grep -sq THIS_CONFIG_IS_BROKEN "$f" + then + KERNEL_CONFIG="$f" && break + fi + fi + done + if [ -z "${KERNEL_CONFIG}" ] then - KERNEL_CONFIG="${GK_SHARE}/arch/${ARCH}/generated-config" - else gen_die 'Error: No kernel .config specified, or file not found!' fi KERNEL_CONFIG="$(readlink -f "${KERNEL_CONFIG}")" + # Validate the symlink result if any + if [ ! -f "${KERNEL_CONFIG}" ] + then + gen_die "Error: No kernel .config: symlinked file not found! ($KERNEL_CONFIG)" + fi } config_kernel() {