
if  !  grep  -q  "BOOT_LOADER"  $MODULE_CONFIG;  then
  if [ "x`arch`" == "xalpha" ]; then
    BOOT_LOADER=aboot
  else
    message  "The Linux Kernel requires a boot loader"
    message  "Choose either GRUB or LILO"
    if  query  "Use  LILO?"  y
      then  BOOT_LOADER=lilo
    else  BOOT_LOADER=grub
    fi
  fi
  echo  "BOOT_LOADER=$BOOT_LOADER"  >>  $MODULE_CONFIG
fi

CONFIG_GRUB="n"
CONFIG_LILO="n"
CONFIG_ABOOT="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  "BOOT_LOADER=aboot" $MODULE_CONFIG  &&
      query  "Configure aboot?" n
then  CONFIG_ABOOT=y
fi

if  !  grep  -q  "CONFIG_METHOD="  $MODULE_CONFIG
then
      CONFIG_HELP="Configure linux one question at a time"
  MENUCONFIG_HELP="Configure linux in a terminal with menus"
     XCONFIG_HELP="Configure linux with graphical X window menus"
     
  OPTIONS=( "config"     "text based"             "answer one question at a time"
            "menuconfig" "ncurses menu interface" "menu driven ncurses interface"
	    "xconfig"    "X graphical interface"  "graphical interface with X windows" )

  while [ -z "$CONFIG_METHOD" ] ; do
  CONFIG_METHOD=`dialog --title "Select how to configure your kernel" \
			--ok-label  "Ok"                              \
			--no-cancel                                   \
			--stdout                                      \
			--radiolist                                   \
			"Select how to configure your kernel"         \
			 0 0 0                                        \
			"${OPTIONS[@]}"`

  done

  echo  "CONFIG_METHOD=$CONFIG_METHOD"  >>  $MODULE_CONFIG
fi


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="                           |
      grep  -v  "CONFIG_ABOOT="`

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
echo  "CONFIG_ABOOT=$CONFIG_ABOOT"    >>  $MODULE_CONFIG

