Use proper ${KERNEL_CONFIG} rather than ${KERNEL_DIR}/.config as input

cleanup-cruft
Sebastian Pipping 13 years ago
parent c261693b92
commit 88892f5df2

@ -754,6 +754,13 @@ create_initramfs() {
else else
if isTrue "${COMPRESS_INITRD}" if isTrue "${COMPRESS_INITRD}"
then 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_xz=$(type -p xz)
cmd_lzma=$(type -p lzma) cmd_lzma=$(type -p lzma)
cmd_bzip2=$(type -p bzip2) cmd_bzip2=$(type -p bzip2)
@ -778,7 +785,7 @@ create_initramfs() {
set -- ${tuple} set -- ${tuple}
kernel_option=$1 kernel_option=$1
cmd_variable_name=$2 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 compression=$3
[[ ${COMPRESS_INITRD_TYPE} == best ]] && break [[ ${COMPRESS_INITRD_TYPE} == best ]] && break
fi fi

@ -352,10 +352,20 @@ then
[ "${ZFS}" = '1' ] && print_warning 1 'add "dozfs" for ZFS volume management support' [ "${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' [ "${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' [ "${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 'With support for several ext* filesystems around it may be needed to'
print_warning 1 'add "rootfstype=ext3" or "rootfstype=ext4"' print_warning 1 'add "rootfstype=ext3" or "rootfstype=ext4"'
fi fi
unset CONFGREP
fi fi
[ "${BOOTRW}" != '' ] && mount -o remount,ro ${BOOTDIR} [ "${BOOTRW}" != '' ] && mount -o remount,ro ${BOOTDIR}

Loading…
Cancel
Save