summaryrefslogtreecommitdiff
path: root/hook-functions
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2007-07-28 19:06:11 +0200
committermaximilian attems <maks@debian.org>2007-07-28 19:06:11 +0200
commit494e8cf2560b3d139273513899164219c7c2ae98 (patch)
tree2e869fd743a6eb2af8dcedbaa140e0f81eda3912 /hook-functions
parentbc7a264c033d8236a7e2672b0165493f59878b54 (diff)
downloadinitramfs-tools-494e8cf2560b3d139273513899164219c7c2ae98.tar.gz
initramfs-tools-494e8cf2560b3d139273513899164219c7c2ae98.zip
hook-functions: Protect variables with local usage
bonus minor coding style cleanup
Diffstat (limited to 'hook-functions')
-rw-r--r--hook-functions18
1 files changed, 12 insertions, 6 deletions
diff --git a/hook-functions b/hook-functions
index 131f132..b371cbb 100644
--- a/hook-functions
+++ b/hook-functions
@@ -169,20 +169,24 @@ copy_exec() {
# Copy entire subtrees to the initramfs
copy_modules_dir()
{
+ local x_mod
+
if ! [ -d "${MODULESDIR}/${1}" ]; then
return;
fi
- if [ -n "${verbose}" ] && [ "${verbose}" = "y" ]; then
+ if [ "${verbose}" = "y" ]; then
echo "Copying module directory ${1}"
fi
for x_mod in $(find "${MODULESDIR}/${1}" -name '*.ko' -print); do
- manual_add_modules `basename ${x_mod} .ko`
+ manual_add_modules $(basename ${x_mod} .ko)
done
}
# only copy relevant modules
dep_add_modules()
{
+ local x
+
# findout root block device + fstype
eval "$(mount | awk '/ \/ / {print "root=" $1 "\nrootfs=" $5; exit}')"
block=${root#/dev/}
@@ -319,10 +323,12 @@ EOF
# minimal supported kernel version
check_minkver()
{
- curversion=${1}
- initdir=${2}
- if [ -z ${initdir} ]; then
- DPKG_ARCH=`dpkg --print-installation-architecture`
+ local curversion initdir DPKG_ARCH minversion cm_x tmp
+
+ curversion="${1}"
+ initdir="${2}"
+ if [ -z "${initdir}" ]; then
+ DPKG_ARCH=$(dpkg --print-installation-architecture)
case ${DPKG_ARCH} in
ia64|hppa)
minversion="2.6.15"