Blob Blame History Raw
From 8a5354a9a5264c67a84c4705c931c5f554d8d343 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Tue, 29 Mar 2011 11:21:54 +0200
Subject: [PATCH] dracut: simplify $kernel version argument setting

---
 dracut |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/dracut b/dracut
index c16b222..0a96c66 100755
--- a/dracut
+++ b/dracut
@@ -187,7 +187,6 @@ push_arg() {
     fi
 }
 
-kernel="unset"
 verbosity_mod_l=0
 
 while (($# > 0)); do
@@ -239,7 +238,7 @@ while (($# > 0)); do
         *) 
             if ! [[ ${outfile+x} ]]; then
                 outfile=$1
-            elif [[ $kernel = "unset" ]]; then
+            elif ! [[ ${kernel+x} ]]; then
                 kernel=$1
             else
                 usage; exit 1;
@@ -248,7 +247,7 @@ while (($# > 0)); do
     esac
     shift
 done
-if ! [[ $kernel ]] || [[ $kernel = "unset" ]]; then
+if ! [[ $kernel ]]; then
     kernel=$(uname -r)
 fi
 [[ $outfile ]] || outfile="/boot/initramfs-$kernel.img"