From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcel Holtmann Date: Sat, 26 Jul 2003 16:24:15 +0000 Subject: Hotplug script firmware.agent MIME-Version: 1 Content-Type: multipart/mixed; boundary="=-adCqPb+qaLm6Nd4e/84Q" Message-Id: List-Id: To: linux-hotplug@vger.kernel.org --=-adCqPb+qaLm6Nd4e/84Q Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi Folks, here is my firmware.agent script and it would be nice, if you include it into the next release of the hotplug scripts. Regards Marcel --=-adCqPb+qaLm6Nd4e/84Q Content-Disposition: attachment; filename=firmware.agent Content-Transfer-Encoding: quoted-printable Content-Type: text/x-sh; name=firmware.agent; charset=ISO-8859-15 #!/bin/sh # # Firmware-specific hotplug policy agent. # # Kernel firmware hotplug params include: # # ACTION=3D%s [add or remove] # DEVPATH=3D%s [in 2.5 kernels, /sys/$DEVPATH] # FIRMWARE=3D%s # # HISTORY: # # 24-Jul-2003 Initial version of "new" hotplug agent. # # $Id: firmware.agent,v 1.10 2003/07/24 19:32:23 holtmann Exp $ # cd /etc/hotplug . hotplug.functions # DEBUG=3Dyes export DEBUG # directory of the firmware files FIRMWARE_DIR=3D/usr/lib/hotplug/firmware # mountpoint of sysfs SYSFS=3D$(sed -n 's/^.* \([^ ]*\) sysfs .*$/\1/p' /proc/mounts) # use /proc for 2.4 kernels if [ "$SYSFS" =3D "" ]; then SYSFS=3D/proc fi # # What to do with this firmware hotplug event? # case "$ACTION" in add) if [ ! -e $SYSFS/$DEVPATH/loading ]; then sleep 1 fi if [ -f $FIRMWARE_DIR/$FIRMWARE ]; then echo 1 > $SYSFS/$DEVPATH/loading cp $FIRMWARE_DIR/$FIRMWARE $SYSFS/$DEVPATH/data echo 0 > $SYSFS/$DEVPATH/loading else echo -1 > $SYSFS/$DEVPATH/loading fi ;; remove) ;; *) mesg "Firmware '$ACTION' event not supported" exit 1 ;; esac --=-adCqPb+qaLm6Nd4e/84Q-- ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel