Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added automatic driver loading #469

Merged
merged 3 commits into from Jul 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions scripts/etc/init.d/rcS
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,12 @@ echo

# depmod needs to update modules.dep before using modprobe
depmod -a

# coldplug modules
echo "Loading drivers."
find /sys/ -name modalias -print0 | xargs -0 sort -u -z | xargs -0 modprobe -abq
echo "Finished loading drivers."

if [ "$drivers_to_load" != "" ] ; then
echo "Loading additional drivers."
for driver in $drivers_to_load
Expand Down
18 changes: 18 additions & 0 deletions scripts/etc/mdev.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# mdev.conf
#
# Provide user, group, and mode information for devices. If a regex matches
# the device name provided by sysfs, use the appropriate user:group and mode
# instead of the default 0:0 660.
#
# Syntax:
# [-]devicename_regex user:group mode [=path]|[>path]|[!] [@|$|*cmd args...]
# [-]$ENVVAR=regex user:group mode [=path]|[>path]|[!] [@|$|*cmd args...]
# [-]@maj,min[-min2] user:group mode [=path]|[>path]|[!] [@|$|*cmd args...]
#
# [-]: do not stop on this match, continue reading mdev.conf
# =: move, >: move and create a symlink
# !: do not create device node
# @|$|*: run @cmd if $ACTION=add, $cmd if $ACTION=remove, *cmd in all cases

# support module loading on hotplug
$MODALIAS=.* 0:0 660 @modprobe -b "$MODALIAS"