summaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2006-05-02 09:53:50 +0200
committerAaron Griffin <aaron@archlinux.org>2006-05-02 09:53:50 +0200
commit66f28ea341f293cbddd30242f9ea03673d4674d2 (patch)
treecd4a229b169e0adedaebc7cf09ba295bada7fcab /functions
parentdbfcaacf40ca356d7623408b4bfca828f8bd880d (diff)
downloadmkinitcpio-66f28ea341f293cbddd30242f9ea03673d4674d2.tar.gz
mkinitcpio-66f28ea341f293cbddd30242f9ea03673d4674d2.tar.xz
Minor changes... more to come - out of time for the day
git-svn-id: http://projects.archlinux.org/svn/initramfs/mkinitcpio@42 880c04e9-e011-0410-abf7-b926e227c9cd
Diffstat (limited to 'functions')
-rw-r--r--functions29
1 files changed, 18 insertions, 11 deletions
diff --git a/functions b/functions
index e7fd578..ac3d5a7 100644
--- a/functions
+++ b/functions
@@ -13,10 +13,10 @@ all_modules ()
grep ${@} | sort -u
}
-msg() { [ "${QUIET}" = "n" ] && echo "${@}"; }
-err() { echo "ERROR: ${@}" >&2; }
+msg () { [ "${QUIET}" = "n" ] && echo "${@}"; }
+err () { echo "ERROR: ${@}" >&2; }
-add_dir()
+add_dir ()
{
if [ "x${1}" != "x" -a "${1}" != "/" ]; then
@@ -28,8 +28,8 @@ add_dir()
fi
}
-# add_devnode /dev/foo type major minor [permissions]
-add_device()
+# add_device /dev/foo type major minor [permissions]
+add_device ()
{
if [ $# -ge 4 ]; then
local perms
@@ -50,10 +50,10 @@ add_symlink ()
local fil dest dir
if [ -L ${1} ]; then
fil="${1}"
- dest="${fil##$BASEDIR}"
+ dest="${2##$BASEDIR}"
add_dir $(dirname "${dest}")
if ! grep "slink ${dest} " "${FILELIST}" 2>&1 > /dev/null; then
- msg " adding symlink ${dest}"
+ msg " adding link ${fil} -> ${dest}"
echo "slink ${dest} ${fil} $(stat -c '%a %u %g' ${fil})" >> "${FILELIST}"
fi
fi
@@ -67,7 +67,7 @@ add_file ()
fil="${1}"
lnk=$(readlink -f "${fil}")
if [ -n "${lnk}" ]; then
- add_symlink "${fil}"
+ add_symlink "${fil}" "${lnk}"
fil="${lnk}"
fi
if [ $# -eq 2 ]; then
@@ -89,7 +89,8 @@ add_file ()
}
HAS_MODULES="n"
-add_module()
+#modules are handled specially in order to enable autodetection
+add_module ()
{
local fil path mod deps
#cleanup - remove .ko, replace - and _ with [-_] to match either
@@ -106,7 +107,13 @@ add_module()
done
}
-add_binary()
+_finish_modules ()
+{
+ echo "wtf!"
+
+}
+
+add_binary ()
{
local bin type lib
bin=$(which "${1}")
@@ -147,7 +154,7 @@ add_binary()
fi
}
-parse_hook()
+parse_hook ()
{
local mod bin fil
for mod in $MODULES; do