]> git.pld-linux.org Git - packages/lxc.git/blob - checkconfig-module.patch
94fa1389f2f110a1bbe1d54bee8454788a794e82
[packages/lxc.git] / checkconfig-module.patch
1 --- lxc-0.9.0/src/lxc/lxc-checkconfig.in~       2013-02-18 09:47:43.000000000 +0200
2 +++ lxc-0.9.0/src/lxc/lxc-checkconfig.in        2013-09-17 11:58:24.442289798 +0300
3 @@ -3,6 +3,7 @@
4  # Allow environment variables to override grep and config
5  : ${CONFIG:=/proc/config.gz}
6  : ${GREP:=zgrep}
7 +: ${MODNAME:=configs}
8  
9  SETCOLOR_SUCCESS="printf \\033[1;32m"
10  SETCOLOR_FAILURE="printf \\033[1;31m"
11 @@ -38,10 +39,19 @@
12      BOOT_CONFIG="/boot/config-$KVER"
13      [ -f "${HEADERS_CONFIG}" ] && CONFIG=${HEADERS_CONFIG}
14      [ -f "${BOOT_CONFIG}" ] && CONFIG=${BOOT_CONFIG}
15 +    if [ ! -f "$CONFIG" ]; then
16 +        MODULEFILE=$(modinfo -k $KVER -n $MODNAME 2> /dev/null)
17 +        # don't want to modprobe, so give user a hint
18 +        # altho scripts/extract-ikconfig could be used to extract contents without loading kernel module
19 +        # http://svn.pld-linux.org/trac/svn/browser/geninitrd/trunk/geninitrd?rev=12696#L327
20 +    fi
21      GREP=grep
22      if [ ! -f $CONFIG ]; then
23          echo "$(basename $0): unable to retrieve kernel configuration" >&2
24          echo >&2
25 +        if [ -f "$MODULEFILE" ]; then
26 +            echo "Try modprobe $MODNAME module, or" >&2
27 +        fi
28          echo "Try recompiling with IKCONFIG_PROC, installing the kernel headers," >&2
29          echo "or specifying the kernel configuration path with:" >&2
30          echo "  CONFIG=<path> $(basename $0)" >&2
This page took 0.029564 seconds and 2 git commands to generate.