Commit 8208b295 by Guillaume Zitta Committed by Daniel Lezcano

make lxc-checkconfig more explicit

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 Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com> Modified-by: 's avatarDaniel Lezcano <daniel.lezcano@free.fr> Signed-off-by: 's avatarGuillaume Zitta <lxc@zitta.fr>
parent 10e657e5
...@@ -26,9 +26,9 @@ is_enabled() { ...@@ -26,9 +26,9 @@ is_enabled() {
$SETCOLOR_SUCCESS && echo -e "enabled" && $SETCOLOR_NORMAL $SETCOLOR_SUCCESS && echo -e "enabled" && $SETCOLOR_NORMAL
else else
if [ ! -z "$mandatory" -a "$mandatory" = yes ]; then if [ ! -z "$mandatory" -a "$mandatory" = yes ]; then
$SETCOLOR_FAILURE && echo -e "disabled" && $SETCOLOR_NORMAL $SETCOLOR_FAILURE && echo -e "required" && $SETCOLOR_NORMAL
else else
$SETCOLOR_WARNING && echo -e "disabled" && $SETCOLOR_NORMAL $SETCOLOR_WARNING && echo -e "missing" && $SETCOLOR_NORMAL
fi fi
fi fi
} }
...@@ -43,8 +43,10 @@ if [ ! -f $CONFIG ]; then ...@@ -43,8 +43,10 @@ if [ ! -f $CONFIG ]; then
GREP=grep GREP=grep
if [ ! -f $CONFIG ]; then if [ ! -f $CONFIG ]; then
echo echo
echo "The kernel configuration can not be retrieved" echo "The kernel configuration can not be retrieved."
echo "Please recompile with IKCONFIG_PROC or install the kernel headers" echo "Please recompile with IKCONFIG_PROC, or"
echo "install the kernel headers, or specify"
echo "the path to the config file with: CONFIG=<path> lxc-checkconfig"
echo echo
exit 1 exit 1
else else
...@@ -74,4 +76,13 @@ echo "--- Misc ---" ...@@ -74,4 +76,13 @@ echo "--- Misc ---"
echo -n "Veth pair device: " && is_enabled CONFIG_VETH echo -n "Veth pair device: " && is_enabled CONFIG_VETH
echo -n "Macvlan: " && is_enabled CONFIG_MACVLAN echo -n "Macvlan: " && is_enabled CONFIG_MACVLAN
echo -n "Vlan: " && is_enabled CONFIG_VLAN_8021Q 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 booting a new kernel, you can check its configuration"
echo "usage : CONFIG=/path/to/config $0"
echo
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