[TOY/PATCH] Phat Config

Nicholas J. Leon (nicholas@binary9.net)
Thu, 11 Feb 1999 12:14:17 -0500 (EST)


<boredom>
I decided to find out how many features could be compiled into the kernel
at one time. I had thought to use the produced kernel as a hardware
identification tool.

To quickly go through the config process, I wrote this minor patch that
adds the Makefile option of "phatconfig" and alters scripts/Configure just
a bit.

The idea is that I want to answer "Y" to every bool question, unless it is
listed inside .config, and accept the default (or the contents of .config)
to every other type of question.

The result is that I can:

(echo 'CONFIG_M386=y'; echo 'CONFIG_MODULES=n'; echo 'CONFIG_SOUND=n') \
> .config
make phatconfig
make clean depend;make bzImage

Of course, the above bombs out when compiling. In fact, I haven't been
able to get a phat kernel to compile correctly (I'm now working with

CONFIG_M386=y
CONFIG_MODULES=n
CONFIG_SOUND=n
CONFIG_NET=n
CONFIG_FB=n
CONFIG_VIDEO_DEV=n

in hopes of actually finishing a compile).

Perhaps this will help others when trying to figure out cross CONFIG_ item
compatibility.

Enjoy! (yeah right).

</boredom>

Patch follows

diff -Nur linux.p/Makefile linux/Makefile
--- linux.p/Makefile Mon Jan 25 20:46:35 1999
+++ linux/Makefile Thu Feb 11 00:31:00 1999
@@ -227,6 +227,12 @@
scripts/split-include include/linux/autoconf.h include/config; \
fi

+phatconfig: symlinks scripts/split-include
+ $(CONFIG_SHELL) scripts/Configure -phat arch/$(ARCH)/config.in
+ if [ -r include/linux/autoconf.h ]; then \
+ scripts/split-include include/linux/autoconf.h include/config; \
+ fi
+
xconfig: symlinks scripts/split-include
$(MAKE) -C scripts kconfig.tk
wish -f scripts/kconfig.tk
diff -Nur linux.p/scripts/Configure linux/scripts/Configure
--- linux.p/scripts/Configure Wed Nov 25 20:21:48 1998
+++ linux/scripts/Configure Thu Feb 11 12:01:41 1999
@@ -1,5 +1,4 @@
-
-#! /bin/sh
+#!/bin/sh
#
# This script is used to configure the Linux kernel.
#
@@ -186,6 +185,20 @@
"n") defprompt="N/y/?"
;;
esac
+
+ if [ "$DEFAULT" = "-phat" ]; then
+ echo -n "$1 ($2) [$defprompt] "
+ if [ -n "$old" ]; then
+ ans=$old
+ else
+ ans=y
+ fi
+ echo "$ans"
+ define_bool "$2" "$ans"
+
+ return
+ fi
+
while :; do
readln "$1 ($2) [$defprompt] " "$def" "$old"
case "$ans" in
@@ -218,6 +231,22 @@
"n") defprompt="N/y/m/?"
;;
esac
+
+ if [ "$DEFAULT" = "-phat" ]; then
+ echo -n "$1 ($2) [$defprompt] "
+ if [ -n "$old" ]; then
+ ans=$old
+ else
+ ans=y
+ fi
+ echo "$ans"
+ define_bool "$2" "$ans"
+
+ return
+ fi
+
+
+
while :; do
readln "$1 ($2) [$defprompt] " "$def" "$old"
case "$ans" in
@@ -273,6 +302,21 @@
"n") defprompt="N/m/?"
;;
esac
+
+ if [ "$DEFAULT" = "-phat" ]; then
+ echo -n "$1 ($2) [$defprompt] "
+ if [ -n "$old" ]; then
+ ans=$old
+ else
+ ans=y
+ fi
+ echo "$ans"
+ define_bool "$2" "$ans"
+
+ return
+ fi
+
+
while :; do
readln "$ques ($var) [$defprompt] " "$def" "$old"
case "$ans" in
@@ -327,6 +371,21 @@
else
max=10000000 # !!
fi
+
+ if [ "$DEFAULT" = "-phat" ]; then
+ echo -n "$1 ($2) [$def] "
+ if [ -n "$old" ]; then
+ ans=$old
+ else
+ ans=$def
+ fi
+ echo "$ans"
+ define_int "$2" "$ans"
+
+ return
+ fi
+
+
while :; do
readln "$1 ($2) [$def] " "$def" "$old"
if expr \( \( $ans + 0 \) \>= $min \) \& \( $ans \<= $max \) >/dev/null 2>&1 ; then
@@ -358,6 +417,21 @@
old=$(eval echo "\${$2}")
def=${old:-$3}
def=${def#*[x,X]}
+
+ if [ "$DEFAULT" = "-phat" ]; then
+ echo -n "$1 ($2) [$def] "
+ if [ -n "$old" ]; then
+ ans=$old
+ else
+ ans=$def
+ fi
+ echo "$ans"
+ define_hex "$2" "$ans"
+
+ return
+ fi
+
+
while :; do
readln "$1 ($2) [$def] " "$def" "$old"
ans=${ans#*[x,X]}
@@ -389,6 +463,20 @@
function string () {
old=$(eval echo "\${$2}")
def=${old:-$3}
+
+ if [ "$DEFAULT" = "-phat" ]; then
+ echo -n "$1 ($2) [$def] "
+ if [ -n "$old" ]; then
+ ans=$old
+ else
+ ans=$def
+ fi
+ echo "$ans"
+ define_string "$2" "$ans"
+
+ return
+ fi
+
readln "$1 ($2) [$def] " "$def" "$old"
define_string "$2" "$ans"
}
@@ -432,7 +520,12 @@
val=""
while [ -z "$val" ]; do
ambg=n
- readln "$question ($names) [$def] " "$def" "$old"
+ if [ "$DEFAULT" = "-phat" ]; then
+ echo "$question ($names) [$def] $def"
+ ans="$def"
+ else
+ readln "$question ($names) [$def] " "$def" "$old"
+ fi
ans=$(echo $ans | tr a-z A-Z)
set -- $choices
while [ -n "$1" ]; do
@@ -460,6 +553,7 @@
help "$firstvar"
fi
done
+
set -- $choices
while [ -n "$2" ]; do
if [ "$2" = "$val" ]; then
@@ -491,6 +585,10 @@
DEFAULT=""
if [ "$1" = "-d" ] ; then
DEFAULT="-d"
+ shift
+fi
+if [ "$1" = "-phat" ] ; then
+ DEFAULT="-phat"
shift
fi

G'day!
-- n i c h o l a s j l e o n
elegance through simplicity*http://mrnick.binary9.net*nicholas@binary9.net
good fortune through truth*roaming:njllm@email.msn.com*ICQ#2170994*U+($++)
TRA#6805*not all questions have answers*pseudogeek:P+++($++)L+($++)W=lm@b9
trust no-one with an iq under 150*understand yourself before trying others

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/