summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2006-04-25 23:57:18 +0200
committerAaron Griffin <aaron@archlinux.org>2006-04-25 23:57:18 +0200
commit0958c0bcbad1a9db223225b9e69247e6b9c7a80c (patch)
tree26d95d47e67bf5e71dfce99c3b95597d1a3b9bed
parent3f006aabbbef45df73071df0a558655bc8d23699 (diff)
downloadmkinitcpio-0958c0bcbad1a9db223225b9e69247e6b9c7a80c.tar.gz
mkinitcpio-0958c0bcbad1a9db223225b9e69247e6b9c7a80c.tar.xz
git-svn-id: http://projects.archlinux.org/svn/initramfs/mkinitcpio@14 880c04e9-e011-0410-abf7-b926e227c9cd
-rw-r--r--functions10
-rw-r--r--hooks/base2
-rw-r--r--install/ide-auto6
-rw-r--r--mkinitcpio16
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<<HELPEOF
This hook loads the necessary modules for an ide root device.
- Detection will take place at runtime. To minimize the modules
- in the image, use the -auto flavor.
+ Detection will take place at runtime.
HELPEOF
}
diff --git a/mkinitcpio b/mkinitcpio
index d862753..0056ec7 100644
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -82,8 +82,13 @@ fi
source "${CONFIG}"
if [ -f "${FILELIST}" -a "x${APPEND}" == "x" ]; then
- echo "destination file list '${FILELIST}' exists - remove before running"
- exit 1
+ if [ "x${SAVELIST}" == "x" ]; then
+ rm ${FILELIST}
+ touch "${FILELIST}"
+ else
+ echo "destination file list '${FILELIST}' exists - remove before running"
+ exit 1
+ fi
elif [ -f "${DESTIMG}" ]; then
echo "destination image '${DESTIMG}' exists - remove before running"
exit 1
@@ -100,16 +105,11 @@ for hook in $HOOKS; do
unset BINARIES
unset FILES
install () { msg "${hook}: no install function..."; }
- if grep "install ()" "${INSTDIR}/${hook}" /dev/null 2>&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