]> pd.if.org Git - startuptools/commitdiff
probe for hardware in rc.sysinit
authorNathan Wagner <nw@hydaspes.if.org>
Thu, 10 Apr 2014 07:02:03 +0000 (07:02 +0000)
committerNathan Wagner <nw@hydaspes.if.org>
Thu, 10 Apr 2014 07:02:03 +0000 (07:02 +0000)
scripts/rc.conf
scripts/rc.sysinit

index f8565a3cabce30da164cd9eb9d653f2e8b1a745f..7dfff27e5c454ab2cef2edc827b6063294a08229 100644 (file)
@@ -20,3 +20,8 @@ NETWORKS='localhost default'
 # args to be passed to hwclock at startup
 # if hwclock is in the DAEMONS list
 # HWCLOCK=
+#
+
+# set if you don't want the startup scripts to do a basic probe
+# for hardware kernel modules
+# NOPROBEHW=0
index 46794a6c3cf4405a14e5475b44029ee5ebaa2125..8f030c7edc19697c91a46d29ee2888954b7022ca 100644 (file)
@@ -68,10 +68,24 @@ status_begin remounting root filesystem rw
 mount -o remount,rw /
 status_check
 
+# need to run depmod here, just in case
+# it should be done at kernel install time, but this can avoid
+# errors if that goes wrong or there are new or removed modules
 status_begin running depmod
 depmod
 status_check
 
+# load any kernel modules
+# there's probably a better way to do this
+# this could also be done in the initial ram-disk, but
+# this covers the case where there isn't one, but we still want
+# to load more hardware
+if ! is_true "$NOPROBEHW" ; then
+       status_begin "looking for kernel modules to load"
+       lspci -k|grep 'Kernel modules:' | awk '{print $3}'| sort -u | xargs -n1 modprobe
+       status_check
+fi
+
 # set up /dev
 
 if [ -x /sbin/mdev ] && ! is_true "$USE_UDEV" ; then