Commit 7e7f51d1 by Kristian Høgh Committed by Daniel Lezcano

lxc-checkconfig fails on a kernel compiled without IKCONFIG_PROC.

Hi Daniel, This patch retrieves info from kernel config in /lib/modules/`uname -r`/build/.config unless /proc/config.gz exist Signed-off-by: 's avatarKristian Høgh <kfh.lxc@kfh.dk> Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent 30761e83
#!/bin/bash #!/bin/bash
CONFIGZ=/proc/config.gz CONFIG=/proc/config.gz
GREP=zgrep
SETCOLOR_SUCCESS="echo -en \\033[1;32m" SETCOLOR_SUCCESS="echo -en \\033[1;32m"
SETCOLOR_FAILURE="echo -en \\033[1;31m" SETCOLOR_FAILURE="echo -en \\033[1;31m"
...@@ -8,7 +9,7 @@ SETCOLOR_NORMAL="echo -en \\033[0;39m" ...@@ -8,7 +9,7 @@ SETCOLOR_NORMAL="echo -en \\033[0;39m"
is_enabled() { is_enabled() {
mandatory=$2 mandatory=$2
zgrep -q "$1=y" $CONFIGZ $GREP -q "$1=[y|m]" $CONFIG
RES=$? RES=$?
if [ $RES = 0 ]; then if [ $RES = 0 ]; then
...@@ -22,14 +23,17 @@ is_enabled() { ...@@ -22,14 +23,17 @@ is_enabled() {
fi fi
} }
if [ ! -f $CONFIGZ ]; then if [ ! -f $CONFIG ]; then
echo KVER="`uname -r`"
echo "The kernel configuration can not be retrieved because" CONFIG="/lib/modules/$KVER/build/.config"
echo "\"$CONFIGZ\" was not found." GREP=grep
echo if [ ! -f $CONFIG ]; then
echo "Is your kernel compiled with IKCONFIG_PROC ?" echo
echo echo "The kernel configuration can not be retrieved"
exit 1 echo "Please recompile with IKCONFIG_PROC or install the kernel headers"
echo
exit 1
fi
fi fi
echo "--- Namespaces ---" echo "--- Namespaces ---"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment