From 88892f5df2453f959539c444a4d0ac161ec70d8f Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sun, 8 Jul 2012 23:39:10 +0200 Subject: [PATCH 1/5] Use proper ${KERNEL_CONFIG} rather than ${KERNEL_DIR}/.config as input --- gen_initramfs.sh | 9 ++++++++- genkernel | 12 +++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/gen_initramfs.sh b/gen_initramfs.sh index f0b63d9..9ccd5f3 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) @@ -778,7 +785,7 @@ create_initramfs() { 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 diff --git a/genkernel b/genkernel index 61dd493..103c434 100755 --- a/genkernel +++ b/genkernel @@ -352,10 +352,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=" to boot from a ZFS dataset' [ "${ISCSI}" = '1' ] && print_warning 1 'add at least "iscsi_initiatorname= iscsi_target= and iscsi_address=" for iscsi support' - if [ `grep 'CONFIG_EXT[0-9]_FS=' "${KERNEL_DIR}"/.config | wc -l` -ge 2 ]; then + + 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 around it may be needed to' print_warning 1 'add "rootfstype=ext3" or "rootfstype=ext4"' fi + + unset CONFGREP fi [ "${BOOTRW}" != '' ] && mount -o remount,ro ${BOOTDIR} From 7045223180032533e066b57c572bbcccb053cfe9 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sun, 8 Jul 2012 23:40:49 +0200 Subject: [PATCH 2/5] Fix detection of initramfs compression with bzip2 as best candidate --- ChangeLog | 4 ++++ gen_initramfs.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d3bcf58..3950fa6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ # Distributed under the GPL v2 # $Id$ + 08 Jul 2012; Sebastian Pipping gen_configkernel.sh, + gen_initramfs.sh: + Fix detection of initramfs compression with bzip2 as best candidate + 08 Jul 2012; Sebastian Pipping 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 9ccd5f3..6769063 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -779,7 +779,7 @@ 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} From 15a33f3d28d9efa512b736853046224d7d2701d3 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sun, 8 Jul 2012 23:42:32 +0200 Subject: [PATCH 3/5] Catch case with no initramfs compression supported by kernel (bug #423847) --- ChangeLog | 4 ++++ gen_initramfs.sh | 1 + 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3950fa6..2469de6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ # Distributed under the GPL v2 # $Id$ + 08 Jul 2012; Sebastian Pipping gen_configkernel.sh, + gen_initramfs.sh: + Catch case with no initramfs compression supported by kernel (bug #423847) + 08 Jul 2012; Sebastian Pipping gen_configkernel.sh, gen_initramfs.sh: Fix detection of initramfs compression with bzip2 as best candidate diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 6769063..43ef155 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -790,6 +790,7 @@ create_initramfs() { [[ ${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" From c57b73f5f8117f79d4b1bd5f66ed6bcd53a91b20 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sun, 8 Jul 2012 23:52:10 +0200 Subject: [PATCH 4/5] Always report used kernel config file --- ChangeLog | 4 ++++ genkernel | 2 ++ 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2469de6..501d9e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ # Distributed under the GPL v2 # $Id$ + 08 Jul 2012; Sebastian Pipping gen_initramfs.sh, + genkernel: + Always report used kernel config file + 08 Jul 2012; Sebastian Pipping gen_configkernel.sh, gen_initramfs.sh: Catch case with no initramfs compression supported by kernel (bug #423847) diff --git a/genkernel b/genkernel index 103c434..8343cfe 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} From c718d01381a9a619f71b0b500747604c3c8961c0 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Mon, 9 Jul 2012 00:00:19 +0200 Subject: [PATCH 5/5] Improve wording --- genkernel | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/genkernel b/genkernel index 8343cfe..1cf57fa 100755 --- a/genkernel +++ b/genkernel @@ -363,8 +363,8 @@ then fi if [ `${CONFGREP} 'CONFIG_EXT[0-9]_FS=' "${KERNEL_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"' + 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