From 8aef53522816fe7363060647ab9495aa27d75a1e Mon Sep 17 00:00:00 2001 From: Jan Steffens Date: Tue, 15 Jun 2010 00:37:00 +0200 Subject: Fix autodetect bitrot This error went unnoticed after auto_modules was switched over to resolve-modalias. As a result, ata_generic and ide-generic weren't filtered anymore. --- install/autodetect | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/install/autodetect b/install/autodetect index 63e85c2..c1a6b76 100644 --- a/install/autodetect +++ b/install/autodetect @@ -4,10 +4,8 @@ install () { MODULE_FILE="${TMPDIR}/autodetect_modules" #blegh, we'll let /tmp clean itself up - AUTODETECT="$(auto_modules -e '/scsi/' -e '/block' -e '/fusion/' \ - -e '/usb/' -e '/ide/' -e '/ieee1394/' -e '/cdrom' \ - -e '/net/' -e '/pcmcia' -e '/ata' \ - | grep -v -e 'ata_generic.ko' -e 'ide-generic.ko')" + AUTODETECT="$(auto_modules | \ + sed -e 's/ata_generic//g' -e 's/ide_generic//g')" #Filesystem detection, use sysfs instead of /proc @@ -45,8 +43,7 @@ install () err "User does not have proper permissions to read superblocks, raid and filesystem modules are not detected" fi - for m in ${AUTODETECT}; do - modname="$(basename ${m%%\.ko})" + 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}";; -- cgit v1.2.3-24-g4f1b From a1c547e7e8e5c4a420a763451eb6af49b329af68 Mon Sep 17 00:00:00 2001 From: Jan Steffens Date: Tue, 15 Jun 2010 17:00:54 +0200 Subject: 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. --- functions | 19 ++++++++++++++----- install/autodetect | 15 ++------------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/functions b/functions index 49b4ab4..91145f1 100644 --- a/functions +++ b/functions @@ -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 -- cgit v1.2.3-24-g4f1b From ae111aae812059091b864b38c241f5ce93b8e9c2 Mon Sep 17 00:00:00 2001 From: Jan Steffens Date: Tue, 15 Jun 2010 17:41:14 +0200 Subject: sed cleanup Replace some seds with tr and bash pattern removal --- functions | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/functions b/functions index 91145f1..4bdb27e 100644 --- a/functions +++ b/functions @@ -8,7 +8,7 @@ auto_modules () [ -n "$m" ] && mods="$mods $m" done - echo "${mods}" | sed 's|-|_|g' + echo "${mods}" | tr '-' '_' [ -z "${mods}" ] && return 1 return 0 } @@ -26,7 +26,7 @@ checked_modules () { if [ -e "${MODULE_FILE}" ]; then for mod in $(all_modules $@); do - modname="$(basename ${mod%%\.ko} | sed 's|-|_|g')" + modname="$(basename ${mod%.ko} | tr '-' '_')" if grep "^${modname}$" "${MODULE_FILE}" >/dev/null 2>&1; then echo ${modname} fi @@ -147,9 +147,9 @@ add_module () { local m fil path fw mod deps #cleanup - remove .ko, replace - with _ - m=$(basename "${1}" | sed -e 's|-|_|g' -e 's|\.ko$||g') + m=$(basename "${1%.ko}" | tr '-' '_') #find pattern - replace _ with [-_] to match either - fil=$(echo "$m" | sed -e 's|_|\[-_\]|g') + fil=$(echo "$m" | sed 's|_|\[-_\]|g') found=0 for path in $(find "${MODULEDIR}" -type f -name "${fil}.ko"); do -- cgit v1.2.3-24-g4f1b From 94945a63162944f4bcf61f0012853f95191f0f91 Mon Sep 17 00:00:00 2001 From: Jan Steffens Date: Tue, 15 Jun 2010 19:32:33 +0200 Subject: Simple Btrfs hook All it does for now is cause a Btrfs scan so we can mount multi-device volumes. --- hooks/btrfs | 7 +++++++ install/btrfs | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 hooks/btrfs create mode 100644 install/btrfs diff --git a/hooks/btrfs b/hooks/btrfs new file mode 100644 index 0000000..c4836c5 --- /dev/null +++ b/hooks/btrfs @@ -0,0 +1,7 @@ +# vim: set ft=sh: + +run_hook () +{ + /sbin/modprobe btrfs + /sbin/btrfs device scan +} diff --git a/install/btrfs b/install/btrfs new file mode 100644 index 0000000..60dc2ac --- /dev/null +++ b/install/btrfs @@ -0,0 +1,16 @@ +# vim:set ft=sh: + +install() +{ + MODULES="$(all_modules btrfs)" + BINARIES="/sbin/btrfs" + SCRIPT="btrfs" +} + +help () +{ +cat <