diff options
author | David Härdeman <david@hardeman.nu> | 2007-07-28 19:06:11 +0200 |
---|---|---|
committer | maximilian attems <maks@debian.org> | 2007-07-28 19:06:11 +0200 |
commit | 494e8cf2560b3d139273513899164219c7c2ae98 (patch) | |
tree | 2e869fd743a6eb2af8dcedbaa140e0f81eda3912 | |
parent | bc7a264c033d8236a7e2672b0165493f59878b54 (diff) | |
download | initramfs-tools-494e8cf2560b3d139273513899164219c7c2ae98.tar.gz initramfs-tools-494e8cf2560b3d139273513899164219c7c2ae98.zip |
hook-functions: Protect variables with local usage
bonus minor coding style cleanup
-rw-r--r-- | debian/changelog | 7 | ||||
-rw-r--r-- | hook-functions | 18 |
2 files changed, 17 insertions, 8 deletions
diff --git a/debian/changelog b/debian/changelog index d3b579d..c37028a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,14 @@ initramfs-tools (0.90) UNRELEASED; urgency=low + [ maximilian attems ] * hook-functions: Fix xen i386 boots with optimized 2.5. (closes: 420754) Thanks Marco Nenciarini <mnencia@debian.org> for patch. - * debian/control: Bump dep on klibc-utils from etch. (closes: 435031) - -- maximilian attems <maks@debian.org> Sat, 28 Jul 2007 18:56:36 +0200 + [ David Härdeman ] + * hook-functions: Protect all variable with local, plus coding style fixes. + + -- maximilian attems <maks@debian.org> Sat, 28 Jul 2007 19:03:35 +0200 initramfs-tools (0.89) unstable; urgency=low 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" |