/lib/udev/firmware.agent is in udev 175-7.2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 28 29 30 31 32 33 34 35 36 | #!/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
FIRMWARE_DIRS="/lib/firmware/$(uname -r) /lib/firmware /usr/local/lib/firmware /usr/lib/hotplug/firmware"
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
RUNDIR=$(udevadm info --run)
if [ -d "$RUNDIR" ]; then
mkdir -p "$RUNDIR/firmware-missing/"
file=$(echo "$FIRMWARE" | sed -e 's#/#\\x2f#g')
ln -s -f "$DEVPATH" "$RUNDIR/firmware-missing/$file"
fi
debug_mesg "Cannot find the $FIRMWARE firmware"
exit 1
|