712866
From 81a6e87f0f183c1ddf8808bb52be09e3070caefd Mon Sep 17 00:00:00 2001
712866
From: Hannes Reinecke <hare@suse.de>
712866
Date: Fri, 29 Nov 2013 13:13:49 +0100
712866
Subject: [PATCH] Make logfile configurable
712866
712866
Add '--logfile' option to make the log file configurable during
712866
runtime.
712866
712866
Signed-off-by: Hannes Reinecke <hare@suse.de>
712866
(cherry picked from commit ee54b8404c10e29e5bddb633a4c7becb7acb0632)
712866
---
712866
 dracut.8.asc | 6 ++++++
712866
 dracut.sh    | 4 ++++
712866
 2 files changed, 10 insertions(+)
712866
712866
diff --git a/dracut.8.asc b/dracut.8.asc
5c6c2a
index f97074a2..14ce26b6 100644
712866
--- a/dracut.8.asc
712866
+++ b/dracut.8.asc
712866
@@ -275,6 +275,12 @@ Default:
712866
 
712866
 **--sshkey** _<sshkey file>_:: ssh key file used with ssh-client module.
712866
 
712866
+**--logfile** _<logfile>_:: logfile to use; overrides any setting from
712866
+    the configuration files.
712866
++
712866
+Default:
712866
+    _/var/log/dracut.log_
712866
+
712866
 **-l, --local**::
712866
     activates the local mode. dracut will use modules from the current working
712866
     directory instead of the system-wide installed modules in
712866
diff --git a/dracut.sh b/dracut.sh
5c6c2a
index f560dd1e..8e5e86f7 100755
712866
--- a/dracut.sh
712866
+++ b/dracut.sh
712866
@@ -187,6 +187,7 @@ Creates initial ramdisk images for preloading modules
712866
   --keep                Keep the temporary initramfs for debugging purposes
712866
   --printsize           Print out the module install size
712866
   --sshkey [SSHKEY]     Add ssh key to initramfs (use with ssh-client module)
712866
+  --logfile [FILE]      Logfile to use (overrides configuration setting)
712866
 
712866
 If [LIST] has multiple arguments, then you have to put these in quotes.
712866
 
712866
@@ -340,6 +341,7 @@ TEMP=$(unset POSIXLY_CORRECT; getopt \
712866
     --long debug \
712866
     --long profile \
712866
     --long sshkey: \
712866
+    --long logfile: \
712866
     --long verbose \
712866
     --long quiet \
712866
     --long local \
712866
@@ -430,6 +432,7 @@ while :; do
712866
         --debug)       debug="yes";;
712866
         --profile)     profile="yes";;
712866
         --sshkey)      sshkey="$2"; shift;;
712866
+        --logfile)     logfile_l="$2"; shift;;
712866
         -v|--verbose)  ((verbosity_mod_l++));;
712866
         -q|--quiet)    ((verbosity_mod_l--));;
712866
         -l|--local)
712866
@@ -709,6 +712,7 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
712866
 [[ $ro_mnt_l ]] && ro_mnt="yes"
712866
 [[ $early_microcode_l ]] && early_microcode=$early_microcode_l
712866
 [[ $early_microcode ]] || early_microcode=no
712866
+[[ $logfile_l ]] && logfile="$logfile_l"
712866
 # eliminate IFS hackery when messing with fw_dir
712866
 fw_dir=${fw_dir//:/ }
712866