aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2012-10-03 18:47:00 +0200
committerSebastian Pipping <sebastian@pipping.org>2012-10-03 18:50:16 +0200
commit773a8801d64f3cb1f7b9106623f827fc098b8b09 (patch)
treee6bedaff33bf3fc47bf4b21e65d1bb92c7bb1e63
parentCheck for file from real_init=FILE rather than /sbin/init (bug #437080) (diff)
downloadgenkernel-773a8801d64f3cb1f7b9106623f827fc098b8b09.tar.gz
genkernel-773a8801d64f3cb1f7b9106623f827fc098b8b09.tar.bz2
genkernel-773a8801d64f3cb1f7b9106623f827fc098b8b09.zip
Use actual kernel config for check of available compression methods (bug #436820)
-rw-r--r--ChangeLog4
-rwxr-xr-xgen_initramfs.sh14
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 <sping@gentoo.org> gen_initramfs.sh:
+ Use actual kernel config for check of available compression methods (bug
+ #436820)
+
03 Oct 2012; Dustin Frisch <dustin.frisch@gmail.com> 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"