$(MAKE) -C $(KLIB_BUILD) M=$(PWD) $(KMODDIR_ARG) $(KMODPATH_ARG) \
modules_install
depmod -a
+ @./scripts/compat_firmware_install
clean:
$(MAKE) -C $(KLIB_BUILD) M=$(PWD) clean
all: modules
--- /dev/null
+#!/bin/sh
+
+if [ -f /usr/bin/lsb_release ]; then
+ LSB_RED_ID=$(/usr/bin/lsb_release -i -s)
+else
+ LSB_RED_ID="Unknown"
+fi
+
+case $LSB_RED_ID in
+"Ubuntu")
+ cp udev/ubuntu/compat_firmware.sh /lib/udev/
+ cp udev/ubuntu/50-compat_firmware.rules /lib/udev/rules.d/
+ ;;
+*)
+ cp udev/compat_firmware.sh /lib/udev/
+ cp udev/50-compat_firmware.rules /lib/udev/rules.d/
+ ;;
+esac
+
--- /dev/null
+# do not edit this file, it will be overwritten on update
+
+# compat_firmware-class requests, copies files into the kernel
+SUBSYSTEM=="compat_firmware", ACTION=="add", RUN+="compat_firmware.sh"
--- /dev/null
+#!/bin/sh -e
+
+# This is ported from Ubuntu but ubuntu uses these directories which
+# other distributions don't care about:
+# FIRMWARE_DIRS="/lib/firmware/updates/$(uname -r) /lib/firmware/updates \
+# /lib/firmware/$(uname -r) /lib/firmware"
+# If your distribution looks for firmware in other directories
+# feel free to extend this and add your own directory here.
+#
+FIRMWARE_DIRS="/lib/firmware"
+
+err() {
+ echo "$@" >&2
+ logger -t "${0##*/}[$$]" "$@" 2>/dev/null || true
+}
+
+if [ ! -e /sys$DEVPATH/loading ]; then
+ err "udev firmware loader misses sysfs directory"
+ 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
+
+echo -1 > /sys$DEVPATH/loading
+err "Cannot find firmware file '$FIRMWARE'"
+mkdir -p /dev/.udev/firmware-missing
+file=$(echo "$FIRMWARE" | sed 's:/:\\x2f:g')
+ln -s -f "$DEVPATH" /dev/.udev/firmware-missing/$file
+exit 1
--- /dev/null
+# do not edit this file, it will be overwritten on update
+
+# compat_firmware-class requests, copies files into the kernel
+SUBSYSTEM=="compat_firmware", ACTION=="add", RUN+="compat_firmware.sh"
--- /dev/null
+#!/bin/sh -e
+
+FIRMWARE_DIRS="/lib/firmware/updates/$(uname -r) /lib/firmware/updates \
+ /lib/firmware/$(uname -r) /lib/firmware"
+
+err() {
+ echo "$@" >&2
+ logger -t "${0##*/}[$$]" "$@" 2>/dev/null || true
+}
+
+if [ ! -e /sys$DEVPATH/loading ]; then
+ err "udev firmware loader misses sysfs directory"
+ 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
+
+echo -1 > /sys$DEVPATH/loading
+err "Cannot find firmware file '$FIRMWARE'"
+mkdir -p /dev/.udev/firmware-missing
+file=$(echo "$FIRMWARE" | sed 's:/:\\x2f:g')
+ln -s -f "$DEVPATH" /dev/.udev/firmware-missing/$file
+exit 1