linux-2.1.81 PATCH: much simpler gnu style configuration

Adam J. Richter (adam@yggdrasil.com)
Mon, 26 Jan 1998 17:05:31 -0800


The following patch enables the linux kernel to be built
much more simply, by the following what has become the standard
that most programmers these days expect to build a software components:

./configure
make all
make install

The configure script run the equivalent of "make config" and
"make depend", compiling everything as module that can be compiled
as a module, answering "yes" to other boolean questions, and taking
the default to multiple choice questions, with the following
exceptions:

o CONFIG_ROMFS_FS, CONFIG_BINFMT_ELF, and
CONFIG_BLK_DEV_RAM are compiled in, because
they are needed for a ramdisk-based boot
process.

o CONFIG_MAX_16M and CONFIG_BLK_DEV_HD_IDE (use
old IDE driver instead of new one) are set to "n".
Ultimately, the sense of these questions should be
reversed, so that answering "y" means "do the more
sophisticated thing".

o CONFIG_AP1000 is deactivated on Sparc, because this
currently deactivates support for most common Sparc
machines.

o CONFIG_APM and CONFIG_STALDRV are deactivated on
non-x86 architectures, because they contain
x86 asm statements.

After running "./configure", you can always edit these
choices by running "make config", "make xconfig", "make menuconfig",
or editing the .config file and running "make old-config". It is
completely compatible with all of the other kernel configuration
methods.

The advantages of this system are as follows:

1. It will be easier for people to build the
Linux kernel, so more potential developers
will be encouraged to try it. (Never underestimate
the importance of ease of use.)

2. Because this standard configuration compiles
almost everything in the kernel source tree,
it will be much easier to verify that a large
amount of each kernel release does compile.

3. By moving most customization out of the kernel
binary and into an initial ramdisk, it will
be practical to distribute a standard kernel
binary.

There is another side to this scheme, which involves
building the intial ramdisk with genromfs, but this patch is
for the modifications to the kernel sources. This patch does
not break anything in kernel or require anyone to change the
method that they currently use to configure the kernel. It is
simple and inoccuous, but, I believe, quite useful. I would like
to ask that it be integrated into the main 2.1 release.

Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 205
adam@yggdrasil.com \ / San Jose, California 95129-1034
+1 408 261-6630 | g g d r a s i l United States of America
fax +1 408 261-6631 "Free Software For The Rest Of Us."

*** /tmp/linux-2.1.81.orig/scripts/Configure Mon Jun 16 16:36:02 1997
--- /usr/src/linux/scripts/Configure Mon Jan 26 16:08:50 1998
***************
*** 51,54 ****
--- 51,57 ----
# arguments to "int", allow dep_tristate to take a list of dependencies
# rather than just one.
+ #
+ # 050198 Adam J. Richter (adam@yggdrasil.com) - added support for
+ # "--noninteractive" mode.

#
***************
*** 179,182 ****
--- 182,210 ----
;;
esac
+ if ! $INTERACTIVE ; then
+ case "$2" in
+ CONFIG_MAX_16M ) define_bool "$2" "n"
+ ;;
+ CONFIG_BLK_DEV_HD_IDE )
+ define_bool "$2" "n" # Use new IDE driver, not old one.
+ ;;
+ CONFIG_AP1000 )
+ define_bool "$2" "n"
+ # AP1000 is a weird sparc machine that
+ # deactivates other drivers.
+ ;;
+ CONFIG_APM|CONFIG_STALDRV )
+ # These drivers currently contain
+ # x86 assembly language
+ case "$HOSTTYPE" in
+ *86) define_bool "$2" "y" ;;
+ * ) define_bool "$2" "n" ;;
+ esac
+ ;;
+ * ) define_bool "$2" "y"
+ ;;
+ esac
+ return 0
+ fi
while :; do
readln "$1 ($2) [$defprompt] " "$def" "$old"
***************
*** 201,204 ****
--- 229,241 ----
bool "$1" "$2"
else
+ if ! $INTERACTIVE ; then
+ case "$2" in
+ CONFIG_BLK_DEV_RAM ) define_bool "$2" "y" ;;
+ CONFIG_ROMFS_FS ) define_bool "$2" "y" ;;
+ CONFIG_BINFMT_ELF ) define_bool "$2" "y" ;;
+ * ) define_bool "$2" "m" ;;
+ esac
+ return
+ fi
old=$(eval echo "\${$2}")
def=${old:-'n'}
***************
*** 259,262 ****
--- 296,303 ----
if [ $need_module = 1 ]; then
if [ "$CONFIG_MODULES" = "y" ]; then
+ if ! $INTERACTIVE ; then
+ define_bool "$var" "m"
+ return
+ fi
case "$def" in
"y" | "m") defprompt="M/n/?"
***************
*** 320,323 ****
--- 361,368 ----
max=10000000 # !!
fi
+ if ! $INTERACTIVE && [ ".$def" != "." ] ; then
+ define_int "$2" "$def"
+ return
+ fi
while :; do
readln "$1 ($2) [$def] " "$def" "$old"
***************
*** 351,354 ****
--- 396,403 ----
def=${old:-$3}
def=${def#*[x,X]}
+ if ! $INTERACTIVE && [ ".$def" != "." ] ; then
+ define_hex "$2" "$def"
+ return
+ fi
while :; do
readln "$1 ($2) [$def] " "$def" "$old"
***************
*** 409,412 ****
--- 458,464 ----
set -- $choices
firstvar=$2
+ if ! $INTERACTIVE ; then
+ old="$firstvar"
+ fi
while [ -n "$2" ]; do
if [ -n "$names" ]; then
***************
*** 483,486 ****
--- 535,544 ----
DEFAULT=""
if [ "$1" = "-d" ] ; then
+ DEFAULT="-d"
+ shift
+ fi
+ INTERACTIVE=true
+ if [ "$1" = "--noninteractive" ] ; then
+ INTERACTIVE=false
DEFAULT="-d"
shift
*** /tmp/linux-2.1.81.orig/configure Mon Jan 26 01:57:29 1998
--- /usr/src/linux/configure Mon Jan 5 18:53:13 1998
***************
*** 0 ****
--- 1,13 ----
+ #!/bin/sh
+
+ arch=`uname -m`
+ case $arch in
+ i[3-9]86) arch=i386;;
+ esac
+
+ mkdir -p modules include/linux/modules
+ make symlinks
+ make include/linux/version.h
+
+ MAKE=make sh scripts/Configure --noninteractive arch/${arch}/config.in
+ make depend
*** /tmp/linux-2.1.81.orig/Makefile Fri Jan 23 16:36:22 1998
--- /usr/src/linux/Makefile Sat Jan 24 18:11:09 1998
***************
*** 52,56 ****
ifeq (.depend,$(wildcard .depend))
include .depend
! do-it-all: Version vmlinux
else
CONFIGURATION = depend
--- 52,56 ----
ifeq (.depend,$(wildcard .depend))
include .depend
! do-it-all: Version vmlinux modules
else
CONFIGURATION = depend
*** /tmp/linux-2.1.81.orig/arch/i386/Makefile Tue Oct 14 18:24:09 1997
--- /usr/src/linux/arch/i386/Makefile Fri Jan 16 16:30:34 1998
***************
*** 85,89 ****
@$(MAKEBOOT) BOOTIMAGE=bzImage zdisk

! install: vmlinux
@$(MAKEBOOT) BOOTIMAGE=bzImage install

--- 85,89 ----
@$(MAKEBOOT) BOOTIMAGE=bzImage zdisk

! install: vmlinux modules_install
@$(MAKEBOOT) BOOTIMAGE=bzImage install