aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2012-07-09 00:02:29 +0200
committerSebastian Pipping <sebastian@pipping.org>2012-07-09 00:02:29 +0200
commit08e9d742e2ecc246dbece1652810e468f0b6c882 (patch)
tree287ff84aa2f2ffbd28f1fcc63d9b2aad3b964158
parentAdd xts to MODULES_CRYPTO (bug #425028) (diff)
parentImprove wording (diff)
downloadgenkernel-08e9d742e2ecc246dbece1652810e468f0b6c882.tar.gz
genkernel-08e9d742e2ecc246dbece1652810e468f0b6c882.tar.bz2
genkernel-08e9d742e2ecc246dbece1652810e468f0b6c882.zip
Merge branch 'bug-423847'
-rw-r--r--ChangeLog12
-rwxr-xr-xgen_initramfs.sh12
-rwxr-xr-xgenkernel18
3 files changed, 37 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index d3bcf58c..501d9e47 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,18 @@
# Distributed under the GPL v2
# $Id$
+ 08 Jul 2012; Sebastian Pipping <sping@gentoo.org> gen_initramfs.sh,
+ genkernel:
+ Always report used kernel config file
+
+ 08 Jul 2012; Sebastian Pipping <sping@gentoo.org> gen_configkernel.sh,
+ gen_initramfs.sh:
+ Catch case with no initramfs compression supported by kernel (bug #423847)
+
+ 08 Jul 2012; Sebastian Pipping <sping@gentoo.org> gen_configkernel.sh,
+ gen_initramfs.sh:
+ Fix detection of initramfs compression with bzip2 as best candidate
+
08 Jul 2012; Sebastian Pipping <sping@gentoo.org> arch/x86/modules_load,
arch/x86_64/modules_load, defaults/modules_load:
Add xts to MODULES_CRYPTO (bug #425028)
diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index f0b63d9f..43ef1550 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -754,6 +754,13 @@ create_initramfs() {
else
if isTrue "${COMPRESS_INITRD}"
then
+ if [[ "$(file --brief --mime-type "${KERNEL_CONFIG}")" == application/x-gzip ]]; then
+ # Support --kernel-config=/proc/config.gz, mainly
+ local CONFGREP=zgrep
+ else
+ local CONFGREP=grep
+ fi
+
cmd_xz=$(type -p xz)
cmd_lzma=$(type -p lzma)
cmd_bzip2=$(type -p bzip2)
@@ -772,17 +779,18 @@ create_initramfs() {
for tuple in \
'CONFIG_RD_XZ cmd_xz xz' \
'CONFIG_RD_LZMA cmd_lzma lzma' \
- 'CONFIG_RD_BZIP2 cmd_bzip2 bzip' \
+ 'CONFIG_RD_BZIP2 cmd_bzip2 bzip2' \
'CONFIG_RD_GZIP cmd_gzip gzip' \
'CONFIG_RD_LZO cmd_lzop lzop'; do
set -- ${tuple}
kernel_option=$1
cmd_variable_name=$2
- if grep -sq "^${kernel_option}=y" ${KERNEL_DIR}/.config && test -n "${!cmd_variable_name}" ; then
+ if ${CONFGREP} -q "^${kernel_option}=y" "${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!?"
;;
*)
gen_die "Compression '${COMPRESS_INITRD_TYPE}' unknown"
diff --git a/genkernel b/genkernel
index 61dd4938..1cf57fa2 100755
--- a/genkernel
+++ b/genkernel
@@ -117,6 +117,7 @@ done
# get the real arguments for usage...
determine_real_args
+determine_config_file
set_kernel_arch
@@ -129,6 +130,7 @@ check_distfiles
dump_debugcache
NORMAL=${BOLD} print_info 1 "Linux Kernel ${BOLD}${KV}${NORMAL} for ${BOLD}${ARCH}${NORMAL}..."
+print_info 1 ".. with config file ${KERNEL_CONFIG}"
# Check BOOTDIR is mounted
if ! isTrue ${CMD_INSTALL}
@@ -352,10 +354,20 @@ then
[ "${ZFS}" = '1' ] && print_warning 1 'add "dozfs" for ZFS volume management support'
[ "${ZFS}" = '1' ] && print_warning 1 'add either "real_root=ZFS" (bootfs autodetection) or "real_root=ZFS=<dataset>" to boot from a ZFS dataset'
[ "${ISCSI}" = '1' ] && print_warning 1 'add at least "iscsi_initiatorname=<initiator name> iscsi_target=<target name> and iscsi_address=<target ip>" for iscsi support'
- if [ `grep 'CONFIG_EXT[0-9]_FS=' "${KERNEL_DIR}"/.config | wc -l` -ge 2 ]; then
- print_warning 1 'With support for several ext* filesystems around it may be needed to'
- print_warning 1 'add "rootfstype=ext3" or "rootfstype=ext4"'
+
+ if [[ "$(file --brief --mime-type "${KERNEL_CONFIG}")" == application/x-gzip ]]; then
+ # Support --kernel-config=/proc/config.gz, mainly
+ CONFGREP=zgrep
+ else
+ CONFGREP=grep
fi
+
+ if [ `${CONFGREP} 'CONFIG_EXT[0-9]_FS=' "${KERNEL_CONFIG}" | wc -l` -ge 2 ]; then
+ print_warning 1 'With support for several ext* filesystems available, it may be needed to'
+ print_warning 1 'add "rootfstype=ext3" or "rootfstype=ext4" to the list of boot parameters.'
+ fi
+
+ unset CONFGREP
fi
[ "${BOOTRW}" != '' ] && mount -o remount,ro ${BOOTDIR}