[Bug 591] New: modprobe-small: incorrect alias detection
bugzilla at busybox.net
bugzilla at busybox.net
Thu Sep 3 14:25:13 UTC 2009
https://bugs.busybox.net/show_bug.cgi?id=591
Summary: modprobe-small: incorrect alias detection
Product: Busybox
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P3
Component: Other
AssignedTo: unassigned at busybox.net
ReportedBy: jirij.jabb at gmail.com
CC: busybox-cvs at busybox.net
Estimated Hours: 0.0
Simplified modprobe tries to detect aliases from module "bodies". While this
works fine under the most obvious cases, it doesn't work on all module aliases
for a specific reason.
I've turned on the debugging macros in modprobe-small.c and tried to load up an
atiixp.ko module by it's alias:
/ # grep 'alias=' /lib/modules/2.6.26-2-686/kernel/drivers/ide/pci/atiixp.ko
alias=pci:v00001002d0000439Csv*sd*bc*sc*i*
alias=pci:v00001002d0000438Csv*sd*bc*sc*i*
alias=pci:v00001002d00004376sv*sd*bc*sc*i*
alias=pci:v00001002d00004369sv*sd*bc*sc*i*
alias=pci:v00001002d00004349sv*sd*bc*sc*i*
/ # modprobe pci:v00001002d0000439Csv*sd*bc*sc*i*
modprobe: loading modules.dep.bb
modprobe: process_module('pci:v00001002d0000439Csv*sd*bc*sc*i*','(null)')
modprobe: already_loaded:0 is_rmmod:0
modprobe: process_module('pci:v00001002d0000439Csv*sd*bc*sc*i*'):
options:'(null)'
modprobe: find_alias('pci:v00001002d0000439Csv*sd*bc*sc*i*')
modprobe: found alias 'pci:v00001002d0000439Csv*sd*bc*sc*i*' in module
'kernel/drivers/ide/pci/atiixp.ko'
modprobe: recurse on dep 'ide_core'
modprobe: process_module('ide_core','(null)')
modprobe: already_loaded:1 is_rmmod:0
modprobe: nothing to do for 'ide_core'
modprobe: recurse on dep 'ide_core' done
modprobe: load_module('kernel/drivers/ide/pci/atiixp.ko','(null)')
modprobe: load_module:0
.. which worked.
When I, however, try to load ide-disk, m-disk or any similar module alias, it
fails:
/ # grep 'alias=' /lib/modules/2.6.26-2-686/kernel/drivers/ide/ide-tape.ko
alias=char-major-37-*
alias=ide:*m-tape*
/ # modprobe ide:m-tape
modprobe: loading modules.dep.bb
modprobe: process_module('ide:m-tape','(null)')
modprobe: already_loaded:0 is_rmmod:0
modprobe: process_module('ide:m_tape'): options:'(null)'
modprobe: find_alias('ide:m_tape')
modprobe: find_alias 'ide:m_tape' returns (nil)
modprobe: module 'ide:m_tape' not found
The problem is in the module name processing, which is done before an actual
alias check. Ie. replace(name, '-', '_') is called before the alias detection
code. Commenting the replace call made this particular case work:
/ # modprobe ide:m-tape
modprobe: loading modules.dep.bb
modprobe: process_module('ide:m-tape','(null)')
modprobe: already_loaded:0 is_rmmod:0
modprobe: process_module('ide:m-tape'): options:'(null)'
modprobe: find_alias('ide:m-tape')
modprobe: found alias 'ide:m-tape' in module 'kernel/drivers/ide/ide-tape.ko'
modprobe: recurse on dep 'ide_core'
modprobe: process_module('ide_core','(null)')
modprobe: already_loaded:1 is_rmmod:0
modprobe: nothing to do for 'ide_core'
modprobe: recurse on dep 'ide_core' done
modprobe: load_module('kernel/drivers/ide/ide-tape.ko','(null)')
modprobe: load_module:0
The correct solution, however, would be to move the replace function call or
somewhat (and more likely) restructuralize the code itself.
Tested on 44f174e (2009-08-31) with CONFIG_MODPROBE_SMALL enabled.
Thanks.
--
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the busybox-cvs
mailing list