# vim: set ft=sh: install () { MODULE_FILE="${TMPDIR}/autodetect_modules" #blegh, we'll let /tmp clean itself up AUTODETECT="$(auto_modules | \ sed -e 's/ata_generic//g' -e 's/ide_generic//g')" #Filesystem detection, only probe the device for / findfs () { local rootdev if [ -f /proc/self/mountinfo -a -x /bin/findmnt ]; then /bin/findmnt -n -u -o fstype / 2>/dev/null fi } if [ ${UID} -eq 0 -o "$(groups | grep disk)" != "" ]; then fss=$(findfs | sort | uniq) if [ -z "${fss}" ]; then err "Root file system type detection failed." autodetect_fs_detection_failed=1 fi for fs in ${fss}; do allfs="${fs} $(modprobe --set-version ${KERNELVERSION} --resolve-alias ${fs})" for mod in ${allfs}; do for modfile in $(find "${MODULEDIR}" -type f -name "${mod}.ko" -or -name "${mod}.ko.gz"); do if [ -n "${modfile}" ]; then AUTODETECT="${AUTODETECT} ${modfile}" fi done done done if [ -e /sbin/mdadm ]; then for raidmod in $(/sbin/mdadm -E -s -v /dev/hd* /dev/sd* /dev/rd/* /dev/ida/* /dev/cciss/* /dev/ataraid/* /dev/mapper/* \ | awk -Flevel= '{print $2}' | awk '{print $1}'); do case "${raidmod}" in raid4|raid5|raid6) AUTODETECT="${AUTODETECT} raid456" ;; *) AUTODETECT="${AUTODETECT} ${raidmod}" ;; esac done fi else autodetect_fs_detection_failed=1 autodetect_raid_detection_failed=1 err "User does not have proper permissions to read superblocks, raid and filesystem modules are not detected" fi for m in ${AUTODETECT}; do modname="$(get_module_name "${m}")" echo "${modname}" >> "${MODULE_FILE}" done BINARIES="" FILES="" SCRIPT="" } help () { cat <