From: Nathan Wagner Date: Thu, 10 Apr 2014 07:02:03 +0000 (+0000) Subject: probe for hardware in rc.sysinit X-Git-Url: https://pd.if.org/git/?p=startuptools;a=commitdiff_plain;h=a3fb8f7fdef8cf61b194fd8b44b5c9c39923ffed probe for hardware in rc.sysinit --- diff --git a/scripts/rc.conf b/scripts/rc.conf index f8565a3..7dfff27 100644 --- a/scripts/rc.conf +++ b/scripts/rc.conf @@ -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 diff --git a/scripts/rc.sysinit b/scripts/rc.sysinit index 46794a6..8f030c7 100644 --- a/scripts/rc.sysinit +++ b/scripts/rc.sysinit @@ -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