File tree Expand file tree Collapse file tree 1 file changed +20
-7
lines changed Expand file tree Collapse file tree 1 file changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,12 @@ possibleConfigs=(
1010 " /usr/src/linux-$( uname -r) /.config"
1111 ' /usr/src/linux/.config'
1212)
13-
13+ possibleConfigFiles=(
14+ ' config.gz'
15+ " config-$( uname -r) "
16+ ' .config'
17+ )
18+
1419if [ $# -gt 0 ]; then
1520 CONFIG=" $1 "
1621else
@@ -110,15 +115,23 @@ check_distro_userns() {
110115 fi
111116}
112117
113- if [ ! -e " $CONFIG " ]; then
114- wrap_warning " warning: $CONFIG does not exist, searching other paths for kernel config ..."
115- for tryConfig in " ${possibleConfigs[@]} " ; do
116- if [ -e " $tryConfig " ]; then
118+ if [ ! -f " $CONFIG " ]; then
119+ wrap_warning " warning: $CONFIG seems not a kernel config, searching other paths for kernel config ..."
120+ for tryConfig in " $CONFIG " " ${possibleConfigs[@]} " ; do
121+ [[ -d " $tryConfig " ]] && {
122+ for tryFile in " ${possibleConfigFiles[@]} " ; do
123+ [[ -f " $tryConfig /$tryFile " ]] && {
124+ tryConfig+=" /$tryFile "
125+ break
126+ }
127+ done
128+ }
129+ [[ -f " $tryConfig " ]] && {
117130 CONFIG=" $tryConfig "
118131 break
119- fi
132+ }
120133 done
121- if [ ! -e " $CONFIG " ]; then
134+ if [ ! -f " $CONFIG " ]; then
122135 wrap_warning " error: cannot find kernel config"
123136 wrap_warning " try running this script again, specifying the kernel config:"
124137 wrap_warning " CONFIG=/path/to/kernel/.config $0 or $0 /path/to/kernel/.config"
You can’t perform that action at this time.
0 commit comments