Browse code

Enhance check-config.sh

Currently check-config.sh just said enable or missing, when I used
a fresh kernel, made check-config.sh happy, still can't start
container. It take me days debuging kernel and Docker and finally
found it's because I enabled some CONFIGs as modules and never
loaded these modules.

So I think it's necessary to let check-config.sh told users which
configs are enabled as modules.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>

Qiang Huang authored on 2015/05/15 11:20:31
Showing 1 changed files
... ...
@@ -26,6 +26,12 @@ fi
26 26
 is_set() {
27 27
 	zgrep "CONFIG_$1=[y|m]" "$CONFIG" > /dev/null
28 28
 }
29
+is_set_in_kernel() {
30
+	zgrep "CONFIG_$1=y" "$CONFIG" > /dev/null
31
+}
32
+is_set_as_module() {
33
+	zgrep "CONFIG_$1=m" "$CONFIG" > /dev/null
34
+}
29 35
 
30 36
 # see https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
31 37
 declare -A colors=(
... ...
@@ -70,8 +76,10 @@ wrap_warning() {
70 70
 }
71 71
 
72 72
 check_flag() {
73
-	if is_set "$1"; then
73
+	if is_set_in_kernel "$1"; then
74 74
 		wrap_good "CONFIG_$1" 'enabled'
75
+	elif is_set_as_module "$1"; then
76
+		wrap_good "CONFIG_$1" 'enabled (as module)'
75 77
 	else
76 78
 		wrap_bad "CONFIG_$1" 'missing'
77 79
 	fi