From 709c4d66e0b107ca606941b988bad717c0b45d9b Mon Sep 17 00:00:00 2001 From: Denys Dmytriyenko Date: Tue, 17 Mar 2009 14:32:59 -0400 Subject: rename packages/ to recipes/ per earlier agreement See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko Acked-by: Mike Westerhof Acked-by: Philip Balister Acked-by: Khem Raj Acked-by: Marcin Juszkiewicz Acked-by: Koen Kooi Acked-by: Frans Meulenbroeks --- recipes/pvrusb2-mci/files/firmware.hotplug | 61 ++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100755 recipes/pvrusb2-mci/files/firmware.hotplug (limited to 'recipes/pvrusb2-mci/files/firmware.hotplug') diff --git a/recipes/pvrusb2-mci/files/firmware.hotplug b/recipes/pvrusb2-mci/files/firmware.hotplug new file mode 100755 index 0000000000..40673a7b74 --- /dev/null +++ b/recipes/pvrusb2-mci/files/firmware.hotplug @@ -0,0 +1,61 @@ +#!/bin/sh +# +# Firmware-specific hotplug policy agent. +# +# Kernel firmware hotplug params include: +# +# ACTION=%s [add or remove] +# DEVPATH=%s [in 2.5 kernels, /sys/$DEVPATH] +# FIRMWARE=%s +# +# HISTORY: +# +# 24-Jul-2003 Initial version of "new" hotplug agent. +# +# $Id: firmware.agent,v 1.3 2004/03/14 15:52:56 ukai Exp $ +# + +cd /etc/hotplug.d/firmware +. ./hotplug.functions +# DEBUG=yes export DEBUG + +# directory of the firmware files +FIRMWARE_DIR=/lib/firmware + +# mountpoint of sysfs +SYSFS=$(sed -n 's/^.* \([^ ]*\) sysfs .*$/\1/p' /proc/mounts) + +# use /proc for 2.4 kernels +if [ "$SYSFS" = "" ]; then + SYSFS=/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 -- cgit v1.2.3