On Tue, Jun 15, 2010 at 19:46, Maxim Levitsky <maximlevitsky@xxxxxxxxx> wrote: > On Tue, 2010-06-15 at 09:05 -0700, Greg KH wrote: >> On Tue, Jun 15, 2010 at 06:45:48PM +0300, Maxim Levitsky wrote: >> > Can udev helper tell udev to load modules by setting some variable? >> >> Not really, except for the modalias stuff. Use that if you can. >> >> But I think you've pointed out the real solution already. You need to >> look at the signature on the device and then know what to load, just >> like we do for filesystems. > It seems to work just fine. > mtdchar I see it loaded automatically anyway due to char device alias. What triggers char device aliases? You mean a static /dev with device nodes without a current kernel device? > So this rules does the trick: > > ACTION!="add", GOTO="mtd_probe_end" > KERNEL=="mtd*ro", IMPORT{program}="mtd_probe --export $tempnode" > LABEL="mtd_probe_end" > > And all I have to do is to write the mtd_probe > > My current stub mtd-probe is: > > #!/bin/sh > # $1 = device node > echo "MODALIAS=sm_ftl" Modaliases are not supposed to be defined by imported variables. They are specified by the kernel, and should also be visible in sysfs, if they are used. Also modaliases have prefixes like: <subsystem>:<some id>, and should never be plain module names, to allow module-init-tools to overwrite things in a sane way. You might want to add MODULE_ALIAS("mtd:sm_ftl") to the module itself, or whatever fits. What will the module do when it's loaded? Scan all mtd devices and check if there is something it should bind to? Kay -- To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html