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
698b4622
Commit
698b4622
authored
Mar 15, 2010
by
Pavel Shilovsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix rmmod after umount problem
parent
9a1cf2b4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
14 deletions
+55
-14
etercifs
etercifs/etercifs
+41
-6
functions.sh
etercifs/functions.sh
+14
-8
No files found.
etercifs/etercifs
View file @
698b4622
...
...
@@ -20,18 +20,20 @@ MODINFO=/sbin/modinfo
# against run with sudo
export
PATH
=
$PATH
:/sbin:/usr/sbin
.
@DATADIR@/functions.sh
PACKAGEINFO
=
@DATADIR@/package.conf
if
[
-f
"
$PACKAGEINFO
"
]
;
then
.
$PACKAGEINFO
.
$PACKAGEINFO
else
fatal
"Not found package information file
$PACKAGEINFO
"
fatal
"Not found package information file
$PACKAGEINFO
"
fi
CONFIGFILE
=
@SYSCONFIGDIR@/etercifs.conf
if
[
-f
$CONFIGFILE
]
;
then
.
$CONFIGFILE
.
$CONFIGFILE
else
fatal
"Not found configuration file
$CONFIGFILE
"
fatal
"Not found configuration file
$CONFIGFILE
"
fi
[
-n
"
$BUILT
"
]
||
BUILT
=
0
...
...
@@ -124,6 +126,24 @@ is_origmoduled()
lsmod |
grep
"^
$ORIGMODULENAME
"
>
/dev/null
}
check_for_old_kernel
()
{
detect_host_kernel
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
`
if
[
"
$N1
"
-eq
2
]
&&
[
"
$N2
"
-eq
6
]
;
then
if
[
"
$N3
"
-ge
29
]
;
then
return
0
fi
fi
check_for_centos
>
/dev/null
if
[
-n
"
$SPECIFIC_CENTOS
"
]
&&
[
"
$CENTOS
"
-ge
54
]
;
then
return
0
fi
return
1
}
umount_cifs
()
{
WASCIFS
=
...
...
@@ -142,6 +162,7 @@ umount_cifs()
done
success
fi
return
0
}
mount_cifs
()
...
...
@@ -156,8 +177,15 @@ load_module()
local
i
if
is_origmoduled
;
then
umount_cifs
if
[
"
$?
"
-eq
1
]
;
then
return
fi
check_for_old_kernel
if
[
"
$?
"
-eq
1
]
;
then
sleep
2s
fi
echo
-n
"Removing vanilla kernel module
$ORIGMODULENAME
... "
$RMMOD
$ORIGMODULENAME
||
{
failure
;
return
;
}
$RMMOD
$ORIGMODULENAME
--wait
success
fi
...
...
@@ -194,9 +222,16 @@ start()
stop
()
{
umount_cifs
if
[
"
$?
"
-eq
1
]
;
then
return
fi
check_for_old_kernel
if
[
"
$?
"
-eq
1
]
;
then
sleep
2s
fi
echo
-n
"Unloading kernel module
$MODULENAME
... "
is_moduled
||
{
passed
;
return
;
}
$RMMOD
$MODULENAME
||
{
failure
;
echo
"You have to umount all CIFS resources before module unloading."
;
return
;
}
$RMMOD
$MODULENAME
--wait
success
}
...
...
etercifs/functions.sh
View file @
698b4622
...
...
@@ -38,13 +38,8 @@ exit_handler()
exit
$rc
}
detect_etercifs_source
s
()
check_for_cento
s
()
{
[
-n
"
$ETERCIFS_SOURCES_LIST
"
]
||
ETERCIFS_SOURCES_LIST
=
$DATADIR
/sources/kernel-source-etercifs
*
[
-n
"
`
ls
$ETERCIFS_SOURCES_LIST
`
"
]
||
fatal
"Etercifs kernel module sources does not installed!"
KERNEL_SOURCE_ETERCIFS_LINK
=
`
ls
-1
$ETERCIFS_SOURCES_LIST
|
grep
$KERNEL
|
sort
-r
|
head
-n
1
`
# CentOS-RHEL specific part
SPECIFIC_CENTOS
=
if
[
-r
"/etc/redhat-release"
]
;
then
grep
'CentOS'
/etc/redhat-release
>
/dev/null
&&
SPECIFIC_CENTOS
=
1
...
...
@@ -61,7 +56,7 @@ detect_etercifs_sources()
N4
=
`
echo
$KERNEL4
|
cut
-d
"-"
-f
2 |
cut
-d
"."
-f
1
`
CENTOS
=
0
if
[
"
$N1
"
-eq
'2'
]
&&
[
"
$N2
"
-eq
'6'
]
;
then
if
[
"
$N1
"
-eq
2
]
&&
[
"
$N2
"
-eq
6
]
;
then
if
[
"
$N3
"
-eq
18
]
;
then
if
[
"
$N4
"
-eq
164
]
;
then
echo
"You kernel is 2.6.18-164.x"
...
...
@@ -94,6 +89,18 @@ detect_etercifs_sources()
else
echo
"Warning! Your kernel in not 2.6.x"
fi
fi
}
detect_etercifs_sources
()
{
[
-n
"
$ETERCIFS_SOURCES_LIST
"
]
||
ETERCIFS_SOURCES_LIST
=
$DATADIR
/sources/kernel-source-etercifs
*
[
-n
"
`
ls
$ETERCIFS_SOURCES_LIST
`
"
]
||
fatal
"Etercifs kernel module sources does not installed!"
KERNEL_SOURCE_ETERCIFS_LINK
=
`
ls
-1
$ETERCIFS_SOURCES_LIST
|
grep
$KERNEL
|
sort
-r
|
head
-n
1
`
# CentOS-RHEL specific part
check_for_centos
if
[
-n
"
$SPECIFIC_CENTOS
"
]
;
then
if
[
"
$CENTOS
"
-eq
54
]
;
then
echo
"Building from legacy sources with patch for kernels 2.6.18-164.x from CentOS 5.4."
KERNEL_SOURCE_ETERCIFS_LINK
=
`
ls
-1
$ETERCIFS_SOURCES_LIST
|
grep
'centos54'
|
sort
-r
|
head
-n
1
`
...
...
@@ -106,7 +113,6 @@ detect_etercifs_sources()
else
echo
"Building from legacy sources."
fi
echo
fi
# end of CentOS-RHEL specific part
...
...
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