1 #!/bin/sh 1 #!/bin/sh 2 2 3 # Simple hotplug script sample: 3 # Simple hotplug script sample: 4 # 4 # 5 # Both $DEVPATH and $FIRMWARE are already prov 5 # Both $DEVPATH and $FIRMWARE are already provided in the environment. 6 6 7 HOTPLUG_FW_DIR=/usr/lib/hotplug/firmware/ 7 HOTPLUG_FW_DIR=/usr/lib/hotplug/firmware/ 8 8 9 if [ "$SUBSYSTEM" == "firmware" -a "$ACTION" = !! 9 echo 1 > /sysfs/$DEVPATH/loading 10 if [ -f $HOTPLUG_FW_DIR/$FIRMWARE ]; then !! 10 cat $HOTPLUG_FW_DIR/$FIRMWARE > /sysfs/$DEVPATH/data 11 echo 1 > /sys/$DEVPATH/loading !! 11 echo 0 > /sysfs/$DEVPATH/loading 12 cat $HOTPLUG_FW_DIR/$FIRMWARE > /sys/$DEVP !! 12 13 echo 0 > /sys/$DEVPATH/loading !! 13 # To cancel the load in case of error: 14 else !! 14 # 15 echo -1 > /sys/$DEVPATH/loading !! 15 # echo -1 > /sysfs/$DEVPATH/loading 16 fi !! 16 # 17 fi <<
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.