From 0958c0bcbad1a9db223225b9e69247e6b9c7a80c Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Tue, 25 Apr 2006 21:57:18 +0000 Subject: git-svn-id: http://projects.archlinux.org/svn/initramfs/mkinitcpio@14 880c04e9-e011-0410-abf7-b926e227c9cd --- functions | 10 +++++----- hooks/base | 2 +- install/ide-auto | 6 ++---- mkinitcpio | 16 ++++++++-------- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/functions b/functions index e424b1c..7a02c6e 100644 --- a/functions +++ b/functions @@ -18,12 +18,12 @@ err() { echo "ERROR: ${@}" >&2; } add_dir() { local dir - dir="$(dirname ${1})" - if [ "x${dir}" != "x" -a "${dir}" != "/" ]; then - dir="${dir}" #this got stripped off above... put it back + if [ "x${1}" != "x" -a "${1}" != "/" ]; then + dir="$(dirname ${1})" + [ "${dir}" = "/" ] && dir="${1}" if ! grep "dir ${dir} " "${FILELIST}" 2>&1 > /dev/null; then - add_dir "${dir}" + add_dir $(dirname "${dir}") msg " adding dir ${dir}" echo "dir ${dir} 755 0 0" >> "${FILELIST}" fi @@ -171,7 +171,7 @@ parse_hook() done if [ "x${SCRIPT}" != "x" ]; then - add_file "${HOOKDIR}/${SCRIPT}" + add_file "${HOOKDIR}/${SCRIPT}" "/hooks/${SCRIPT}" fi } # vim: set ft=sh ts=4 sw=4 noet: diff --git a/hooks/base b/hooks/base index 706fb85..eccf591 100644 --- a/hooks/base +++ b/hooks/base @@ -3,7 +3,7 @@ run_hook () { if [ -e "/sys/bus/pci" ]; then msg -n "Loading base modules..." - /bin/modprobe -a -q $(/bin/cat /sys/bus/pci/devices/*/modalias) >/dev/null 2>&1 & + /bin/modprobe -a -q $(/bin/cat /sys/bus/pci/devices/*/modalias) >/dev/null 2>&1 msg "done." fi } diff --git a/install/ide-auto b/install/ide-auto index 8a5a247..b25b6a3 100644 --- a/install/ide-auto +++ b/install/ide-auto @@ -3,8 +3,7 @@ install () { MODULES="" - for m in $(auto_modules | grep "/ide/"); - do + for m in $(auto_modules "/ide/"); do MODULES="$MODULES $(basename $m)" done BINARIES="" @@ -16,7 +15,6 @@ help () { cat<&1; then + if grep "install" "${INSTDIR}/${hook}" /dev/null 2>&1; then source "${INSTDIR}/${hook}" install parse_hook fi - #quick test to check for existance... need a better way... - # note, this will only pick up valid run_hooks - a space is required - if grep "run_hook ()" "${HOOKDIR}/${hook}" 2>&1>/dev/null; then - add_file "${HOOKDIR}/${hook}" "/hooks/${hook}" - fi done if [ "${HAS_MODULES}" == "y" ]; then -- cgit v1.2.3-24-g4f1b