summaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2006-04-26 09:37:40 +0200
committerAaron Griffin <aaron@archlinux.org>2006-04-26 09:37:40 +0200
commitedd497035779d919ebc27c7a319a53affc96a52b (patch)
treec8a8ec02acc1a1d2478d82494d0015844a5bbf16 /functions
parent0a28a95f49eaeb33487c21995c71b5ca74df131e (diff)
downloadmkinitcpio-edd497035779d919ebc27c7a319a53affc96a52b.tar.gz
mkinitcpio-edd497035779d919ebc27c7a319a53affc96a52b.tar.xz
git-svn-id: http://projects.archlinux.org/svn/initramfs/mkinitcpio@20 880c04e9-e011-0410-abf7-b926e227c9cd
Diffstat (limited to 'functions')
-rw-r--r--functions15
1 files changed, 6 insertions, 9 deletions
diff --git a/functions b/functions
index 6b35d77..6cb6227 100644
--- a/functions
+++ b/functions
@@ -17,15 +17,12 @@ err() { echo "ERROR: ${@}" >&2; }
add_dir()
{
- local dir
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 $(dirname "${dir}")
- msg " adding dir ${dir}"
- echo "dir ${dir} 755 0 0" >> "${FILELIST}"
+ if ! grep "dir ${1} " "${FILELIST}" 2>&1 > /dev/null; then
+ add_dir $(dirname "${1}")
+ msg " adding dir ${1}"
+ echo "dir ${1} 755 0 0" >> "${FILELIST}"
fi
fi
}
@@ -36,9 +33,9 @@ add_device()
if [ $# -ge 4 ]; then
local perms
perms="${5:-644}"
- add_dir "${1}"
if ! grep "nod ${1}" "${FILELIST}" 2>&1 > /dev/null; then
- msg " adding device node ${1}"
+ add_dir $(dirname "${1}")
+ msg " adding node ${1}"
echo "nod ${1} ${perms} 0 0 ${2} ${3} ${4}" >> "${FILELIST}"
fi
else