mirror of
git://github.com/lxc/lxc
synced 2025-08-30 22:19:28 +00:00
Fix checkconfig to handle kernel memory cgroup name change
The kernel config option for the memory cgroup was changed in 3.6 from CONFIG_CGROUP_MEM_RES_CTLR to CONFIG_MEMCG with commit c255a458. Signed-off-by: Dwight Engen <dwight.engen@oracle.com> Acked-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
committed by
Stéphane Graber
parent
ad493d03fe
commit
c93c7b1a0b
@@ -68,6 +68,15 @@ print_cgroups() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CGROUP_MNT_PATH=`print_cgroups cgroup /proc/self/mounts | head -1`
|
CGROUP_MNT_PATH=`print_cgroups cgroup /proc/self/mounts | head -1`
|
||||||
|
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/')
|
||||||
|
else
|
||||||
|
KVER_MINOR=$($GREP '^# Linux' $CONFIG | \
|
||||||
|
sed -r 's/.* [0-9]\.([0-9]{1,3})\.[0-9]{1,3}.*/\1/')
|
||||||
|
fi
|
||||||
|
|
||||||
echo -n "Cgroup: " && is_enabled CONFIG_CGROUPS yes
|
echo -n "Cgroup: " && is_enabled CONFIG_CGROUPS yes
|
||||||
|
|
||||||
@@ -80,22 +89,18 @@ fi
|
|||||||
echo -n "Cgroup device: " && is_enabled CONFIG_CGROUP_DEVICE
|
echo -n "Cgroup device: " && is_enabled CONFIG_CGROUP_DEVICE
|
||||||
echo -n "Cgroup sched: " && is_enabled CONFIG_CGROUP_SCHED
|
echo -n "Cgroup sched: " && is_enabled CONFIG_CGROUP_SCHED
|
||||||
echo -n "Cgroup cpu account: " && is_enabled CONFIG_CGROUP_CPUACCT
|
echo -n "Cgroup cpu account: " && is_enabled CONFIG_CGROUP_CPUACCT
|
||||||
echo -n "Cgroup memory controller: " && is_enabled CONFIG_CGROUP_MEM_RES_CTLR
|
echo -n "Cgroup memory controller: "
|
||||||
|
if [ $KVER_MAJOR -ge 3 -a $KVER_MINOR -ge 6 ]; then
|
||||||
|
is_enabled CONFIG_MEMCG
|
||||||
|
else
|
||||||
|
is_enabled CONFIG_CGROUP_MEM_RES_CTLR
|
||||||
|
fi
|
||||||
is_set CONFIG_SMP && echo -n "Cgroup cpuset: " && is_enabled CONFIG_CPUSETS
|
is_set CONFIG_SMP && echo -n "Cgroup cpuset: " && is_enabled CONFIG_CPUSETS
|
||||||
echo
|
echo
|
||||||
echo "--- Misc ---"
|
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
|
||||||
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/')
|
|
||||||
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: " &&
|
echo -n "File capabilities: " &&
|
||||||
( [[ ${KVER_MAJOR} == 2 && ${KVER_MINOR} < 33 ]] &&
|
( [[ ${KVER_MAJOR} == 2 && ${KVER_MINOR} < 33 ]] &&
|
||||||
is_enabled CONFIG_SECURITY_FILE_CAPABILITIES ) ||
|
is_enabled CONFIG_SECURITY_FILE_CAPABILITIES ) ||
|
||||||
|
Reference in New Issue
Block a user