File: firmware.agent

package info (click to toggle)
udev 0.105-4etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 672 kB
  • ctags: 54
  • sloc: sh: 1,636; makefile: 273
file content (27 lines) | stat: -rw-r--r-- 496 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh -e
#
# firmware loader agent
#

cd /lib/udev/
. ./hotplug.functions

if [ ! -e /sys/$DEVPATH/loading ]; then
    mesg "/sys/$DEVPATH/ does not exist"
    exit 1
fi

for DIR in $FIRMWARE_DIRS; do
    [ -e "$DIR/$FIRMWARE" ] || continue
    echo 1 > /sys/$DEVPATH/loading
    cat "$DIR/$FIRMWARE" > /sys/$DEVPATH/data
    echo 0 > /sys/$DEVPATH/loading
    exit 0
done

# the firmware was not found
echo -1 > /sys/$DEVPATH/loading

debug_mesg "Cannot find the $FIRMWARE firmware"
exit 1