mdev not called

Tobias Knutsson tobias.knutsson at gmail.com
Thu Jun 25 10:10:14 UTC 2009


Hello,

I'm trying to get mdev to work dynamically but am failing miserably.
Invoking mdev -s at boottime to create device nodes works like a charm
but if i for example do:

echo remove > /sys/devices/virtual/mem/urandom/uevent

mdev will not remove the device. I know that the uevents are sent
because i can replace mdev in /proc/sys/kernel/hotplug with a script:

#!/bin/sh

echo uevent > /dev/console
echo $ACTION > /dev/console
echo $DEVPATH > /dev/console

This script will be run and the environment variables are set as
expected. I initialize mdev in an rcscript on the following form:

#!/bin/sh
#
# Dynamic /dev filesystem using mdev
#

case "$1" in
  start)
 	/bin/echo -n "mdev: Populating dynamic /dev..."
	/bin/mount -t tmpfs mdev /dev
	/bin/mkdir /dev/pts
	/bin/mount -t devpts devpts /dev/pts
	/bin/echo /sbin/mdev > /proc/sys/kernel/hotplug
	/sbin/mdev -s
	/bin/echo "done"
	;;
  stop)
	echo -n "mdev: Removing dynamic /dev entries..."
	/bin/umount /dev/pts
	/bin/rm -rf /dev/pts
	/bin/umount /dev
	echo "done"
	;;
  restart|reload)
	"$0" stop
	"$0" start
	;;
  *)
	echo $"Usage: $0 {start|stop|restart}"
	exit 1
esac

exit $?

What am i missing? Has anybody run into this problem before?

-- 

Hälsningar/Regards
Tobias Knutsson


More information about the busybox mailing list