summaryrefslogtreecommitdiffstats
path: root/core/rootfs/rootfs-stage31/data/sbin
diff options
context:
space:
mode:
authorSimon Rettberg2019-04-16 15:05:50 +0200
committerSimon Rettberg2019-04-16 15:05:50 +0200
commitca45bda5bb9d7d3e82b4868b84c923493b61834d (patch)
tree4454b5b7de1f64915a6f55ef5a0b40e9b02eb030 /core/rootfs/rootfs-stage31/data/sbin
parent[etherwake] add missing templates (diff)
downloadmltk-ca45bda5bb9d7d3e82b4868b84c923493b61834d.tar.gz
mltk-ca45bda5bb9d7d3e82b4868b84c923493b61834d.tar.xz
mltk-ca45bda5bb9d7d3e82b4868b84c923493b61834d.zip
[rootfs-stage31] Scan pci device tree recursivelyv23
Diffstat (limited to 'core/rootfs/rootfs-stage31/data/sbin')
-rwxr-xr-xcore/rootfs/rootfs-stage31/data/sbin/hotplug13
1 files changed, 8 insertions, 5 deletions
diff --git a/core/rootfs/rootfs-stage31/data/sbin/hotplug b/core/rootfs/rootfs-stage31/data/sbin/hotplug
index 260b7782..65ae4d9d 100755
--- a/core/rootfs/rootfs-stage31/data/sbin/hotplug
+++ b/core/rootfs/rootfs-stage31/data/sbin/hotplug
@@ -1,6 +1,11 @@
#!/bin/ash
-if [ -n "$FIRMWARE" ] && [ "$SUBSYSTEM" = "firmware" ] && [ -n "$DEVPATH" ] && [ -e "/sys/$DEVPATH/data" ]; then
+if [ "$1" = "--file" ]; then
+ # Read from modalias file
+ ACTION="add"
+ MODALIAS="$( cat "$2" )"
+elif [ -n "$FIRMWARE" ] && [ "$SUBSYSTEM" = "firmware" ] && [ -n "$DEVPATH" ] && [ -e "/sys/$DEVPATH/data" ]; then
+ # Firmware loader (should not be needed since direct firmware loading capability of kernel exists nowadays)
echo "Kernel requests firmware $FIRMWARE" > "/dev/kmsg"
printf "1" > "/sys/$DEVPATH/loading"
if cat "/lib/firmware/$FIRMWARE" > "/sys/$DEVPATH/data" \
@@ -11,11 +16,9 @@ if [ -n "$FIRMWARE" ] && [ "$SUBSYSTEM" = "firmware" ] && [ -n "$DEVPATH" ] && [
fi
fi
-[ "$ACTION" != "add" ] && exit 0
+[ "$ACTION" = "add" ] || exit 0
-[ -z "$MODALIAS" ] && exit 0
-
-[ "${MODALIAS:0:5}" != "pci:v" ] && exit 0 # Ignore everything but PCI devices
+[ "${MODALIAS:0:5}" = "pci:v" ] || exit 0 # Ignore everything but PCI devices
ID="${MODALIAS:9:4}:${MODALIAS:18:4}"