On Mon, 28 Dec 2009 15:17:49 +0100 Frans Pop <elendil@planet.nl> wrote: > I think the patch needs an added test that modalias exists, something > like: elif [ -e $devpath/modalias ]; then > > And that long line could do with a split to the next line after the > pipe. The "|| true" is probably not needed as the sed statement will > absorb any errors from modprobe, but maybe there should be a redirect > of errors: module=$(modprobe --show-depends "$modalias" 2>/dev/null | > \ sed -n -e '$s#^.*/\([^.]*\)\.ko.*$#\1#p') Feel free to modify as you wish; that was done during a lunch break at $PAID_WORK. :) > A comment that the module supporting the device is the last line > returned by modprobe would be useful. It's not quite self-evident. True. This is related to the way "--show-depends" works in modprobe : it simply ignores every modules already loaded and display like in verbose mode every commands that would be run. Resolving the dependency chain, the last module will always be the one asked on the command-line. Cheers, -- Jérémy Bobbio - Administrateur système et réseau Mezcalito - http://www.mezcalito.fr 17 boulevard Agutte Sembat - 38000 Grenoble 04 76 01 03 91
Attachment:
signature.asc
Description: PGP signature