diff options
author | Jan Steffens <jan.steffens@gmail.com> | 2010-06-15 17:00:54 +0200 |
---|---|---|
committer | Jan Steffens <jan.steffens@gmail.com> | 2010-06-19 02:05:18 +0200 |
commit | a1c547e7e8e5c4a420a763451eb6af49b329af68 (patch) | |
tree | f89db8061ac33c1f37fbea66828708440bac3443 | |
parent | 8aef53522816fe7363060647ab9495aa27d75a1e (diff) | |
download | mkinitcpio-a1c547e7e8e5c4a420a763451eb6af49b329af68.tar.gz mkinitcpio-a1c547e7e8e5c4a420a763451eb6af49b329af68.tar.xz |
Implement explicit module depends
Needed to get libcrc32c and therefore btrfs to work. Also remove the
equivalent section in autodetect, which wasn't working anyway.
-rw-r--r-- | functions | 19 | ||||
-rw-r--r-- | install/autodetect | 15 |
2 files changed, 16 insertions, 18 deletions
@@ -145,9 +145,11 @@ HAS_MODULES="n" #modules are handled specially in order to enable autodetection add_module () { - local fil path fw mod deps - #cleanup - remove .ko, replace - and _ with [-_] to match either - fil=$(basename "${1}" | sed -e "s|[-_]|\[-_\]|g" -e "s|\.ko$||g") + local m fil path fw mod deps + #cleanup - remove .ko, replace - with _ + m=$(basename "${1}" | sed -e 's|-|_|g' -e 's|\.ko$||g') + #find pattern - replace _ with [-_] to match either + fil=$(echo "$m" | sed -e 's|_|\[-_\]|g') found=0 for path in $(find "${MODULEDIR}" -type f -name "${fil}.ko"); do @@ -164,8 +166,15 @@ add_module () HAS_MODULES="y" add_file "${path}" && found=1 done - if [ ${found} -eq 0 ]; then - err "module '$fil' not found" + if [ ${found} -eq 1 ]; then + #explicit module depends + case "$m" in + fat) add_module "nls_cp437" ;; + ocfs2) add_module "configfs" ;; + libcrc32c) add_module "crc32c"; add_module "crc32c_intel" ;; + esac + else + err "module '$m' not found" fi } diff --git a/install/autodetect b/install/autodetect index c1a6b76..914a96b 100644 --- a/install/autodetect +++ b/install/autodetect @@ -43,19 +43,8 @@ install () err "User does not have proper permissions to read superblocks, raid and filesystem modules are not detected" fi - for modname in ${AUTODETECT}; do - grep "^${modname}$" "${MODULE_FILE}" >/dev/null 2>&1 && continue - case "${m}" in - #*/ieee1394/*) echo -e "sbp2\nsd_mod\nsr_mod" >> "${MODULE_FILE}";; - *ext3*) echo "jbd" >> "${MODULE_FILE}" ;; - *ext4*) echo -e "jbd2\nmbcache\ncrc16" >> "${MODULE_FILE}" ;; - *afs*) echo "rxrpc" >> "${MODULE_FILE}" ;; - *cramfs*) echo "zlib_inflate" >> "${MODULE_FILE}" ;; - *isofs*) echo "zlib_inflate" >> "${MODULE_FILE}" ;; - *msdos*) echo "fat" >> "${MODULE_FILE}" ;; - *vfat*) echo -e "fat\nnls_cp437" >> "${MODULE_FILE}" ;; - *ocfs2*) echo -e "ocfs2_dlm\njbd\nocfs2_nodemanager\nconfigfs" >> "${MODULE_FILE}" ;; - esac + for m in ${AUTODETECT}; do + modname="$(basename ${m%.ko})" echo "${modname}" >> "${MODULE_FILE}" done |