if ! module_installed module-init-tools 
then
	message "${MESSAGE_COLOR}This kernel needs ${MODULE_COLOR}module-init-tools${DEFAULT_COLOR}${MESSAGE_COLOR}, which conflicts with ${MODULE_COLOR}modutils${DEFAULT_COLOR}${MESSAGE_COLOR} (needed for 2.4 kernels)."
	if query "Install module-init-tools" y
	then
		message "${MESSAGE_COLOR}Proceeding to install module-init-tools${DEFAULT_COLOR}"
		lin module-init-tools || exit 1;
	else
		message "${PROBLEM_COLOR}Warning:${DEFAULT_COLOR}${MESSAGE_COLOR} You cannot load modules with a 2.5 kernel"
	fi
fi


if  !  grep  -q  "BOOT_LOADER"  $MODULE_CONFIG;  then
#  message  "The Linux Kernel requires a boot loader"
message  "Choose either GRUB or LILO"
# BOOT_LOADER=lilo

if  query  "Use  LILO?"  y
  then  BOOT_LOADER=lilo
  else  BOOT_LOADER=grub
fi

  echo  "BOOT_LOADER=$BOOT_LOADER"  >>  $MODULE_CONFIG
fi

CONFIG_GRUB="n"
CONFIG_LILO="n"

if    grep  -q  "BOOT_LOADER=grub"  $MODULE_CONFIG  &&
      query  "Configure grub?"  n
then  CONFIG_GRUB=y
fi

if    grep  -q  "BOOT_LOADER=lilo"  $MODULE_CONFIG  &&
      query  "Configure lilo?"  n
then  CONFIG_LILO=y
fi


if  !  grep  -q  "CONFIG_METHOD="  $MODULE_CONFIG
then
  if    query  "Do you prefer make menuconfig over make config"  y
  then  CONFIG_METHOD="menuconfig"
  else  CONFIG_METHOD="config"
  fi
  echo  "CONFIG_METHOD=$CONFIG_METHOD"  >>  $MODULE_CONFIG
fi


message "Do you wish to give an alternative .config file?"
while [ true ] 
do
	read -p "Write its location, or just press enter for default .config : " configfilelocation
	
	if [ "$configfilelocation" != "" ]; then
		if [ -f $configfilelocation ]; then  
			cp $configfilelocation ${BUILD_DIRECTORY}/linux-$VERSION/.config 
			message "Using user's .config" &&
			break;
		else #the file doesn't exist
			message "$configfilelocation doesn't exist. Please try again"
		fi
	else # user only just pressed enter, so just carry on
		message "no selection made."
		break;
	fi
done
# put a line in between as a separator
message "" 


if  [  !  -f  $CONFIG_CACHE/.config  ];  then
  message  "Preparing to make menuconfig."
  CONFIG_KERNEL="y"
else
  message  "Reconfiguration is optional."
  if    query  "Configure linux kernel?"  n
  then  CONFIG_KERNEL=y
  else  CONFIG_KERNEL=n
  fi
fi

TEMP=`grep  -v  "CONFIG_KERNEL="          $MODULE_CONFIG  |
      grep  -v  "CONFIG_LILO="                           |
      grep  -v  "CONFIG_GRUB="`

echo  "$TEMP"                         >   $MODULE_CONFIG
echo  "CONFIG_KERNEL=$CONFIG_KERNEL"  >>  $MODULE_CONFIG
echo  "CONFIG_LILO=$CONFIG_LILO"      >>  $MODULE_CONFIG
echo  "CONFIG_GRUB=$CONFIG_GRUB"      >>  $MODULE_CONFIG

