From 4826ad0747f9caa8e685f819102e71845905a6a1 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Mon, 28 May 2012 10:58:43 -0400 Subject: add support for modules-load.d directories Signed-off-by: Dave Reisner --- functions | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'functions') diff --git a/functions b/functions index 99bc43b..8105a5e 100644 --- a/functions +++ b/functions @@ -344,6 +344,20 @@ kill_all() { fi } +load_modules() { + local rc=0 + + /usr/lib/systemd/systemd-load-modules + rc=$? + + if (( ${#MODULES[*]} )); then + modprobe -ab "${MODULES[@]}" + (( rc += $? )) + fi + + return $rc +} + # Start/trigger UDev, load MODULES and settle UDev udevd_modprobe() { # $1 = where we are being called from. @@ -357,9 +371,8 @@ udevd_modprobe() { udevadm trigger --action=add --type=devices stat_done - # Load modules from the MODULES array defined in rc.conf - (( ${#MODULES[*]} )) && - status -v "Loading User-specified Modules" modprobe -ab "${MODULES[@]}" + # Load modules from the MODULES array and modules-load.d + status -v "Loading User-specified Modules" load_modules status "Waiting for UDev uevents to be processed" \ udevadm settle -- cgit v1.2.3