mdev calls script with ACTION=add when "remove" is echoed to a uevent file.

Sameer Naik sameer.subscriptions at damagehead.com
Tue Aug 2 19:08:30 UTC 2011


Hello,

I am using mdev from busybox-1.18.5 to populate devices at boot time
as well as to handle hotplugging of various usb devices such as usb
disk drives.

In my filesystem, at boot after mdev is started, a coldplug script is
executed that will echo "add" to uevent files of various devices that
i want to make sure are mounted (in case of disk drives).

I want to write a script that will unmount all usb disk drive
paritions. To achieve this i decided that, if i echo "remove" to the
uevent files of the devices, mdev will call the hotplug script with
ACTION="remove" and the device will get unmounted. But this is not
happening and instead the hotplug script is being called with
ACTION="add".

There are other ways in which i can write a shell script to umount all
mount usb disk partitions, but the approach i decided to take seems to
be the most simple and would reuse code from the hotplug script.

I would like to know if this behaviour is normal or something is going
wrong. I am using linux kernel version  2.6.22.
Looking forward to your replies.

Thanks and Regards
~Sameer


More information about the busybox mailing list