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)
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
[ "${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
+
+ 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}