dracut/0139-dracut.sh-check-for-logfile-logfile-option-and-creat.patch
Thomas Renninger 9fd4bf22aa Accepting request 245581 from home:trenn:branches:Base:System
- dracut.sh: check for logfile (--logfile option) and create it if necessary
  Add 0139-dracut.sh-check-for-logfile-logfile-option-and-creat.patch
- Avoid duplicate names in host_devs
  Add 0140-dracut.sh-Avoid-duplicate-devices-in-host_devs.patch
- iscsi: Avoid bad ip route call on empty address
  Add 0141-iscsi-Avoid-bad-ip-route-call-on-empty-address.patch
- 40network: Don't report error for .../ifroute-* during module setup
  Add 0142-40network-Don-t-report-error-for-etc-sysconfig-netwo.patch
- iscsi: Fix up ipv6 in brackets , iterate over all needed iscsi mounts
  Add 0143-iscsi-Fix-up-ipv6-in-brackets-iterate-over-all-possi.patch
- 90crypt: Fixed crypttab_contains() to also work with device in /etc/crypttab
  Add 0144-90crypt-Fixed-crypttab_contains-to-also-work-with-de.patch
- 40network: handle 'ip=ifname:static' correctly (bnc#892801)
  Add 0145-40network-handle-ip-ifname-static-correctly.patch

OBS-URL: https://build.opensuse.org/request/show/245581
OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=180
2014-08-21 12:50:20 +00:00

36 lines
1.0 KiB
Diff

From 449f9a748229f78844861194187ee36a4cccd7f2 Mon Sep 17 00:00:00 2001
From: jloeser <jloeser@suse.de>
Date: Mon, 18 Aug 2014 16:19:54 +0200
Subject: dracut.sh: check for logfile (--logfile option) and create it if
necessary
If a logfile is passed to dracut via --logfile option and doesn't
exist, dracut doesn't create it and logs nothing. Instead, dracut
should try to touch the file and print a warning if creating fails.
References: bnc#892191
---
dracut.sh | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/dracut.sh b/dracut.sh
index 92b30bb..ffe4989 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -803,6 +803,12 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
# eliminate IFS hackery when messing with fw_dir
fw_dir=${fw_dir//:/ }
+if [[ ! -f $logfile ]];then
+ if [[ ! `touch $logfile > /dev/null 2>&1` ]];then
+ printf "%s\n" "dracut: touch $logfile failed. Couldn't create logfile."
+ fi
+fi
+
# handle compression options.
[[ $compress ]] || compress="gzip"
case $compress in
--
1.8.4.5