mirror of
https://github.com/linuxboot/heads.git
synced 2024-12-18 20:47:55 +00:00
insmod: uniformize module name and lsmod output prior of comapring if module already insmodded (ehci-hcd.ko module name is ehci_hcd...)
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
This commit is contained in:
parent
5f8cb5a159
commit
a5ab32b761
@ -23,11 +23,12 @@ if [ ! -r "$MODULE" ]; then
|
||||
die "$MODULE: not found?"
|
||||
fi
|
||||
|
||||
# Check if module is already loaded while remove trailing .ko if present
|
||||
module=$(basename "$MODULE")
|
||||
module=${module%.ko}
|
||||
if lsmod | grep -q "^$module\\b"; then
|
||||
DEBUG "$module: already loaded"
|
||||
# Check if module is already loaded
|
||||
# Transform module name changing _ for - and trailing .ko if present
|
||||
# Unify lsmod output to use - instead of _ for comparison
|
||||
module_name=$(basename "$MODULE" | sed 's/_/-/g' | sed 's/\.ko$//')
|
||||
if lsmod | sed 's/_/-/g' | grep -q "^$module_name\\b"; then
|
||||
DEBUG "$MODULE: already loaded"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user