1 |
commit: 8de563ba9df1c81c23a8daccc7c69f45b31cb518 |
2 |
Author: Vadim A. Misbakh-Soloviov (mva) <gentoo <AT> mva <DOT> name> |
3 |
AuthorDate: Mon Jan 2 23:08:07 2017 +0000 |
4 |
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jan 2 23:08:29 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=8de563ba |
7 |
|
8 |
Implement kernel nconfig just like menuconfig. |
9 |
|
10 |
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org> |
11 |
|
12 |
gen_cmdline.sh | 19 +++++++++++++++++++ |
13 |
gen_configkernel.sh | 5 +++++ |
14 |
gen_determineargs.sh | 1 + |
15 |
genkernel.conf | 6 ++++++ |
16 |
4 files changed, 31 insertions(+) |
17 |
|
18 |
diff --git a/gen_cmdline.sh b/gen_cmdline.sh |
19 |
index f4392f9..0e1e7ef 100755 |
20 |
--- a/gen_cmdline.sh |
21 |
+++ b/gen_cmdline.sh |
22 |
@@ -27,6 +27,8 @@ longusage() { |
23 |
echo " Kernel Configuration settings" |
24 |
echo " --menuconfig Run menuconfig after oldconfig" |
25 |
echo " --no-menuconfig Do not run menuconfig after oldconfig" |
26 |
+ echo " --nconfig Run nconfig after oldconfig" |
27 |
+ echo " --no-nconfig Do not run nconfig after oldconfig" |
28 |
echo " --gconfig Run gconfig after oldconfig" |
29 |
echo " --no-gconfig Don't run gconfig after oldconfig" |
30 |
echo " --xconfig Run xconfig after oldconfig" |
31 |
@@ -185,6 +187,7 @@ usage() { |
32 |
echo |
33 |
echo 'Some useful options:' |
34 |
echo ' --menuconfig Run menuconfig after oldconfig' |
35 |
+ echo ' --nconfig Run nconfig after oldconfig (requires ncurses)' |
36 |
echo ' --no-clean Do not run make clean before compilation' |
37 |
echo ' --no-mrproper Do not run make mrproper before compilation,' |
38 |
echo ' this is implied by --no-clean.' |
39 |
@@ -411,6 +414,22 @@ parse_cmdline() { |
40 |
CMD_MENUCONFIG=0 |
41 |
print_info 2 "CMD_MENUCONFIG: ${CMD_MENUCONFIG}" |
42 |
;; |
43 |
+ --nconfig) |
44 |
+ TERM_LINES=`stty -a | head -n 1 | cut -d\ -f5 | cut -d\; -f1` |
45 |
+ TERM_COLUMNS=`stty -a | head -n 1 | cut -d\ -f7 | cut -d\; -f1` |
46 |
+ if [[ TERM_LINES -lt 19 || TERM_COLUMNS -lt 80 ]] |
47 |
+ then |
48 |
+ echo "Error: You need a terminal with at least 80 columns" |
49 |
+ echo " and 19 lines for --nconfig; try --no-nconfig..." |
50 |
+ exit 1 |
51 |
+ fi |
52 |
+ CMD_NCONFIG=1 |
53 |
+ print_info 2 "CMD_NCONFIG: ${CMD_NCONFIG}" |
54 |
+ ;; |
55 |
+ --no-nconfig) |
56 |
+ CMD_NCONFIG=0 |
57 |
+ print_info 2 "CMD_NCONFIG: ${CMD_NCONFIG}" |
58 |
+ ;; |
59 |
--gconfig|--no-gconfig) |
60 |
CMD_GCONFIG=`parse_optbool "$*"` |
61 |
print_info 2 "CMD_GCONFIG: ${CMD_GCONFIG}" |
62 |
|
63 |
diff --git a/gen_configkernel.sh b/gen_configkernel.sh |
64 |
index 74693f3..6ca0200 100755 |
65 |
--- a/gen_configkernel.sh |
66 |
+++ b/gen_configkernel.sh |
67 |
@@ -90,6 +90,11 @@ config_kernel() { |
68 |
print_info 1 'kernel: >> Invoking menuconfig...' |
69 |
compile_generic menuconfig kernelruntask |
70 |
[ "$?" ] || gen_die 'Error: menuconfig failed!' |
71 |
+ elif isTrue ${NCONFIG} |
72 |
+ then |
73 |
+ print_info 1 'kernel: >> Invoking nconfig...' |
74 |
+ compile_generic nconfig kernelruntask |
75 |
+ [ "$?" ] || gen_die 'Error: nconfig failed!' |
76 |
elif isTrue ${CMD_GCONFIG} |
77 |
then |
78 |
print_info 1 'kernel: >> Invoking gconfig...' |
79 |
|
80 |
diff --git a/gen_determineargs.sh b/gen_determineargs.sh |
81 |
index 2dbd958..313dbd0 100755 |
82 |
--- a/gen_determineargs.sh |
83 |
+++ b/gen_determineargs.sh |
84 |
@@ -98,6 +98,7 @@ determine_real_args() { |
85 |
set_config_with_override BOOL POSTCLEAR CMD_POSTCLEAR |
86 |
set_config_with_override BOOL MRPROPER CMD_MRPROPER |
87 |
set_config_with_override BOOL MENUCONFIG CMD_MENUCONFIG |
88 |
+ set_config_with_override BOOL NCONFIG CMD_NCONFIG |
89 |
set_config_with_override BOOL CLEAN CMD_CLEAN |
90 |
|
91 |
set_config_with_override STRING MINKERNPACKAGE CMD_MINKERNPACKAGE |
92 |
|
93 |
diff --git a/genkernel.conf b/genkernel.conf |
94 |
index e62d294..7e5a46f 100644 |
95 |
--- a/genkernel.conf |
96 |
+++ b/genkernel.conf |
97 |
@@ -17,6 +17,12 @@ OLDCONFIG="yes" |
98 |
# Run 'make menuconfig' before compiling this kernel? |
99 |
MENUCONFIG="no" |
100 |
|
101 |
+# Run 'make nconfig' (ncurses 'menuconfig') before compiling this kernel? |
102 |
+NCONFIG="no" |
103 |
+ |
104 |
+# Note, that two previous lines are mutual exclusive (logically), while |
105 |
+# MENUCONFIG has a higher priority if both them is enabled. |
106 |
+ |
107 |
# Run 'make clean' before compilation? |
108 |
# If set to NO, implies MRPROPER WILL NOT be run |
109 |
# Also, if clean is NO, it won't copy over any configuration |