mirror of https://github.com/docker/docs.git
Merge pull request #5336 from tianon/slightly-more-organized-check-config
Move "possible config locations" list to the top of check-config.sh
This commit is contained in:
commit
6b0f0af0e9
|
|
@ -4,7 +4,13 @@ set -e
|
||||||
# bits of this were adapted from lxc-checkconfig
|
# bits of this were adapted from lxc-checkconfig
|
||||||
# see also https://github.com/lxc/lxc/blob/lxc-1.0.2/src/lxc/lxc-checkconfig.in
|
# see also https://github.com/lxc/lxc/blob/lxc-1.0.2/src/lxc/lxc-checkconfig.in
|
||||||
|
|
||||||
: ${CONFIG:=/proc/config.gz}
|
possibleConfigs=(
|
||||||
|
'/proc/config.gz'
|
||||||
|
"/boot/config-$(uname -r)"
|
||||||
|
"/usr/src/linux-$(uname -r)/.config"
|
||||||
|
'/usr/src/linux/.config'
|
||||||
|
)
|
||||||
|
: ${CONFIG:="${possibleConfigs[0]}"}
|
||||||
|
|
||||||
if ! command -v zgrep &> /dev/null; then
|
if ! command -v zgrep &> /dev/null; then
|
||||||
zgrep() {
|
zgrep() {
|
||||||
|
|
@ -74,11 +80,7 @@ check_flags() {
|
||||||
|
|
||||||
if [ ! -e "$CONFIG" ]; then
|
if [ ! -e "$CONFIG" ]; then
|
||||||
wrap_warning "warning: $CONFIG does not exist, searching other paths for kernel config..."
|
wrap_warning "warning: $CONFIG does not exist, searching other paths for kernel config..."
|
||||||
for tryConfig in \
|
for tryConfig in "${possibleConfigs[@]}"; do
|
||||||
'/proc/config.gz' \
|
|
||||||
"/boot/config-$(uname -r)" \
|
|
||||||
'/usr/src/linux/.config' \
|
|
||||||
; do
|
|
||||||
if [ -e "$tryConfig" ]; then
|
if [ -e "$tryConfig" ]; then
|
||||||
CONFIG="$tryConfig"
|
CONFIG="$tryConfig"
|
||||||
break
|
break
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue