]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut.sh: reorder things to let "--print-cmdline" work
authorHarald Hoyer <harald@redhat.com>
Mon, 9 Sep 2013 14:52:19 +0000 (16:52 +0200)
committerHarald Hoyer <harald@redhat.com>
Mon, 9 Sep 2013 14:52:19 +0000 (16:52 +0200)
dracut.sh

index 7ad9d1eff072fa3907c39b8d71731caa019f4c6b..fcc489e43103b0bcac4bca56474dacda275c48ba 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -821,20 +821,6 @@ if [[ -f $outfile && ! $force && ! $print_cmdline ]]; then
     exit 1
 fi
 
-outdir=${outfile%/*}
-[[ $outdir ]] || outdir="/"
-
-if [[ ! -d "$outdir" ]]; then
-    dfatal "Can't write to $outdir: Directory $outdir does not exist or is not accessible."
-    exit 1
-elif [[ ! -w "$outdir" ]]; then
-    dfatal "No permission to write to $outdir."
-    exit 1
-elif [[ -f "$outfile" && ! -w "$outfile" ]]; then
-    dfatal "No permission to write $outfile."
-    exit 1
-fi
-
 # Need to be able to have non-root users read stuff (rpcbind etc)
 chmod 755 "$initdir"
 
@@ -1025,6 +1011,20 @@ if [[ $print_cmdline ]]; then
     exit 0
 fi
 
+outdir=${outfile%/*}
+[[ $outdir ]] || outdir="/"
+
+if [[ ! -d "$outdir" ]]; then
+    dfatal "Can't write to $outdir: Directory $outdir does not exist or is not accessible."
+    exit 1
+elif [[ ! -w "$outdir" ]]; then
+    dfatal "No permission to write to $outdir."
+    exit 1
+elif [[ -f "$outfile" && ! -w "$outfile" ]]; then
+    dfatal "No permission to write $outfile."
+    exit 1
+fi
+
 # Create some directory structure first
 [[ $prefix ]] && mkdir -m 0755 -p "${initdir}${prefix}"