~ubuntu-branches/ubuntu/quantal/lxc/quantal-201206191543

« back to all changes in this revision

Viewing changes to src/lxc/lxc-checkconfig.in

  • Committer: Package Import Robot
  • Author(s): Daniel Baumann
  • Date: 2012-03-09 13:05:03 UTC
  • mto: (3.1.38 sid)
  • mto: This revision was merged to the branch mainline in revision 94.
  • Revision ID: package-import@ubuntu.com-20120309130503-j0prgw9tsp967bbv
Tags: upstream-0.8.0~rc1
ImportĀ upstreamĀ versionĀ 0.8.0~rc1

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
echo
64
64
echo "--- Control groups ---"
65
65
 
66
 
CGROUP_MNT_PATH=$(grep -m1 "^cgroup" /proc/self/mounts | awk '{ print $2 }')
 
66
print_cgroups() {
 
67
  # print all mountpoints for cgroup filesystems
 
68
  awk '$1 !~ /#/ && $3 == mp { print $2; } ; END { exit(0); } '  "mp=$1" "$2" ;
 
69
}
 
70
 
 
71
CGROUP_MNT_PATH=`print_cgroups cgroup /proc/self/mounts | head -1`
67
72
 
68
73
echo -n "Cgroup: " && is_enabled CONFIG_CGROUPS yes
69
74
 
83
88
echo -n "Veth pair device: " && is_enabled CONFIG_VETH
84
89
echo -n "Macvlan: " && is_enabled CONFIG_MACVLAN
85
90
echo -n "Vlan: " && is_enabled CONFIG_VLAN_8021Q
86
 
KVER_MINOR=$($GREP '^# Linux' $CONFIG | \
87
 
    sed -r 's/.*2.6.([0-9]{2}).*/\1/')
 
91
KVER_MAJOR=$($GREP '^# Linux' $CONFIG | \
 
92
    sed -r 's/.* ([0-9])\.[0-9]{1,2}\.[0-9]{1,3}.*/\1/')
 
93
if [[ $KVER_MAJOR == 2 ]]; then
 
94
KVER_MINOR=$($GREP '^# Linux' $CONFIG | \
 
95
    sed -r 's/.* 2.6.([0-9]{2}).*/\1/')
 
96
else
 
97
KVER_MINOR=$($GREP '^# Linux' $CONFIG | \
 
98
    sed -r 's/.* [0-9]\.([0-9]{1,3})\.[0-9]{1,3}.*/\1/')
 
99
fi
88
100
echo -n "File capabilities: " &&
89
 
    [[ ${KVER_MINOR} < 33 ]] && is_enabled CONFIG_SECURITY_FILE_CAPABILITIES ||
90
 
    [[ ${KVER_MINOR} > 32 ]] &&  $SETCOLOR_SUCCESS && echo -e "enabled" &&
91
 
    $SETCOLOR_NORMAL
 
101
    ( [[ ${KVER_MAJOR} == 2 && ${KVER_MINOR} < 33 ]] &&
 
102
       is_enabled CONFIG_SECURITY_FILE_CAPABILITIES ) ||
 
103
    ( [[ ( ${KVER_MAJOR} == 2 && ${KVER_MINOR} > 32 ) ||
 
104
         ${KVER_MAJOR} > 2 ]] && $SETCOLOR_SUCCESS &&
 
105
         echo -e "enabled" && $SETCOLOR_NORMAL )
92
106
 
93
107
echo
94
108
echo "Note : Before booting a new kernel, you can check its configuration"