blob: 8143a950b60789ce0b0ae9aab24c8a3d5da5b3d9 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#!/bin/sh
2
3# Simple hotplug script sample:
4#
5# Both $DEVPATH and $FIRMWARE are already provided in the environment.
6
7HOTPLUG_FW_DIR=/usr/lib/hotplug/firmware/
8
Magnus Damm3317fad2010-06-25 17:55:11 +09009if [ "$SUBSYSTEM" == "firmware" -a "$ACTION" == "add" ]; then
10 if [ -f $HOTPLUG_FW_DIR/$FIRMWARE ]; then
11 echo 1 > /sys/$DEVPATH/loading
12 cat $HOTPLUG_FW_DIR/$FIRMWARE > /sys/$DEVPATH/data
13 echo 0 > /sys/$DEVPATH/loading
14 else
15 echo -1 > /sys/$DEVPATH/loading
16 fi
17fi