3
# This is ported from Ubuntu but ubuntu uses these directories which
4
# other distributions don't care about:
5
# FIRMWARE_DIRS="/lib/firmware/updates/$(uname -r) /lib/firmware/updates \
6
# /lib/firmware/$(uname -r) /lib/firmware"
7
# If your distribution looks for firmware in other directories
8
# feel free to extend this and add your own directory here.
10
FIRMWARE_DIRS="/lib/firmware"
14
logger -t "${0##*/}[$$]" "$@" 2>/dev/null || true
17
if [ ! -e /sys$DEVPATH/loading ]; then
18
err "udev firmware loader misses sysfs directory"
22
for DIR in $FIRMWARE_DIRS; do
23
[ -e "$DIR/$FIRMWARE" ] || continue
24
echo 1 > /sys$DEVPATH/loading
25
cat "$DIR/$FIRMWARE" > /sys$DEVPATH/data
26
echo 0 > /sys$DEVPATH/loading
30
echo -1 > /sys$DEVPATH/loading
31
err "Cannot find firmware file '$FIRMWARE'"
32
mkdir -p /dev/.udev/firmware-missing
33
file=$(echo "$FIRMWARE" | sed 's:/:\\x2f:g')
34
ln -s -f "$DEVPATH" /dev/.udev/firmware-missing/$file