#!/bin/sh
dialog \
--title "Select kernel class" \
--menu "Please choose the kernel driver class you want.\n (current: $1)" \
21 60 10 \
\
"Linux"    "Linux kernel loadable module driver" \
\
2> /tmp/.kernclass

KERNEL_CLASS=$1
KERNEL_TYPE=$2

NEW_KERNEL_CLASS=`cat /tmp/.kernclass`

if [ "$NEW_KERNEL_CLASS" != "" ]; then
  if [ "$NEW_KERNEL_CLASS" = "$KERNEL_CLASS" ]; then 
    kernel/$NEW_KERNEL_CLASS/.configure $2;
   else
    kernel/$NEW_KERNEL_CLASS/.configure;
  fi
  NEW_KERNEL_TYPE=`cat /tmp/.kerntype`
  if [ "$NEW_KERNEL_TYPE" != "" ]; then
    KERNEL_CLASS=$NEW_KERNEL_CLASS
    KERNEL_TYPE=$NEW_KERNEL_TYPE
  fi
fi

echo $KERNEL_CLASS>/tmp/.kernclass
echo $KERNEL_TYPE>/tmp/.kerntype
