From: Victor Lowther Date: Wed, 4 Mar 2009 00:21:10 +0000 (-0800) Subject: Modify instmods to not rely on the existence of modules.* files X-Git-Tag: 0.1~399 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ca7d88da139afc2b83a34a9b7e8800288326cc06;p=thirdparty%2Fdracut.git Modify instmods to not rely on the existence of modules.* files This patch series aims to make dracut more distro-independent. It includes some of the functionality that Seewer Philippe posted to the list to make dracut work on Ubuntu. depmod does not create these files on all distros (Debian, specifically), so modify instmods to use pathname components and find to do what we want. As a bonus, this removes the special-case for =ata. --- diff --git a/dracut-functions b/dracut-functions index 50e458830..6c84d7f42 100755 --- a/dracut-functions +++ b/dracut-functions @@ -177,14 +177,14 @@ dracut_install() { done } -modcat="/lib/modules/$kernel/modules" +srcmods="/lib/modules/$kernel/" instmods() { local mod mpargs modpath modname cmd while (($# > 0)); do mod=${1%.ko} + mod=${mod##*/} case $mod in - =ata) instmods $mpargs $(cat "${modcat}.block" |egrep 'ata|ahci');; - =*) instmods $mpargs $(cat "${modcat}.${mod#=}");; + =*) instmods $mpargs $(find "$srcmods" -path "*/${mod#=}/*");; --*) mpargs+=" $mod";; *) modprobe $mpargs --set-version $kernel --show-depends $mod \ 2>/dev/null |while read cmd modpath options; do @@ -195,7 +195,7 @@ instmods() { instmods $mpargs $modname continue } - inst_simple "$modpath" "/lib/modules/$kernel/$modname.ko" + inst_simple "$modpath" done ;; esac