3
# this script might require a bash compatible shell, but right now it
4
# also runs in ksh and ash, so let's set it to /bin/sh
6
# Added checks to see if the kernel configuration file exists and if so,
7
# check if all necessary options are enabled. By Vesa-Pekka Palmu <depili@sci.fi>
9
# some initial definitions
13
KERNEL_BUILD=/lib/modules/$KERNEL_VER/build
14
# If using 2.6 outputting to a seperate directory, make KERNEL_OUTPUT
15
# point to that directory
17
ECHO="`which echo` -e"
22
# What kernel are we compiling for?
24
expr $1 \* 65536 + $2 \* 256 + $3
28
value=`eval $ECHO '$'$1`
29
if test "$value" = "y"
31
$ECHO "$1=y" >> $CONFIG_MK
33
$ECHO "# $1 is not defined" >> $CONFIG_MK
38
value=`eval $ECHO '$'$1`
39
$ECHO $1=$value >> $CONFIG_MK
43
grep $* >/dev/null 2>&1
48
if qgrep "^CONFIG_$1=y" "$KERNEL_OUTPUT/.config"
51
elif qgrep "^CONFIG_$1=m" "$KERNEL_OUTPUT/.config"
58
value=`eval echo '$'$2`
60
if test "$value" = "y"
69
value=`eval echo '$'$1`
70
if test "$value" = "n"
79
$ECHO "Kernel configuration lacks needed options, please correct! ABORTING."
84
if [ ! -f $KERNEL_BUILD/include/linux/wireless.h ]; then
85
$ECHO "$KERNEL_BUILD/include/linux/wireless.h header file doesn't exist!"
88
let WIRELESS_VERSION=`grep define.*WIRELESS_EXT $KERNEL_BUILD/include/linux/wireless.h|tr '\t' ' '|cut -f3 -d' '`
89
echo Wireless header file is WIRELESS_EXT version $WIRELESS_VERSION.
91
echo Running linux $KERNEL_VER
92
if [ $WIRELESS_VERSION -lt 13 ]; then
93
echo "Compile info: will choose to use code infrastructure for OLDER wireless extension interface version (< 13)"
94
echo "This support is not perfectly tested, please report any problems!"
95
echo "Upgrading to relatively current Linux kernel package recommended (will also fix some security issues which older ones have)"
97
echo "Compile info: will choose to use code infrastructure for NEWER wireless extension interface version (>= 13)"
101
# ---------- main ----------
105
if [ -z "${KERNEL_OUTPUT}" ]
107
KERNEL_OUTPUT=${KERNEL_BUILD}
110
if [ ! -d ${KERNEL_OUTPUT} ]; then
112
$ECHO "WARNING: kernel build/output directory not found!"
113
$ECHO "You probably need to install the kernel development/header file package! (which matches your currently running kernel)"
118
$ECHO Kernel version file: $KERNEL_OUTPUT/include/linux/version.h
119
$ECHO Kernel configuration file: $KERNEL_OUTPUT/.config
120
$ECHO "Make damn sure these really match your currently running kernel!!"
123
VERSION_CODE=`grep LINUX_VERSION_CODE $KERNEL_OUTPUT/include/linux/version.h | \
124
sed -e 's/[^0-9]//g'`
126
[ -z $VERSION_CODE ] && VERSION_CODE=0
128
if [ -e "$KERNEL_OUTPUT/.config" ]
130
$ECHO "Kernel configuration found, performing sanity checks"
132
configcheck NET_RADIO
133
configcheck NET_WIRELESS
139
$ECHO "All of the following items are required by the driver:"
140
printflag "Loadable modules support" CONFIG_MODULES
141
printflag "Wireless LAN (non-hamradio) support" CONFIG_NET_RADIO
142
printflag "Wireless extensions support" CONFIG_NET_WIRELESS
143
$ECHO "The following is needed for PCMCIA/CardBus cards:"
144
printflag "PCMCIA support" CONFIG_PCMCIA
145
printflag "CardBus support" CONFIG_CARDBUS
146
$ECHO "The following is needed for USB card support:"
147
printflag "USB support" CONFIG_USB
148
$ECHO "The following is needed for PCI card support:"
149
printflag "PCI support" CONFIG_PCI
150
if is_unset CONFIG_MODULES
153
elif is_unset CONFIG_NET_RADIO
156
elif is_unset CONFIG_NET_WIRELESS
160
$ECHO "Kernel configuration satisfies the minimum requirements, continuing."
163
if is_unset CONFIG_SMP
165
$ECHO "Symmetric multiprocessing support (CONFIG_SMP) is disabled."
167
$ECHO "WARNING: Symmetric multiprocessing support (CONFIG_SMP) is enabled. If you"
168
$ECHO "really have more than one cpu, be warned that this driver might still be not SMP safe."
171
if is_unset CONFIG_USB
173
$ECHO "WARNING: USB support (CONFIG_USB) is disabled."
174
$ECHO "This is not a terribly good idea in case your ACX100 card is USB-based."
178
$ECHO "WARNING: Unable to find kernel configuration file ($KERNEL_OUTPUT/.config) -> unable to perform sanity checks"
179
$ECHO "Make sure your kernel has the required options enabled, see README"
183
if [ $VERSION_CODE -ge `version 2 5 0` ]
190
write_str KERNEL_BUILD
191
write_str KERNEL_OUTPUT
192
write_str VERSION_CODE
195
if [ "$WARNING_FLAG" = "1" ]; then
197
$ECHO "*** Potential problems found above, waiting 5 seconds to let you know about it. ***"