Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etercifs
Project
Project
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etercifs
Commits
c35e0023
Commit
c35e0023
authored
Feb 05, 2016
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rewrite for separate OpenVZ-kernels checking
parent
08a553d4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
13 deletions
+26
-13
functions.sh
etercifs/functions.sh
+26
-13
No files found.
etercifs/functions.sh
View file @
c35e0023
...
...
@@ -45,18 +45,27 @@ split_kernel_version()
N3
=
`
echo
$KERNEL
|
cut
-d
"."
-f
3 |
cut
-d
"-"
-f
1
`
}
check_for_openvz
()
{
if
echo
"
$KERNELVERSION
"
| egrep
-q
"2
\.
6
\.
18.*(stab|ovz-el|ovz-rhel)"
;
then
OVZ_KERNEL
=
"centos-ovz"
elif
echo
"
$KERNELVERSION
"
| egrep
-q
"2
\.
6
\.
32.*(stab|ovz-el|ovz-smp|ovz-rhel|openvz)"
;
then
OVZ_KERNEL
=
"centos60"
else
return
1
fi
return
0
}
check_for_centos
()
{
SPECIFIC_CENTOS
=
if
which lsb_release
>
/dev/null
;
then
lsb_release
-d
| egrep
-q
'CentOS|Red Hat|Scientific Linux|NauLinux|LinuxWizard Server|RERemix|ROSA'
&&
SPECIFIC_CENTOS
=
1
lsb_release
-d
| egrep
-q
'CentOS|Red Hat|Scientific Linux|NauLinux|LinuxWizard Server|RERemix|ROSA'
||
return
fi
if
[
-n
"
$SPECIFIC_CENTOS
"
]
;
then
echo
echo
"Found RHEL-like distribution."
OVZ_KERNEL
=
`
echo
$KERNELVERSION
|
grep
'stab'
`
kernel_release4
N1
=
`
echo
$KERNEL4
|
cut
-d
"."
-f
1
`
N2
=
`
echo
$KERNEL4
|
cut
-d
"."
-f
2
`
...
...
@@ -121,19 +130,21 @@ check_for_centos()
else
echo
"Warning! Your kernel in not 2.6.x"
fi
fi
return
0
}
detect_etercifs_sources
()
{
# CentOS-RHEL specific part
check_for_centos
if
[
-n
"
$SPECIFIC_CENTOS
"
]
;
then
if
check_for_openvz
;
then
[
-n
"
$ETERCIFS_SOURCES_LIST
"
]
||
ETERCIFS_SOURCES_LIST
=
$DATADIR
/sources/kernel-source-etercifs-
*
if
[
"
$OVZ_KERNEL
"
]
;
then
echo
"Building from legacy sources with patch for OpenVZ kernels
$OVZ_KERNEL
"
KERNEL_STRING
=
"
$OVZ_KERNEL
"
fi
elif
check_for_centos
;
then
[
-n
"
$ETERCIFS_SOURCES_LIST
"
]
||
ETERCIFS_SOURCES_LIST
=
$DATADIR
/sources/kernel-source-etercifs-
*
if
[
-n
"
$OVZ_KERNEL
"
]
;
then
echo
"Building from legacy sources with patch for OpenVZ kernels 2.6.18-274.x from CentOS 5.7."
KERNEL_STRING
=
'centos-ovz'
elif
[
"
$CENTOS
"
-eq
70
]
;
then
if
[
"
$CENTOS
"
-eq
70
]
;
then
echo
"Building from legacy sources with patch for kernels 3.10.x from CentOS 7.0."
KERNEL_STRING
=
'centos70'
elif
[
"
$CENTOS
"
-eq
60
]
;
then
...
...
@@ -167,10 +178,12 @@ detect_etercifs_sources()
if
[
"
$FIRSTNUM
"
-eq
2
]
;
then
[
-n
"
$ETERCIFS_SOURCES_LIST
"
]
||
ETERCIFS_SOURCES_LIST
=
$DATADIR
/sources/kernel-source-etercifs-2
*
KERNEL_STRING
=
$KERNEL
echo
"Building for
$KERNEL_STRING
"
elif
[
"
$FIRSTNUM
"
-eq
3
]
||
[
"
$FIRSTNUM
"
-eq
4
]
;
then
[
-n
"
$ETERCIFS_SOURCES_LIST
"
]
||
ETERCIFS_SOURCES_LIST
=
$DATADIR
/sources/kernel-source-etercifs-
$FIRSTNUM
*
kernel_release2
KERNEL_STRING
=
$KERNEL2
echo
"Building for
$KERNEL_STRING
"
fi
fi
...
...
@@ -182,7 +195,7 @@ detect_etercifs_sources()
KERNEL_SOURCE_ETERCIFS_LINK
=
`
ls
-1
$ETERCIFS_SOURCES_LIST
|
sort
-r
-V
|
head
-n
1
`
LATEST_SOURCES
=
`
echo
$KERNEL_SOURCE_ETERCIFS_LINK
|
cut
-d
"-"
-f
4
`
echo
"Warning! Couldn't find module sources for the current kernel
$KERNEL2
(
$LATEST_SOURCES
sources are selected)!"
echo
"Using the lates supported sources - from v
$LATEST_SOURCES
kernel!"
echo
"Using the lates
t
supported sources - from v
$LATEST_SOURCES
kernel!"
ETERCIFS_SOURCES_LIST
=
$DATADIR
/sources/kernel-source-etercifs
*
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