summaryrefslogtreecommitdiff
path: root/update-initramfs
diff options
context:
space:
mode:
authorMichael Prokop <mika@debian.org>2010-05-30 21:25:02 +0200
committerMichael Prokop <mika@debian.org>2010-06-02 23:44:25 +0200
commit8db2ddbaaf1f554c131f2483032aa31b6b70b36b (patch)
tree9c966c9924e9328e076149dcb0123e33e2e1b8f5 /update-initramfs
parent06468756ee6d5477b306a61473789f4aa9c088a1 (diff)
downloadinitramfs-tools-8db2ddbaaf1f554c131f2483032aa31b6b70b36b.tar.gz
initramfs-tools-8db2ddbaaf1f554c131f2483032aa31b6b70b36b.zip
update-initramfs: fix unbound variables. [Closes: #583695]
Signed-off-by: Michael Prokop <mika@debian.org>
Diffstat (limited to 'update-initramfs')
-rwxr-xr-xupdate-initramfs14
1 files changed, 11 insertions, 3 deletions
diff --git a/update-initramfs b/update-initramfs
index 94b8971..89bbdbe 100755
--- a/update-initramfs
+++ b/update-initramfs
@@ -7,6 +7,8 @@ KPKGCONF=/etc/kernel-img.conf
USETRIGGERS=true
mode=""
version=""
+update_initramfs=yes
+backup_initramfs=no
set -eu
@@ -26,7 +28,7 @@ fi
usage()
{
- if [ -n "${1}" ]; then
+ if [ -n "${1:-}" ]; then
printf "${@}\n\n" >&2
fi
cat >&2 << EOF
@@ -61,7 +63,7 @@ chrooted()
mild_panic()
{
- if [ -n "${1}" ]; then
+ if [ -n "${1:-}" ]; then
printf "${@}\n" >&2
fi
exit 0
@@ -69,7 +71,7 @@ mild_panic()
panic()
{
- if [ -n "${1}" ]; then
+ if [ -n "${1:-}" ]; then
printf "${@}\n" >&2
fi
exit 1
@@ -127,6 +129,7 @@ backup_booted_initramfs()
fi
# keep booted initramfs
+ boot_initramfs=
uptime_days=$(awk '{printf "%d", $1 / 3600 / 24}' /proc/uptime)
if [ -n "$uptime_days" ]; then
boot_initramfs=$(find "${initramfs}.bak" -mtime +${uptime_days})
@@ -295,6 +298,7 @@ set_current_version()
set_linked_version()
{
+ linktarget=
if [ -e /initrd.img ] && [ -L /initrd.img ]; then
linktarget="$(basename "$(readlink /initrd.img)")"
fi
@@ -313,6 +317,10 @@ set_linked_version()
set_highest_version()
{
get_sorted_versions
+ if [ -z "${version_list}" ]; then
+ version=
+ return
+ fi
set -- ${version_list}
version=${1}
}