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
058c431c
Commit
058c431c
authored
Mar 05, 2017
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve kernel source variable using
parent
b1e3141a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
functions.sh
etercifs/functions.sh
+16
-15
No files found.
etercifs/functions.sh
View file @
058c431c
...
...
@@ -28,27 +28,27 @@ ETERCIFS_SOURCES_TARBALL=$DATADIR/etercifs-sources-$MODULEVERSION.tar.xz
kernel_release2
()
{
# 3.0
KERNEL
=
`
echo
$KERNELVERSION
|
sed
's/\([0-9]\+\.[0-9]\+\).*/\1/'
`
KERNEL
=
`
echo
"
$KERNELVERSION
"
|
sed
's/\([0-9]\+\.[0-9]\+\).*/\1/'
`
}
kernel_release3
()
{
# 2.6.27
KERNEL
=
`
echo
$KERNELVERSION
|
sed
's/\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/'
`
KERNEL
=
`
echo
"
$KERNELVERSION
"
|
sed
's/\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/'
`
}
kernel_release4
()
{
# 2.6.18-128 or 2.6.29.1
KERNEL
=
`
echo
$KERNELVERSION
|
sed
's/\([0-9]\+\.[0-9]\+\.[0-9]\+[\.-][0-9]\+\).*/\1/'
`
KERNEL
=
`
echo
"
$KERNELVERSION
"
|
sed
's/\([0-9]\+\.[0-9]\+\.[0-9]\+[\.-][0-9]\+\).*/\1/'
`
}
split_kernel_version
()
{
N1
=
`
echo
$KERNEL
|
cut
-d
"."
-f
1
`
N2
=
`
echo
$KERNEL
|
cut
-d
"."
-f
2
`
N3
=
`
echo
$KERNEL
|
cut
-d
"."
-f
3 |
cut
-d
"-"
-f
1
`
N4
=
`
echo
$KERNEL
|
cut
-d
"-"
-f
2 |
cut
-d
"."
-f
1
`
N1
=
$(
echo
"
$KERNEL
"
|
cut
-d
"."
-f
1
)
N2
=
$(
echo
"
$KERNEL
"
|
cut
-d
"."
-f
2
)
N3
=
$(
echo
"
$KERNEL
"
|
cut
-d
"."
-f
3 |
cut
-d
"-"
-f
1
)
N4
=
$(
echo
"
$KERNEL
"
|
cut
-d
"-"
-f
2 |
cut
-d
"."
-f
1
)
}
list_source_versions
()
...
...
@@ -200,12 +200,12 @@ detect_etercifs_sources()
if
[
"
$N1
"
-eq
2
]
;
then
# 2.x.x regular kernel
KERNEL_STRING
=
$KERNEL
echo
"Building for
$KERNEL_STRING
"
echo
"Building for
$KERNEL_STRING
kernel version
"
else
# some normal and modern kernel
kernel_release2
KERNEL_STRING
=
$KERNEL
echo
"Building for
$KERNEL_STRING
"
echo
"Building for
$KERNEL_STRING
kernel version
"
fi
fi
...
...
@@ -300,7 +300,8 @@ detect_host_kernel()
[
-d
"
$KN
"
]
&&
KERNSRC
=
"
$KN
"
fi
else
[
-n
"
$KV
"
]
||
fatal
"Set both KERNSRC and KERNVERSION"
# [ -n "$KV" ] || fatal "Set both KERNSRC and KERNVERSION"
KERNELVERSION
=
$(
basename
$(
dirname
"
$KERNSRC
"
))
fi
}
...
...
@@ -310,7 +311,7 @@ check_headers()
# TODO: use distr_vendor
# TODO: use eepm, try install
cat
>
&2
<<
EOF
Error: no kernel headers found at
$KERNSRC
, there are follow:
Error: no kernel headers found at
$KERNSRC
, there are follow
s only
:
$(
list_kernel_headers
)
Please install follow package for the current kernel:
...
...
@@ -320,9 +321,9 @@ Please install follow package for the current kernel:
kernel-source-XXXX for SUSE Linux
kernel-source-XXXX for Slackware
dkms-etercifs for ROSA / Mandriva
where XXXX is your current
version from \
$
uname -r:
$(
uname
-r
)
or
use KERNELVERSION variable to set correct version (for
/lib/modules/KERNELVERSION/build)
or set KERN
SRC and KERNELVERSION variables to set correct kernel headers location
where XXXX is your current
kernel version from \
$
uname -r (
$(
uname
-r
)
)
or
set KERNSRC to set correct kernel headers location (
/lib/modules/KERNELVERSION/build)
or set KERN
ELVERSION variable to set correct version (for /lib/modules/KERNELVERSION/build)
Exiting...
EOF
# FIXME: check detect
...
...
@@ -389,7 +390,7 @@ compile_module()
[
"
$RPM_BUILD_NCPUS
"
-gt
1
]
&&
MAKESMP
=
"-j
$RPM_BUILD_NCPUS
"
||
MAKESMP
=
""
echo
"Checking the kernel configuration..."
if
[
-r
"
$KERNSRC
"
]
;
then
if
[
-r
"
$KERNSRC
/.config
"
]
;
then
CONF_STRING
=
`
cat
$KERNSRC
/.config |
grep
CONFIG_CIFS
=
`
CONF_LETTER
=
`
echo
$CONF_STRING
|
cut
-b
13-13
`
case
"
$CONF_LETTER
"
in
...
...
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