mdev and module loading

Natanael Copa natanael.copa at gmail.com
Tue May 13 07:28:24 PDT 2008


On Tue, 2008-05-13 at 10:17 -0400, Joseph F Garvey wrote:
> I use mdev in a bootable image, but was disappointed that it did so
> little.
> 
> Udev not only creates entries in /dev but it also loads the drivers.
> 
> A look at the existing code shows that mdev simply runs thru
> /sys/{class,block} and looks for 'dev' files, then creates the needed
> devices in /dev. [ Wouldn't a script do this just as easily, space
> efficiently? ]
> 
> In addition it's still necessary to run thru /sys/devices in a boot
> script
> to load 'hidden' devices, like network devices, since mdev doesn't
> look
> at /sys/devices (instead of 'dev' files, 'device' files are sought).
> 
> It seems to me (actually I've already done it on an older version of
> mdev.c) mdev would be a great replacement of udev if the functionality
> to
> load/unload any device drivers were added, along with adding support
> for
> running through /sys/devices when the -s option is used (haven't got
> this,
> yet). This ability could be further enhanced by by passing the
> environment
> variable MALIAS (module alias) to go with MDEV for any user commands
> that
> are to be run from the mdev config file (also have the patch for
> this).
>
> I don't understand why this wasn't initially done. Does anyone know?
>  Should
> I complete my patch for the most recent version of mdev and submit it?
> I really
> don't want to waste my time if the content of the patch would be
> objectionable. It
> wouldn't be that big a change to what's already there in mdev.c.
> 

I use a script that does this during boot:

	find /sys -name modalias | while read a ; do
		modprobe `cat $a` 2>/dev/null || \
			echo $a >> /tmp/hwdrivers.failed
	done


-nc



More information about the busybox mailing list