Q: I've lost my kernel-source configuration file, /usr/src/linux/.config . How can I recreate it?
A: Quite often you can examine /usr/include/linux/autoconf.h and regenerate it. You could use something like the following ugly little script to do it:
-----snip------
#!/bin/bash
#
# after using set
# $1 = #define
# $2 = variable
# $3 = value of variable
#
cp /usr/include/linux/autoconf.h /tmp/autoconf.h.bak
OLDIFS=$IFS
IFS="
"
for i in $(grep CONFIG /usr/include/linux/autoconf.h)
do
if $(echo $i | grep -q "#undef"); then
IFS=$OLDIFS
set $i
echo $2=n
else
IFS=$OLDIFS
set $i
if $(echo $2 | grep -q MODULE); then
echo ${2%_MODULE}=m
else
if [ "$3" = "1" ]; then
echo $2=y
else
echo $2=$3 | sed -e 's/(//' -e 's/)//'
fi
fi
fi
done >/tmp/new.config
-----snip------
then
cd /usr/src/linux
make mrproper
cp /tmp/new.config .config
make oldconfig
...
and make your kernel.