diff options
author | Vadim A. Misbakh-Soloviov (mva) <gentoo@mva.name> | 2017-01-02 15:08:07 -0800 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2017-01-02 15:08:29 -0800 |
commit | 8de563ba9df1c81c23a8daccc7c69f45b31cb518 (patch) | |
tree | 576b273fad0b62b75bbc44d9f34c2c868a5af5aa | |
parent | Make early microcode loading optional. (diff) | |
download | genkernel-8de563ba9df1c81c23a8daccc7c69f45b31cb518.tar.gz genkernel-8de563ba9df1c81c23a8daccc7c69f45b31cb518.tar.bz2 genkernel-8de563ba9df1c81c23a8daccc7c69f45b31cb518.zip |
Implement kernel nconfig just like menuconfig.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-x | gen_cmdline.sh | 19 | ||||
-rwxr-xr-x | gen_configkernel.sh | 5 | ||||
-rwxr-xr-x | gen_determineargs.sh | 1 | ||||
-rw-r--r-- | genkernel.conf | 6 |
4 files changed, 31 insertions, 0 deletions
diff --git a/gen_cmdline.sh b/gen_cmdline.sh index f4392f9..0e1e7ef 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -27,6 +27,8 @@ longusage() { echo " Kernel Configuration settings" echo " --menuconfig Run menuconfig after oldconfig" echo " --no-menuconfig Do not run menuconfig after oldconfig" + echo " --nconfig Run nconfig after oldconfig" + echo " --no-nconfig Do not run nconfig after oldconfig" echo " --gconfig Run gconfig after oldconfig" echo " --no-gconfig Don't run gconfig after oldconfig" echo " --xconfig Run xconfig after oldconfig" @@ -185,6 +187,7 @@ usage() { echo echo 'Some useful options:' echo ' --menuconfig Run menuconfig after oldconfig' + echo ' --nconfig Run nconfig after oldconfig (requires ncurses)' echo ' --no-clean Do not run make clean before compilation' echo ' --no-mrproper Do not run make mrproper before compilation,' echo ' this is implied by --no-clean.' @@ -411,6 +414,22 @@ parse_cmdline() { CMD_MENUCONFIG=0 print_info 2 "CMD_MENUCONFIG: ${CMD_MENUCONFIG}" ;; + --nconfig) + TERM_LINES=`stty -a | head -n 1 | cut -d\ -f5 | cut -d\; -f1` + TERM_COLUMNS=`stty -a | head -n 1 | cut -d\ -f7 | cut -d\; -f1` + if [[ TERM_LINES -lt 19 || TERM_COLUMNS -lt 80 ]] + then + echo "Error: You need a terminal with at least 80 columns" + echo " and 19 lines for --nconfig; try --no-nconfig..." + exit 1 + fi + CMD_NCONFIG=1 + print_info 2 "CMD_NCONFIG: ${CMD_NCONFIG}" + ;; + --no-nconfig) + CMD_NCONFIG=0 + print_info 2 "CMD_NCONFIG: ${CMD_NCONFIG}" + ;; --gconfig|--no-gconfig) CMD_GCONFIG=`parse_optbool "$*"` print_info 2 "CMD_GCONFIG: ${CMD_GCONFIG}" diff --git a/gen_configkernel.sh b/gen_configkernel.sh index 74693f3..6ca0200 100755 --- a/gen_configkernel.sh +++ b/gen_configkernel.sh @@ -90,6 +90,11 @@ config_kernel() { print_info 1 'kernel: >> Invoking menuconfig...' compile_generic menuconfig kernelruntask [ "$?" ] || gen_die 'Error: menuconfig failed!' + elif isTrue ${NCONFIG} + then + print_info 1 'kernel: >> Invoking nconfig...' + compile_generic nconfig kernelruntask + [ "$?" ] || gen_die 'Error: nconfig failed!' elif isTrue ${CMD_GCONFIG} then print_info 1 'kernel: >> Invoking gconfig...' diff --git a/gen_determineargs.sh b/gen_determineargs.sh index 2dbd958..313dbd0 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -98,6 +98,7 @@ determine_real_args() { set_config_with_override BOOL POSTCLEAR CMD_POSTCLEAR set_config_with_override BOOL MRPROPER CMD_MRPROPER set_config_with_override BOOL MENUCONFIG CMD_MENUCONFIG + set_config_with_override BOOL NCONFIG CMD_NCONFIG set_config_with_override BOOL CLEAN CMD_CLEAN set_config_with_override STRING MINKERNPACKAGE CMD_MINKERNPACKAGE diff --git a/genkernel.conf b/genkernel.conf index e62d294..7e5a46f 100644 --- a/genkernel.conf +++ b/genkernel.conf @@ -17,6 +17,12 @@ OLDCONFIG="yes" # Run 'make menuconfig' before compiling this kernel? MENUCONFIG="no" +# Run 'make nconfig' (ncurses 'menuconfig') before compiling this kernel? +NCONFIG="no" + +# Note, that two previous lines are mutual exclusive (logically), while +# MENUCONFIG has a higher priority if both them is enabled. + # Run 'make clean' before compilation? # If set to NO, implies MRPROPER WILL NOT be run # Also, if clean is NO, it won't copy over any configuration |