3 # This script is used to configure the linux kernel.
5 # It was inspired by a desire to not have to hit <enter> 9 million times
6 # or startup the X server just to change a single kernel parameter.
8 # This script attempts to parse the configuration files, which are
9 # scattered throughout the kernel source tree, and creates a temporary
10 # set of mini scripts which are in turn used to create nested menus and
13 # It uses a very modified/mutilated version of the "dialog" utility
14 # written by Savio Lam (lam836@cs.cuhk.hk). Savio is not responsible
15 # for this script or the version of dialog used by this script.
16 # Please do not contact him with questions. The official version of
17 # dialog is available at sunsite.unc.edu or a sunsite mirror.
19 # Portions of this script were borrowed from the original Configure
22 # William Roadcap was the original author of Menuconfig.
23 # Michael Elizabeth Chastain (mec@shout.net) is the current maintainer.
25 # 070497 Bernhard Kaindl (bkaindl@netway.at) - get default values for
26 # new bool, tristate and dep_tristate parameters from the defconfig file.
27 # new configuration parameters are marked with '(NEW)' as in make config.
29 # 180697 Bernhard Kaindl (bkaindl@netway.at) - added the needed support
30 # for string options. They are handled like the int and hex options.
32 # 081297 Pavel Machek (pavel@atrey.karlin.mff.cuni.cz) - better error
35 # 131197 Michael Chastain (mec@shout.net) - output all lines for a
36 # choice list, not just the selected one. This makes the output
37 # the same as Configure output, which is important for smart config
40 # 101297 Michael Chastain (mec@shout.net) - remove sound driver cruft.
42 # 221297 Michael Chastain (mec@shout.net) - make define_bool actually
43 # define its arguments so that later tests on them work right.
45 # 160198 Michael Chastain (mec@shout.net) - fix bug with 'c' command
46 # (complement existing value) when used on virgin uninitialized variables.
48 # 090398 Axel Boldt (boldt@math.ucsb.edu) - allow for empty lines in help
51 # 12 Dec 1998, Michael Elizabeth Chastain (mec@shout.net)
52 # Remove a /tmp security hole in get_def (also makes it faster).
53 # Give uninitialized variables canonical values rather than null value.
54 # Change a lot of places to call set_x_info uniformly.
55 # Take out message about preparing version (old sound driver cruft).
57 # 13 Dec 1998, Riley H Williams <Riley@Williams.Name>
58 # When an error occurs, actually display the error message as well as
59 # our comments thereon.
61 # 31 Dec 1998, Michael Elizabeth Chastain (mec@shout.net)
62 # Fix mod_bool to honor $CONFIG_MODULES.
63 # Fix dep_tristate to call define_bool when dependency is "n".
65 # 02 January 1999, Michael Elizabeth Chastain (mec@shout.net)
66 # Blow away lxdialog.scrltmp on entry to activate_menu. This protects
67 # against people who use commands like ' ' to select menus.
69 # 24 January 1999, Michael Elizabeth Chastain, <mec@shout.net>
70 # - Improve the exit message (Jeff Ronne).
72 # 06 July 1999, Andrzej M. Krzysztofowicz, <ankry@mif.pg.gda.pl>
73 # - Support for multiple conditions in dep_tristate().
74 # - Implemented new functions: define_tristate(), define_int(), define_hex(),
75 # define_string(), dep_bool().
77 # 12 November 2001, Keith Owens <kaos@ocs.com.au>
78 # Escape double quotes on eval so the quotes are still there on the second
79 # evaluation, required to handle strings with special characters.
84 # Change this to TRUE if you prefer all kernel options listed
85 # in a single menu rather than the standard menu hierarchy.
90 # Make sure we're really running bash.
92 [ -z "$BASH" ] && { echo "Menuconfig requires bash" 1>&2; exit 1; }
95 # Cache function definitions, turn off posix compliance
101 # Given a configuration variable, set the global variable $x to its value,
102 # and the global variable $info to the string " (NEW)" if this is a new
105 # This function looks for: (1) the current value, or (2) the default value
106 # from the arch-dependent defconfig file, or (3) a default passed by the caller.
108 function set_x_info () {
111 eval `sed -n -e 's/# \(.*\) is not set.*/\1=n/' -e "/^$1=/p" arch/$ARCH/defconfig`
112 eval x=\${$1:-\"$2\"}
114 eval INFO_$1="' (NEW)'"
116 eval info=\"\$INFO_$1\"
120 # Load the functions used by the config.in files.
122 # I do this because these functions must be redefined depending
123 # on whether they are being called for interactive use or for
124 # saving a configuration to a file.
126 # Thank the heavens bash supports nesting function definitions.
131 # Additional comments
133 function comment () {
134 comment_ctr=$[ comment_ctr + 1 ]
135 echo -ne "': $comment_ctr' '--- $1' " >>MCmenu
139 # Define a boolean to a specific value.
141 function define_bool () {
145 function define_tristate () {
149 function define_hex () {
153 function define_int () {
157 function define_string () {
162 # Create a boolean (Yes/No) function for our current menu
163 # which calls our local bool function.
173 echo -ne "'$2' '[$flag] $1$info' " >>MCmenu
175 echo -e "function $2 () { l_bool '$2' \"\$1\" ;}\n" >>MCradiolists
179 # Create a tristate (Yes/No/Module) radiolist function
180 # which calls our local tristate function.
182 # Collapses to a boolean (Yes/No) if module support is disabled.
184 function tristate () {
185 if [ "$CONFIG_MODULES" != "y" ]
197 echo -ne "'$2' '<$flag> $1$info' " >>MCmenu
200 function $2 () { l_tristate '$2' \"\$1\" ;}" >>MCradiolists
205 # Create a tristate radiolist function which is dependent on
206 # another kernel configuration option.
208 # Quote from the original configure script:
210 # If the option we depend upon is a module,
211 # then the only allowable options are M or N. If Y, then
212 # this is a normal tristate. This is used in cases where modules
213 # are nested, and one module requires the presence of something
214 # else in the kernel.
216 function dep_tristate () {
221 while [ $# -gt 0 ]; do
222 if [ "$1" = y ]; then
224 elif [ "$1" = m ]; then
232 if [ "$dep" = y ]; then
233 tristate "$ques" "$var"
234 elif [ "$dep" = m ]; then
235 mod_bool "$ques" "$var"
237 define_tristate "$var" n
242 # Same as above, but now only Y and N are allowed as dependency
243 # (i.e. third and next arguments).
245 function dep_bool () {
250 while [ $# -gt 0 ]; do
251 if [ "$1" = y ]; then
258 if [ "$dep" = y ]; then
265 function dep_mbool () {
270 while [ $# -gt 0 ]; do
271 if [ "$1" = y -o "$1" = m ]; then
278 if [ "$dep" = y ]; then
286 # Add a menu item which will call our local int function.
291 echo -ne "'$2' '($x) $1$info' " >>MCmenu
293 echo -e "function $2 () { l_int '$1' '$2' '$3' '$x' ;}" >>MCradiolists
297 # Add a menu item which will call our local hex function.
303 echo -ne "'$2' '($x) $1$info' " >>MCmenu
305 echo -e "function $2 () { l_hex '$1' '$2' '$3' '$x' ;}" >>MCradiolists
309 # Add a menu item which will call our local string function.
314 echo -ne "'$2' ' $1: \"$x\"$info' " >>MCmenu
316 echo -e "function $2 () { l_string '$1' '$2' '$3' '$x' ;}" >>MCradiolists
320 # Add a menu item which will call our local One-of-Many choice list.
324 # Need to remember params cause they're gonna get reset.
332 # Find out if one of the choices is already set.
333 # If it's not then make it the default.
340 if eval [ \"_\$$2\" = \"_y\" ]
348 : ${current:=$default}
350 echo -ne "'$firstchoice' '($current) $title' " >>MCmenu
353 function $firstchoice () \
354 { l_choice '$title' \"$choices\" \"$current\" ;}" >>MCradiolists
357 } # END load_functions()
364 # Extract available help for an option from Configure.help
365 # and send it to standard output.
367 # Most of this function was borrowed from the original kernel
370 function extract_help () {
371 if [ -f Documentation/Configure.help ]
373 #first escape regexp special characters in the argument:
374 var=$(echo "$1"|sed 's/[][\/.^$*]/\\&/g')
375 #now pick out the right help text:
376 text=$(sed -n "/^$var[ ]*\$/,\${
383 /<file:\\([^>]*\\)>/s//\\1/g
385 }" Documentation/Configure.help)
389 echo "There is no help available for this kernel option."
395 echo "There is no help available for this kernel option."
401 # Activate a help dialog.
404 if extract_help $1 >help.out
406 $DIALOG --backtitle "$backtitle" --title "$2"\
407 --textbox help.out $ROWS $COLS
409 $DIALOG --backtitle "$backtitle" \
410 --textbox help.out $ROWS $COLS
416 # Show the README file.
418 function show_readme () {
419 $DIALOG --backtitle "$backtitle" \
420 --textbox scripts/README.Menuconfig $ROWS $COLS
424 # Begin building the dialog menu command and Initialize the
425 # Radiolist function file.
427 function menu_name () {
428 echo -ne "$DIALOG --title '$1'\
429 --backtitle '$backtitle' \
430 --menu '$menu_instructions' \
431 $ROWS $COLS $((ROWS-10)) \
437 # Add a submenu option to the menu currently under construction.
439 function submenu () {
440 echo -ne "'activate_menu $2' '$1 --->' " >>MCmenu
444 # Handle a boolean (Yes/No) option.
465 # Same as bool() except options are (Module/No)
467 function mod_bool () {
468 if [ "$CONFIG_MODULES" != "y" ]; then
478 echo -ne "'$2' '<$flag> $1$info' " >>MCmenu
480 echo -e "function $2 () { l_mod_bool '$2' \"\$1\" ;}" >>MCradiolists
485 # Same as l_bool() except options are (Module/No)
487 function l_mod_bool() {
492 ${DIALOG} --backtitle "$backtitle" \
494 This feature depends on another which has been configured as a module. \
495 As a result, this feature will be built as a module." 4 70
513 # Handle a tristate (Yes/No/Module) option.
515 function l_tristate () {
538 # Create a dialog for entering an integer into a kernel option.
543 if $DIALOG --title "$1" \
544 --backtitle "$backtitle" \
545 --inputbox "$inputbox_instructions_int" \
546 10 75 "$4" 2>MCdialog.out
548 answer="`cat MCdialog.out`"
549 answer="${answer:-$3}"
551 # Semantics of + and ? in GNU expr changed, so
553 if expr "$answer" : '0$' '|' "$answer" : '[1-9][0-9]*$' '|' "$answer" : '-[1-9][0-9]*$' >/dev/null
559 ${DIALOG} --backtitle "$backtitle" \
560 --infobox "You have made an invalid entry." 3 43
572 # Create a dialog for entering a hexadecimal into a kernel option.
577 if $DIALOG --title "$1" \
578 --backtitle "$backtitle" \
579 --inputbox "$inputbox_instructions_hex" \
580 10 75 "$4" 2>MCdialog.out
582 answer="`cat MCdialog.out`"
583 answer="${answer:-$3}"
584 answer="${answer##*[x,X]}"
586 if expr "$answer" : '[0-9a-fA-F][0-9a-fA-F]*$' >/dev/null
592 ${DIALOG} --backtitle "$backtitle" \
593 --infobox "You have made an invalid entry." 3 43
605 # Create a dialog for entering a string into a kernel option.
607 function l_string () {
610 if $DIALOG --title "$1" \
611 --backtitle "$backtitle" \
612 --inputbox "$inputbox_instructions_string" \
613 10 75 "$4" 2>MCdialog.out
615 answer="`cat MCdialog.out`"
616 answer="${answer:-$3}"
619 # Someone may add a nice check for the entered
633 # Handle a one-of-many choice list.
635 function l_choice () {
637 # Need to remember params cause they're gonna get reset.
645 # Scan current value of choices and set radiolist switches.
653 "$current"*) if [ -z "$chosen" ]; then
654 list="$list $2 $1 ON "
657 list="$list $2 $1 OFF "
659 *) list="$list $2 $1 OFF " ;;
667 if $DIALOG --title "$title" \
668 --backtitle "$backtitle" \
669 --radiolist "$radiolist_instructions" \
670 15 70 6 $list 2>MCdialog.out
672 choice=`cat MCdialog.out`
676 help "$firstchoice" "$title"
680 # Now set the boolean value of each option based on
681 # the selection made from the radiolist.
686 if [ "$2" = "$choice" ]
698 # Call awk, and watch for error codes, etc.
700 function callawk () {
701 awk "$1" || { echo "Awk died with error code $?. Giving up."; exit 1; }
705 # A faster awk based recursive parser. (I hope)
707 function parser1 () {
711 comment_is_option = 0
712 parser("'$CONFIG_IN'","MCmenu0")
715 function parser(ifile,menu) {
717 while (getline <ifile) {
718 if ($1 == "mainmenu_option") {
719 comment_is_option = "1"
721 else if ($1 == "comment" && comment_is_option == "1") {
722 comment_is_option= "0"
726 printf("submenu %s MCmenu%s\n", $0, menu_no) >>menu
728 newmenu = sprintf("MCmenu%d", menu_no);
729 printf( "function MCmenu%s () {\n"\
732 menu_no, $0) >newmenu
734 parser(ifile, newmenu)
736 else if ($0 ~ /^#|\$MAKE|mainmenu_name/) {
739 else if ($1 ~ "endmenu") {
743 else if ($1 == "source") {
754 # Secondary parser for single menu mode.
756 function parser2 () {
759 parser("'$CONFIG_IN'","MCmenu0")
762 function parser(ifile,menu) {
764 while (getline <ifile) {
765 if ($0 ~ /^#|$MAKE|mainmenu_name/) {
768 else if ($1 ~ /mainmenu_option|endmenu/) {
771 else if ($1 == "source") {
782 # Parse all the config.in files into mini scripts.
784 function parse_config_files () {
787 echo "function MCmenu0 () {" >MCmenu0
788 echo 'default=$1' >>MCmenu0
789 echo "menu_name 'Main Menu'" >>MCmenu0
791 if [ "_$single_menu_mode" = "_TRUE" ]
798 echo "comment ''" >>MCmenu0
799 echo "g_alt_config" >>MCmenu0
800 echo "s_alt_config" >>MCmenu0
805 # These mini scripts must be sourced into the current
806 # environment in order for all of this to work. Leaving
807 # them on the disk as executables screws up the recursion
808 # in activate_menu(), among other things. Once they are
809 # sourced we can discard them.
820 # This is the menu tree's bootstrap.
822 # Executes the parsed menus on demand and creates a set of functions,
823 # one per configuration option. These functions will in turn execute
824 # dialog commands or recursively call other menus.
826 function activate_menu () {
827 rm -f lxdialog.scrltmp
830 comment_ctr=0 #So comment lines get unique tags
832 $1 "$default" 2> MCerror #Create the lxdialog menu & functions
839 Menuconfig has encountered a possible error in one of the kernel's
840 configuration files and is unable to continue. Here is the error
844 sed 's/^/ Q> /' MCerror
847 Please report this to the maintainer <mec@shout.net>. You may also
848 send a problem report to <linux-kernel@vger.kernel.org>.
850 Please indicate the kernel version you are trying to configure and
851 which menu you were trying to enter when this error occurred.
859 . ./MCradiolists #Source the menu's functions
861 . ./MCmenu 2>MCdialog.out #Activate the lxdialog menu
864 read selection <MCdialog.out
868 defaults="$selection
\12$defaults" #pseudo stack
870 0) eval $selection ;;
871 3) eval $selection y ;;
872 4) eval $selection n ;;
873 5) eval $selection m ;;
874 6) eval $selection c ;;
876 default="${defaults%%
\12*}" defaults="${defaults#*
\12}"
879 default="${selection%%\ *}"
882 *"-->"*|*"alt_config"*)
885 eval help $selection ;;
896 There seems to be a problem with the lxdialog companion utility which is
897 built prior to running Menuconfig. Usually this is an indicator that you
898 have upgraded/downgraded your ncurses libraries and did not remove the
899 old ncurses header file(s) in /usr/include or /usr/include/ncurses.
901 It is VERY important that you have only one set of ncurses header files
902 and that those files are properly version matched to the ncurses libraries
903 installed on your machine.
905 You may also need to rebuild lxdialog. This can be done by moving to
906 the /usr/src/linux/scripts/lxdialog directory and issuing the
907 "make clean all" command.
909 If you have verified that your ncurses install is correct, you may email
910 the maintainer <mec@shout.net> or post a message to
911 <linux-kernel@vger.kernel.org> for additional assistance.
922 # Create a menu item to load an alternate configuration file.
925 echo -n "get_alt_config 'Load an Alternate Configuration File' "\
930 # Get alternate config file name and load the
931 # configuration from it.
934 set -f ## Switch file expansion OFF
938 ALT_CONFIG="${ALT_CONFIG:-$DEFAULTS}"
940 $DIALOG --backtitle "$backtitle" \
942 Enter the name of the configuration file you wish to load. \
943 Accept the name shown to restore the configuration you \
944 last retrieved. Leave blank to abort."\
945 11 55 "$ALT_CONFIG" 2>MCdialog.out
949 ALT_CONFIG=`cat MCdialog.out`
951 [ "_" = "_$ALT_CONFIG" ] && break
953 if eval [ -r \"$ALT_CONFIG\" ]
955 eval load_config_file \"$ALT_CONFIG\"
959 $DIALOG --backtitle "$backtitle" \
960 --infobox "File does not exist!" 3 38
966 For various reasons, one may wish to keep several different kernel
967 configurations available on a single machine.
969 If you have saved a previous configuration in a file other than the
970 kernel's default, entering the name of the file here will allow you
971 to modify that configuration.
973 If you are uncertain, then you have probably never used alternate
974 configuration files. You should therefor leave this blank to abort.
977 $DIALOG --backtitle "$backtitle"\
978 --title "Load Alternate Configuration"\
979 --textbox help.out $ROWS $COLS
983 set +f ## Switch file expansion ON
984 rm -f help.out MCdialog.out
988 # Create a menu item to store an alternate config file.
991 echo -n "save_alt_config 'Save Configuration to an Alternate File' "\
996 # Get an alternate config file name and save the current
997 # configuration to it.
1000 set -f ## Switch file expansion OFF
1004 $DIALOG --backtitle "$backtitle" \
1006 Enter a filename to which this configuration should be saved \
1007 as an alternate. Leave blank to abort."\
1008 10 55 "$ALT_CONFIG" 2>MCdialog.out
1012 ALT_CONFIG=`cat MCdialog.out`
1014 [ "_" = "_$ALT_CONFIG" ] && break
1016 if eval touch $ALT_CONFIG 2>/dev/null
1018 eval save_configuration $ALT_CONFIG
1019 load_functions ## RELOAD
1023 $DIALOG --backtitle "$backtitle" \
1024 --infobox "Can't create file! Probably a nonexistent directory." 3 60
1030 For various reasons, one may wish to keep different kernel
1031 configurations available on a single machine.
1033 Entering a file name here will allow you to later retrieve, modify
1034 and use the current configuration as an alternate to whatever
1035 configuration options you have selected at that time.
1037 If you are uncertain what all this means then you should probably
1040 $DIALOG --backtitle "$backtitle"\
1041 --title "Save Alternate Configuration"\
1042 --textbox help.out $ROWS $COLS
1046 set +f ## Switch file expansion ON
1047 rm -f help.out MCdialog.out
1051 # Load config options from a file.
1052 # Converts all "# OPTION is not set" lines to "OPTION=n" lines
1054 function load_config_file () {
1056 /# .* is not set.*/ { printf("%s=n\n", $2) }
1057 ! /# .* is not set.*/ { print }
1065 # Just what it says.
1067 save_configuration () {
1069 echo -n "Saving your kernel configuration."
1072 # Now, let's redefine the configuration functions for final
1073 # output to the config files.
1075 # Nested function definitions, YIPEE!
1079 eval define_bool \"$2\" \"$x\"
1082 function tristate () {
1084 eval define_tristate \"$2\" \"$x\"
1087 function dep_tristate () {
1091 while [ $# -gt 0 ]; do
1092 if [ "$1" = y ]; then
1094 elif [ "$1" = m -a "$x" != n ]; then
1100 define_tristate "$var" "$x"
1103 function dep_bool () {
1107 while [ $# -gt 0 ]; do
1108 if [ "$1" = y ]; then
1114 define_bool "$var" "$x"
1117 function dep_mbool () {
1121 while [ $# -gt 0 ]; do
1122 if [ "$1" = y -o "$1" = m ]; then
1128 define_bool "$var" "$x"
1132 set_x_info "$2" "$3"
1133 echo "$2=$x" >>$CONFIG
1134 echo "#define $2 ($x)" >>$CONFIG_H
1138 set_x_info "$2" "$3"
1139 echo "$2=$x" >>$CONFIG
1140 echo "#define $2 0x${x##*[x,X]}" >>$CONFIG_H
1143 function string () {
1144 set_x_info "$2" "$3"
1145 echo "$2=\"$x\"" >>$CONFIG
1146 echo "#define $2 \"$x\"" >>$CONFIG_H
1149 function define_hex () {
1151 echo "$1=$2" >>$CONFIG
1152 echo "#define $1 0x${2##*[x,X]}" >>$CONFIG_H
1155 function define_int () {
1157 echo "$1=$2" >>$CONFIG
1158 echo "#define $1 ($2)" >>$CONFIG_H
1161 function define_string () {
1163 echo "$1=\"$2\"" >>$CONFIG
1164 echo "#define $1 \"$2\"" >>$CONFIG_H
1167 function define_bool () {
1168 define_tristate "$1" "$2"
1171 function define_tristate () {
1176 echo "$1=y" >>$CONFIG
1177 echo "#define $1 1" >>$CONFIG_H
1181 if [ "$CONFIG_MODULES" = "y" ]
1183 echo "$1=m" >>$CONFIG
1184 echo "#undef $1" >>$CONFIG_H
1185 echo "#define $1_MODULE 1" >>$CONFIG_H
1187 echo "$1=y" >>$CONFIG
1188 echo "#define $1 1" >>$CONFIG_H
1193 echo "# $1 is not set" >>$CONFIG
1194 echo "#undef $1" >>$CONFIG_H
1199 function choice () {
1201 # Find the first choice that's already set to 'y'
1211 if eval [ \"_\$$2\" = \"_y\" ]
1220 # Use the default if none were set.
1222 : ${current:=$default}
1225 # Output all choices (to be compatible with other configs).
1231 "$current"*) if [ -z "$chosen" ]; then
1232 define_bool "$2" "y"
1235 define_bool "$2" "n"
1237 *) define_bool "$2" "n" ;;
1243 function mainmenu_name () {
1247 function mainmenu_option () {
1248 comment_is_option=TRUE
1251 function endmenu () {
1255 function comment () {
1256 if [ "$comment_is_option" ]
1261 echo "# $1" >>$CONFIG
1265 echo "/*" >>$CONFIG_H
1266 echo " * $1" >>$CONFIG_H
1267 echo " */" >>$CONFIG_H
1273 DEF_CONFIG="${1:-.config}"
1274 DEF_CONFIG_H="include/linux/autoconf.h"
1277 CONFIG_H=.tmpconfig.h
1280 echo "# Automatically generated by make menuconfig: don't edit" >>$CONFIG
1283 echo "/*" >$CONFIG_H
1284 echo " * Automatically generated by make menuconfig: don't edit" >>$CONFIG_H
1285 echo " */" >>$CONFIG_H
1286 echo "#define AUTOCONF_INCLUDED" >> $CONFIG_H
1289 if . $CONFIG_IN >>.menuconfig.log 2>&1
1291 if [ "$DEF_CONFIG" = ".config" ]
1293 mv $CONFIG_H $DEF_CONFIG_H
1296 if [ -f "$DEF_CONFIG" ]
1298 rm -f ${DEF_CONFIG}.old
1299 mv $DEF_CONFIG ${DEF_CONFIG}.old
1302 mv $CONFIG $DEF_CONFIG
1311 # Remove temporary files
1319 rm -f MCmenu* MCradiolists MCdialog.out help.out
1323 rm -f .tmpconfig .tmpconfig.h
1327 # Some distributions export these with incorrect values
1328 # which can really screw up some ncurses programs.
1331 ROWS=${1:-24} COLS=${2:-80}
1333 # Just in case the nasty rlogin bug returns.
1335 [ $ROWS = 0 ] && ROWS=24
1336 [ $COLS = 0 ] && COLS=80
1338 if [ $ROWS -lt 19 -o $COLS -lt 80 ]
1340 echo -e "\n\007Your display is too small to run Menuconfig!"
1341 echo "It must be at least 19 lines by 80 columns."
1345 ROWS=$((ROWS-4)) COLS=$((COLS-5))
1349 set_geometry `stty size 2>/dev/null`
1351 menu_instructions="\
1352 Arrow keys navigate the menu. \
1353 <Enter> selects submenus --->. \
1354 Highlighted letters are hotkeys. \
1355 Pressing <Y> includes, <N> excludes, <M> modularizes features. \
1356 Press <Esc><Esc> to exit, <?> for Help. \
1357 Legend: [*] built-in [ ] excluded <M> module < > module capable"
1359 radiolist_instructions="\
1360 Use the arrow keys to navigate this window or \
1361 press the hotkey of the item you wish to select \
1362 followed by the <SPACE BAR>.
1363 Press <?> for additional information about this option."
1365 inputbox_instructions_int="\
1366 Please enter a decimal value. \
1367 Fractions will not be accepted. \
1368 Use the <TAB> key to move from the input field to the buttons below it."
1370 inputbox_instructions_hex="\
1371 Please enter a hexadecimal value. \
1372 Use the <TAB> key to move from the input field to the buttons below it."
1374 inputbox_instructions_string="\
1375 Please enter a string value. \
1376 Use the <TAB> key to move from the input field to the buttons below it."
1378 DIALOG="./scripts/lxdialog/lxdialog"
1380 kernel_version="${VERSION}.${PATCHLEVEL}.${SUBLEVEL}${EXTRAVERSION}"
1382 backtitle="Linux Kernel v$kernel_version Configuration"
1384 trap "cleanup ; exit 1" 1 2 15
1388 # Locate default files.
1390 CONFIG_IN=./config.in
1391 if [ "$1" != "" ] ; then
1395 DEFAULTS=arch/$ARCH/defconfig
1396 if [ -f .config ]; then
1402 echo "Using defaults found in" $DEFAULTS
1403 load_config_file $DEFAULTS
1405 echo "No defaults found"
1412 # Load the functions used by the config.in files.
1413 echo -n "Preparing scripts: functions"
1416 if [ ! -e $CONFIG_IN ]
1418 echo "Your main config.in file ($CONFIG_IN) does not exist"
1424 echo "Your lxdialog utility does not exist"
1429 # Read config.in files and parse them into one shell function per menu.
1432 parse_config_files $CONFIG_IN
1436 # Start the ball rolling from the top.
1438 activate_menu MCmenu0
1448 if $DIALOG --backtitle "$backtitle" \
1449 --yesno "Do you wish to save your new kernel configuration?" 5 60
1454 echo "*** End of Linux kernel configuration."
1455 echo "*** Check the top-level Makefile for additional configuration."
1456 if [ ! -f .hdepend -o "$CONFIG_MODVERSIONS" = "y" ] ; then
1457 echo "*** Next, you must run 'make dep'."
1459 echo "*** Next, you may run 'make bzImage', 'make bzdisk', or 'make install'."
1465 echo Your kernel configuration changes were NOT saved.
1469 # Remove log if empty.
1470 if [ ! -s .menuconfig.log ] ; then
1471 rm -f .menuconfig.log