scripts/Configure patch for automatic module compile

From: Maciek Nowacki (maciek@Voyager.powersurfr.com)
Date: Mon May 07 2001 - 01:34:13 EST


Hi,

If you're like me, you build everything as modules, boot with an initrd that
loads in the disk or net driver and filesystem module, and then let kmod take
care of the rest. Here's a patch that changes Configure (make config) to
build all possible modules - in other words, to answer 'M' for every tristate
of some form y/m/n. It also allows some tristates to be built into the
kernel (y), so you can have a root filesystem and executables. This is done
by changing tristates in arch/${ARCH}/defconfig to default to 'a'. For
instance:

CONFIG_BINFMT_ELF=a
CONFIG_BLK_DEV_RAM=a
CONFIG_CRAMFS=a

I am posting the patch in the hope that someone finds it useful or uses it
perhaps as inspiration for a better solution. Eventually, I'd like to cut
down the config process to a short list of questions about CPU, bus, network,
and then get all the modules automatically.

Caveats: hmm.. well, it's only tested on i386, though I don't see why it
wouldn't work on anything else. If you're not running some kind of embedded
system, the defconfig must be changed or the kernel won't be very useful. Of
course, this only works with 'make config' - 'menuconfig' and 'xconfig' are
unchanged.

Maciek

--- Configure.old Sun May 6 22:28:07 2001
+++ Configure Mon May 7 00:07:32 2001
@@ -155,6 +155,7 @@
 
          "m")
                 echo "$1=m" >>$CONFIG
+ echo "$1=m"
                 echo "#undef $1" >>$CONFIG_H
                 echo "#define $1_MODULE 1" >>$CONFIG_H
                 ;;
@@ -207,26 +208,11 @@
           old=$(eval echo "\${$2}")
           def=${old:-'n'}
           case "$def" in
- "y") defprompt="Y/m/n/?"
+ "a") define_tristate "$2" "y"
                 ;;
- "m") defprompt="M/n/y/?"
- ;;
- "n") defprompt="N/y/m/?"
+ * ) define_tristate "$2" "m"
                 ;;
           esac
- while :; do
- readln "$1 ($2) [$defprompt] " "$def" "$old"
- case "$ans" in
- [yY] | [yY]es ) define_tristate "$2" "y"
- break ;;
- [nN] | [nN]o ) define_tristate "$2" "n"
- break ;;
- [mM] ) define_tristate "$2" "m"
- break ;;
- * ) help "$2"
- ;;
- esac
- done
         fi
 }
 
@@ -269,25 +255,7 @@
                  "n") defprompt="N/m/?"
                       ;;
                 esac
- while :; do
- readln "$ques ($var) [$defprompt] " "$def" "$old"
- case "$ans" in
- [nN] | [nN]o ) define_tristate "$var" "n"
- break ;;
- [mM] ) define_tristate "$var" "m"
- break ;;
- [yY] | [yY]es ) echo
- echo " This answer is not allowed, because it is not consistent with"
- echo " your other choices."
- echo " This driver depends on another one which you chose to compile"
- echo " as a module. This means that you can either compile this one"
- echo " as a module as well (with M) or leave it out altogether (N)."
- echo
- ;;
- * ) help "$var"
- ;;
- esac
- done
+ define_tristate "$var" "m"
            fi
         else
            tristate "$ques" "$var"
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon May 07 2001 - 21:00:24 EST