About Kernel Documentation Linux Kernel Contact Linux Resources Linux Blog

Documentation / firmware_class / hotplug-script




Custom Search

Based on kernel version 3.16. Page generated on 2014-08-06 21:39 EST.

1	#!/bin/sh
2	
3	# Simple hotplug script sample:
4	# 
5	# Both $DEVPATH and $FIRMWARE are already provided in the environment.
6	
7	HOTPLUG_FW_DIR=/usr/lib/hotplug/firmware/
8	
9	if [ "$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
17	fi
Hide Line Numbers
About Kernel Documentation Linux Kernel Contact Linux Resources Linux Blog

Information is copyright its respective author. All material is available from the Linux Kernel Source distributed under a GPL License. This page is provided as a free service by mjmwired.net.