dracut/0097-Implement-rd.timeout-to-modify-the-device-timeout.patch
Robert Milasan 45edee9f69 Accepting request 239538 from home:hreinecke:branches:Base:System
- 90btrfs: Install rescue utilities to initrd
  * Add: 0100-btrfs-add-initrd-rescue-utilities.patch

- 40network: create /var/lib/wicked in ifup.sh (bnc#885141)
  * Add: 0089-40network-create-var-lib-wicked-in-ifup.sh.patch
- dracut: caps: Remove whole caps module
  * Add: 0090-dracut-caps-Remove-whole-caps-module.patch
- dracut: biosdevname: Only install if present
  * Add: 0091-dracut-biosdevname-In-SUSE-biosdevname-package-is-in.patch
- dracut: nbd: Only complain of missing binary in hostonly mode
  if rootfs is on nbd
  * Add: 0092-dracut-nbd-Only-complain-of-missing-binary-in-hoston.patch
- 95iscsi: generate commandline for software iscsi (bnc#880108)
  * Add: 0093-95iscsi-generate-commandline-for-software-iscsi.patch
- Implement shortcut 'ip=<ifname>:static' for static configuration
  * Add: 0094-Implement-shortcut-ip-ifname-static-for-static-confi.patch
- 95iscsi: use static configuration for software iscsi (bnc#884768)
  * Add: 0095-95iscsi-use-static-configuration-for-software-iscsi.patch
- dracut: Fix error: local: can only be used in a function
  * Add: 0096-dracut-Fix-error-local-can-only-be-used-in-a-functio.patch
- Implement 'rd.timeout' to modify the device timeout (bnc#878770)
  * Add: 0097-Implement-rd.timeout-to-modify-the-device-timeout.patch
- Do not call 'lvm' for non-LVM device-mapper devices
  * Add: 0098-Do-not-call-lvm-for-non-LVM-device-mapper-devices.patch
- 90multipath: Load device_handler modules early during boot (bnc#871617)
  * Add: 0099-90multipath-Load-device_handler-modules-early-during.patch

OBS-URL: https://build.opensuse.org/request/show/239538
OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=168
2014-07-05 21:13:32 +00:00

107 lines
3.5 KiB
Diff

From 59be707744473b82f2ae6d14a159fbf94834d4b6 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Thu, 3 Jul 2014 11:21:29 +0200
Subject: Implement 'rd.timeout' to modify the device timeout
When generating units for devices the administrator might
want to use a different timeout than the default.
So implement a new parameter 'rd.timeout' for this.
References: bnc#878770
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
dracut.cmdline.7.asc | 7 ++++++-
modules.d/98systemd/rootfs-generator.sh | 7 +++++--
modules.d/99base/dracut-lib.sh | 6 +++++-
3 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc
index 84fe794..2dc795b 100644
--- a/dracut.cmdline.7.asc
+++ b/dracut.cmdline.7.asc
@@ -117,11 +117,16 @@ Misc
have been loaded. This parameter can be specified multiple times.
**rd.retry=**__<seconds>__::
- specify how long dracut should wait for devices to appear.
+ specify how long dracut should retry the initqueue to configure devices.
The default is 30 seconds. After 2/3 of the time, degraded raids are force
started. If you have hardware, which takes a very long time to announce its
drives, you might want to extend this value.
+**rd.timeout=**__<seconds>__::
+ specify how long dracut should wait for devices to appear. The
+ default is '0', which means 'forever'. Note that this timeout
+ should be longer than rd.retry to allow for proper configuration.
+
**rd.noverifyssl**::
accept self-signed certificates for ssl downloads.
diff --git a/modules.d/98systemd/rootfs-generator.sh b/modules.d/98systemd/rootfs-generator.sh
index 2c09895..a2b71ff 100755
--- a/modules.d/98systemd/rootfs-generator.sh
+++ b/modules.d/98systemd/rootfs-generator.sh
@@ -7,8 +7,11 @@ type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
generator_wait_for_dev()
{
local _name
+ local _timeout
_name="$(str_replace "$1" '/' '\x2f')"
+ _timeout=$(getarg rd.timeout)
+ _timeout=${_timeout:-0}
[ -e "$hookdir/initqueue/finished/devexists-${_name}.sh" ] && return 0
@@ -29,7 +32,7 @@ generator_wait_for_dev()
mkdir -p /run/systemd/generator/${_name}.device.d
{
echo "[Unit]"
- echo "JobTimeoutSec=0"
+ echo "JobTimeoutSec=$_timeout"
} > /run/systemd/generator/${_name}.device.d/timeout.conf
fi
}
@@ -60,6 +63,6 @@ case "$root" in
rootok=1 ;;
esac
-[ "${root%%:*}" = "block" ] && generator_wait_for_dev "${root#block:}"
+[ "${root%%:*}" = "block" ] && generator_wait_for_dev "${root#block:}" "$RDRETRY"
exit 0
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index 33f7678..5a867b8 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -876,12 +876,16 @@ wait_for_dev()
local _name
local _needreload
local _noreload
+ local _timeout
if [ "$1" = "-n" ]; then
_noreload=1
shift
fi
+ _timeout=$(getarg rd.timeout)
+ _timeout=${_timeout:-0}
+
_name="$(str_replace "$1" '/' '\x2f')"
[ -e "${PREFIX}$hookdir/initqueue/finished/devexists-${_name}.sh" ] && return 0
@@ -905,7 +909,7 @@ wait_for_dev()
mkdir -p ${PREFIX}/etc/systemd/system/${_name}.device.d
{
echo "[Unit]"
- echo "JobTimeoutSec=0"
+ echo "JobTimeoutSec=$_timeout"
} > ${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf
_needreload=1
fi
--
1.8.4.5