[lxc-devel] patch for lxc-checkconfig
lxc at zitta.fr
lxc at zitta.fr
Sun Mar 14 06:55:44 UTC 2010
Hi,
With a friend, we installed lxc on his server.
We spend 1 hour on the kernel config because we didn't knew :
- that lxc-checkconfig is a bash script and it can check a config before
running it
- which kernel config item whas not good
- that CONFIG_SECURITY_FILE_CAPABILITIES is obsolete since 2.6.33
So, here is a patch for lxc-checkconfig that could save time for lxc newbies
--- /usr/sbin/lxc-checkconfig 2010-03-12 14:35:38.000000000 +0100
+++ /usr/local/bin/lxc-checkconfig 2010-03-14 07:46:53.940193560 +0100
@@ -19,8 +19,10 @@
else
if [ ! -z "$mandatory" -a "$mandatory" = yes ]; then
$SETCOLOR_FAILURE && echo -e "disabled" && $SETCOLOR_NORMAL
+ echo -e "\tmissing conf: $1"
else
$SETCOLOR_WARNING && echo -e "disabled" && $SETCOLOR_NORMAL
+ echo -e "\tmissing conf: $1"
fi
fi
}
@@ -35,6 +37,7 @@
GREP=grep
if [ ! -f $CONFIG ]; then
echo
+ echo "$CONFIG not found"
echo "The kernel configuration can not be retrieved"
echo "Please recompile with IKCONFIG_PROC or install the kernel
headers"
echo
@@ -66,4 +69,8 @@
echo -n "Veth pair device: " && is_enabled CONFIG_VETH
echo -n "Macvlan: " && is_enabled CONFIG_MACVLAN
echo -n "Vlan: " && is_enabled CONFIG_VLAN_8021Q
-echo -n "File capabilities: " && is_enabled
CONFIG_SECURITY_FILE_CAPABILITIES
+KVER_MINOR=$($GREP '^# Linux kernel version:' $CONFIG | sed -r
's/.*2.6.([0-9]{2}).*/\1/')
+[[ ${KVER_MINOR} < 33 ]] && echo -n "File capabilities: " && is_enabled
CONFIG_SECURITY_FILE_CAPABILITIES
+echo
+echo "Note : Before using a new kernel config, you could check it"
+echo "usage : CONFIG=/path/to/config $0"
Regards,
Guillaume ZITTA
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20100314/dcfae582/attachment.html>
More information about the lxc-devel
mailing list