Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
dbadf422
Commit
dbadf422
authored
Dec 15, 2015
by
Stéphane Graber
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #721 from armcc/master
lxc-checkconfig: remove zgrep dependency
parents
727c3073
8c6edda4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
lxc-checkconfig.in
src/lxc/lxc-checkconfig.in
+11
-7
No files found.
src/lxc/lxc-checkconfig.in
View file @
dbadf422
#!/bin/sh
# Allow environment variables to override
grep and
config
# Allow environment variables to override config
:
${
CONFIG
:
=/proc/config.gz
}
:
${
GREP
:
=zgrep
}
:
${
MODNAME
:
=configs
}
CAT
=
"cat"
SETCOLOR_SUCCESS
=
"printf
\\
033[1;32m"
SETCOLOR_FAILURE
=
"printf
\\
033[1;31m"
SETCOLOR_WARNING
=
"printf
\\
033[1;33m"
SETCOLOR_NORMAL
=
"printf
\\
033[0;39m"
is_set
()
{
$
GREP
"
$1
=[y|m]"
$CONFIG
>
/dev/null
$
CAT
$CONFIG
|
grep
"
$1
=[y|m]"
>
/dev/null
return
$?
}
...
...
@@ -45,7 +46,6 @@ if [ ! -f $CONFIG ]; then
# although scripts/extract-ikconfig could be used to extract contents without loading kernel module
# http://svn.pld-linux.org/trac/svn/browser/geninitrd/trunk/geninitrd?rev=12696#L327
fi
GREP
=
grep
if
[
!
-f
$CONFIG
]
;
then
echo
"
$(
basename
$0
)
: unable to retrieve kernel configuration"
>
&2
echo
>
&2
...
...
@@ -61,6 +61,10 @@ if [ ! -f $CONFIG ]; then
fi
fi
if
gunzip
-tq
<
$CONFIG
2>/dev/null
;
then
CAT
=
"zcat"
fi
echo
"--- Namespaces ---"
echo
-n
"Namespaces: "
&&
is_enabled CONFIG_NAMESPACES
yes
echo
-n
"Utsname namespace: "
&&
is_enabled CONFIG_UTS_NS
...
...
@@ -78,13 +82,13 @@ print_cgroups() {
}
CGROUP_MNT_PATH
=
`
print_cgroups cgroup /proc/self/mounts |
head
-n
1
`
KVER_MAJOR
=
$(
$
GREP
'^# Linux.*Kernel Configuration'
$CONFIG
|
\
KVER_MAJOR
=
$(
$
CAT
$CONFIG
|
grep
'^# Linux.*Kernel Configuration'
|
\
sed
-r
's/.* ([0-9])\.[0-9]{1,2}\.[0-9]{1,3}.*/\1/'
)
if
[
"
$KVER_MAJOR
"
=
"2"
]
;
then
KVER_MINOR
=
$(
$
GREP
'^# Linux.*Kernel Configuration'
$CONFIG
|
\
KVER_MINOR
=
$(
$
CAT
$CONFIG
|
grep
'^# Linux.*Kernel Configuration'
|
\
sed
-r
's/.* 2.6.([0-9]{2}).*/\1/'
)
else
KVER_MINOR
=
$(
$
GREP
'^# Linux.*Kernel Configuration'
$CONFIG
|
\
KVER_MINOR
=
$(
$
CAT
$CONFIG
|
grep
'^# Linux.*Kernel Configuration'
|
\
sed
-r
's/.* [0-9]\.([0-9]{1,3})\.[0-9]{1,3}.*/\1/'
)
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment