diff options
author | maximilian attems <maks@debian.org> | 2010-06-19 18:08:15 +0200 |
---|---|---|
committer | maximilian attems <maks@debian.org> | 2010-06-22 11:25:07 +0200 |
commit | 837f2614f79e8ea66385e6dcb2a6072ddb5ec186 (patch) | |
tree | ff631ac32b176b9a1a337cf078d71e594954c9a9 | |
parent | 2390db89c9bcf1f83405098ba9221ae7476187cb (diff) | |
download | initramfs-tools-837f2614f79e8ea66385e6dcb2a6072ddb5ec186.tar.gz initramfs-tools-837f2614f79e8ea66385e6dcb2a6072ddb5ec186.zip |
mkinitramfs: set nounset and errexit
Better catch both early than stupid mistakes cropping in.
Signed-off-by: maximilian attems <maks@debian.org>
-rw-r--r-- | hook-functions | 2 | ||||
-rwxr-xr-x | mkinitramfs | 2 | ||||
-rw-r--r-- | scripts/functions | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/hook-functions b/hook-functions index d860bc7..9d63d58 100644 --- a/hook-functions +++ b/hook-functions @@ -532,7 +532,7 @@ check_minkver() # sed: keep last line starting with MINKVER=, # remove MINKVER= and trailing space minver=$(sed '/^MINKVER=/!d;$!d;s/^MINKVER=//;s/[[:space:]]*$//' "${initdir}/${cm_x}") - if [ -z "${tmp}" ]; then + if [ -z "${tmp:-}" ]; then continue elif dpkg --compare-versions "${curversion}" lt "${minver}"; then echo "W: ${cm_x} hook script requires at least kernel version ${minver}" >&2 diff --git a/mkinitramfs b/mkinitramfs index e49e01c..bccdbed 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -1,5 +1,7 @@ #!/bin/sh +set -eu + umask 0022 export PATH='/usr/bin:/sbin:/bin' diff --git a/scripts/functions b/scripts/functions index 068e901..364cc27 100644 --- a/scripts/functions +++ b/scripts/functions @@ -107,7 +107,7 @@ set_initlist() continue fi - initlist="${initlist} ${si_x#${initdir}/}" + initlist="${initlist:-} ${si_x#${initdir}/}" done } |