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 896B2138010 for ; Wed, 3 Oct 2012 16:51:36 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 590D2E0230; Wed, 3 Oct 2012 16:51:25 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 2D168E0230 for ; Wed, 3 Oct 2012 16:51:25 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8ED1E33D731 for ; Wed, 3 Oct 2012 16:51:24 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id E826DE5436 for ; Wed, 3 Oct 2012 16:51:21 +0000 (UTC) From: "Sebastian Pipping" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sebastian Pipping" Message-ID: <1349283016.773a8801d64f3cb1f7b9106623f827fc098b8b09.sping@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: / X-VCS-Repository: proj/genkernel X-VCS-Files: ChangeLog gen_initramfs.sh X-VCS-Directories: / X-VCS-Committer: sping X-VCS-Committer-Name: Sebastian Pipping X-VCS-Revision: 773a8801d64f3cb1f7b9106623f827fc098b8b09 X-VCS-Branch: master Date: Wed, 3 Oct 2012 16:51:21 +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: aeb7d989-e37b-4aed-aabd-a39724eea609 X-Archives-Hash: 253db18091d1d927b30783e8e87f6eb3 commit: 773a8801d64f3cb1f7b9106623f827fc098b8b09 Author: Sebastian Pipping pipping org> AuthorDate: Wed Oct 3 16:47:00 2012 +0000 Commit: Sebastian Pipping gentoo org> CommitDate: Wed Oct 3 16:50:16 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=773a8801 Use actual kernel config for check of available compression methods (bug #436820) --- ChangeLog | 4 ++++ gen_initramfs.sh | 14 +++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index d453080..96bb1b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ # Distributed under the GPL v2 # $Id$ + 03 Oct 2012; Sebastian Pipping gen_initramfs.sh: + Use actual kernel config for check of available compression methods (bug + #436820) + 03 Oct 2012; Dustin Frisch defaults/linuxrc: With boot parameter real_init=/foo look for ${NEW_ROOT}/foo, not ${NEW_ROOT}/sbin/init (bug #437080) diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 9d070f5..29fa652 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -809,7 +809,15 @@ create_initramfs() { else if isTrue "${COMPRESS_INITRD}" then - if [[ "$(file --brief --mime-type "${KERNEL_CONFIG}")" == application/x-gzip ]]; then + # NOTE: We do not work with ${KERNEL_CONFIG} here, since things like + # "make oldconfig" or --noclean could be in effect. + if [ -f "${KERNEL_DIR}"/.config ]; then + local ACTUAL_KERNEL_CONFIG="${KERNEL_DIR}"/.config + else + local ACTUAL_KERNEL_CONFIG="${KERNEL_CONFIG}" + fi + + if [[ "$(file --brief --mime-type "${ACTUAL_KERNEL_CONFIG}")" == application/x-gzip ]]; then # Support --kernel-config=/proc/config.gz, mainly local CONFGREP=zgrep else @@ -840,12 +848,12 @@ create_initramfs() { set -- ${tuple} kernel_option=$1 cmd_variable_name=$2 - if ${CONFGREP} -q "^${kernel_option}=y" "${KERNEL_CONFIG}" && test -n "${!cmd_variable_name}" ; then + if ${CONFGREP} -q "^${kernel_option}=y" "${ACTUAL_KERNEL_CONFIG}" && test -n "${!cmd_variable_name}" ; then compression=$3 [[ ${COMPRESS_INITRD_TYPE} == best ]] && break fi done - [[ -z "${compression}" ]] && gen_die "None of the initramfs we tried are supported by your kernel (config file \"${KERNEL_CONFIG}\"), strange!?" + [[ -z "${compression}" ]] && gen_die "None of the initramfs compression methods we tried are supported by your kernel (config file \"${ACTUAL_KERNEL_CONFIG}\"), strange!?" ;; *) gen_die "Compression '${COMPRESS_INITRD_TYPE}' unknown"