Skip to contentSkip to conversation

dracut: don't skip zero-length string outfile argument

PATCH Superseded Amadeusz Żołnowski 2 participants 4 messages Mar 28, 2011 – Mar 29, 2011 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dracut: don't skip zero-length string outfile argument

When '' was passed as outfile, dracut generated name with following pattern:

/boot/initramfs-$kernel

With commit 486a1b9324d6fc7bc534d8147d64b8b259692c46 dracut skips '' argument.

---
 dracut |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
dracut +2 -1
index 6b67dc0..e7d0990 100755
@@ -188,6 +188,7 @@ push_arg() {
 }
 
 kernel="unset"
+outfile="unset"
 verbosity_mod_l=0
 
 while (($# > 0)); do
@@ -237,7 +238,7 @@ while (($# > 0)); do
                        ;;
         -*) printf "\nUnknown option: %s\n\n" "$1" >&2; usage; exit 1;;
         *) 
-            if ! [[ $outfile ]]; then
+            if [[ $outfile = "unset" ]]; then
                 outfile=$1
             elif [[ $kernel = "unset" ]]; then
                 kernel=$1
Signature · 1 line
1.7.4.1

A message that is not in the archive (sent off-list or not yet received): 1301352736-5715-1-git-send-email-aidecoe-2qtfh70TtYba5EbDDlwbIw@public.gmane.org

#2 lore raw

PATCH v2 1/1 dracut: don't skip zero-length string outfile argument

When '' was passed as outfile, dracut generated name with following pattern:

/boot/initramfs-$kernel

With commit 486a1b9324d6fc7bc534d8147d64b8b259692c46 dracut skips '' argument.

---
 dracut |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
dracut +1 -1
index 6b67dc0..c16b222 100755
@@ -237,7 +237,7 @@ while (($# > 0)); do
                        ;;
         -*) printf "\nUnknown option: %s\n\n" "$1" >&2; usage; exit 1;;
         *) 
-            if ! [[ $outfile ]]; then
+            if ! [[ ${outfile+x} ]]; then
                 outfile=$1
             elif [[ $kernel = "unset" ]]; then
                 kernel=$1
Signature · 1 line
1.7.4.1
#4 lore raw

Am 29.03.2011 01:22, schrieb Amadeusz Żołnowski:

Quoted 4 lines

Excerpts from Amadeusz Żołnowski's message of Tue Mar 29 00:52:16 +0200 2011:

Quoted 1 line

+outfile="unset"

This is bad for file.

used this:

dracut +2 -1
index 6b67dc0..0324ac5 100755
@@ -237,8 +237,9 @@ while (($# > 0)); do
                        ;;
         -*) printf "\nUnknown option: %s\n\n" "$1" >&2; usage; exit 1;;
         *)
-            if ! [[ $outfile ]]; then
+            if ! [[ $outfile_set ]]; then
                 outfile=$1
+                outfile_set=y
             elif [[ $kernel = "unset" ]]; then
                 kernel=$1
             else