diff options
author | Simon Rettberg | 2019-04-11 11:39:38 +0200 |
---|---|---|
committer | root | 2019-04-11 11:39:38 +0200 |
commit | 0f0eeb46389a976d4150ff6027c28cbc4da7d784 (patch) | |
tree | 1375f5085e397a276a29cbdef14cc196ade18b1d /core/rootfs/rootfs-stage31/data/sbin | |
parent | [slx-issue] Make issue generator even smarter (diff) | |
download | mltk-0f0eeb46389a976d4150ff6027c28cbc4da7d784.tar.gz mltk-0f0eeb46389a976d4150ff6027c28cbc4da7d784.tar.xz mltk-0f0eeb46389a976d4150ff6027c28cbc4da7d784.zip |
[rfs-stage31] Add hotplug handler for loading kernel modules
This will only handle PCI devices for now, everything else should not
be required for stage31.
Diffstat (limited to 'core/rootfs/rootfs-stage31/data/sbin')
-rwxr-xr-x | core/rootfs/rootfs-stage31/data/sbin/hotplug | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core/rootfs/rootfs-stage31/data/sbin/hotplug b/core/rootfs/rootfs-stage31/data/sbin/hotplug new file mode 100755 index 00000000..f2bda19b --- /dev/null +++ b/core/rootfs/rootfs-stage31/data/sbin/hotplug @@ -0,0 +1,15 @@ +#!/bin/ash + +[ "$ACTION" != "add" ] && exit 0 + +[ -z "$MODALIAS" ] && exit 0 + +[ "${MODALIAS:0:5}" != "pci:v" ] && exit 0 # Ignore everything but PCI devices + +ID="${MODALIAS:9:4}:${MODALIAS:18:4}" + +LINE="$( lspci -n | grep -oEi "[0-9]{4}: $ID" | cut -c1-2 )" +[ "$LINE" = "03" ] && exit 0 # Skip GFX, handled by other module + +modprobe "$MODALIAS" + |