Commit e4c0cf92 by Frederic Crozat Committed by Daniel Lezcano

handle kernel 3.x in lxc-checkconfig

Make sure to correctly detect kernel 3.x for file capabilities. Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent b031f0d2
......@@ -88,12 +88,21 @@ echo "--- Misc ---"
echo -n "Veth pair device: " && is_enabled CONFIG_VETH
echo -n "Macvlan: " && is_enabled CONFIG_MACVLAN
echo -n "Vlan: " && is_enabled CONFIG_VLAN_8021Q
KVER_MAJOR=$($GREP '^# Linux' $CONFIG | \
sed -r 's/.* ([0-9])\.[0-9]{1,2}\.[0-9]{1,3}.*/\1/')
if [[ $KVER_MAJOR == 2 ]]; then
KVER_MINOR=$($GREP '^# Linux' $CONFIG | \
sed -r 's/.*2.6.([0-9]{2}).*/\1/')
sed -r 's/.* 2.6.([0-9]{2}).*/\1/')
else
KVER_MINOR=$($GREP '^# Linux' $CONFIG | \
sed -r 's/.* [0-9]\.([0-9]{1,3})\.[0-9]{1,3}.*/\1/')
fi
echo -n "File capabilities: " &&
[[ ${KVER_MINOR} < 33 ]] && is_enabled CONFIG_SECURITY_FILE_CAPABILITIES ||
[[ ${KVER_MINOR} > 32 ]] && $SETCOLOR_SUCCESS && echo -e "enabled" &&
$SETCOLOR_NORMAL
( [[ ${KVER_MAJOR} == 2 && ${KVER_MINOR} < 33 ]] &&
is_enabled CONFIG_SECURITY_FILE_CAPABILITIES ) ||
( [[ ( ${KVER_MAJOR} == 2 && ${KVER_MINOR} > 32 ) ||
${KVER_MAJOR} > 2 ]] && $SETCOLOR_SUCCESS &&
echo -e "enabled" && $SETCOLOR_NORMAL )
echo
echo "Note : Before booting a new kernel, you can check its configuration"
......
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