mirror of
git://git.openwrt.org/openwrt/openwrt.git
synced 2024-12-11 09:24:50 +00:00
cf8483cb4f
Linux kernel has a polling mechanism that can be activated by changing the parameter /sys/module/block/parameters/events_dfl_poll_msecs which is deactivated by default or the /sys/block/[device]/events_poll_msecs for one device. This patch set the events_poll_msecs when a disk is inserted. Once the media disk change event is sent by the kernel then we force a re-read of the devices using /sbin/block info. With this patch, insertion and ejection of sd card will automatically generate partition devices in /dev. Signed-off-by: Matthias Badaire <mbadaire@gmail.com> [rewrap commit message, fix bashisms, fix non-matching condition, bump pkg release] Signed-off-by: Jo-Philipp Wich <jo@mein.io>
9 lines
203 B
Plaintext
9 lines
203 B
Plaintext
[ -n "$DISK_MEDIA_CHANGE" ] && /sbin/block info
|
|
|
|
if [ "$ACTION" = "add" -a "$DEVTYPE" = "disk" ]; then
|
|
case "$DEVNAME" in
|
|
mtd*) : ;;
|
|
*) echo 2000 > /sys/block/$DEVNAME/events_poll_msecs ;;
|
|
esac
|
|
fi
|