Blame SOURCES/0424-add-rd.device.timeout-seconds-parameter.patch

18971c
From ca46c751d1becbbff68c561bfbc9ee36182fcc38 Mon Sep 17 00:00:00 2001
18971c
From: Harald Hoyer <harald@redhat.com>
18971c
Date: Thu, 30 Jun 2016 15:24:54 +0200
18971c
Subject: [PATCH] add rd.device.timeout=<seconds> parameter
18971c
18971c
---
18971c
 modules.d/98systemd/rootfs-generator.sh | 4 +++-
18971c
 modules.d/99base/dracut-lib.sh          | 4 +++-
18971c
 2 files changed, 6 insertions(+), 2 deletions(-)
18971c
18971c
diff --git a/modules.d/98systemd/rootfs-generator.sh b/modules.d/98systemd/rootfs-generator.sh
18971c
index 2c098951..a7bffdfd 100755
18971c
--- a/modules.d/98systemd/rootfs-generator.sh
18971c
+++ b/modules.d/98systemd/rootfs-generator.sh
18971c
@@ -7,6 +7,7 @@ type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
18971c
 generator_wait_for_dev()
18971c
 {
18971c
     local _name
18971c
+    local _timeout
18971c
 
18971c
     _name="$(str_replace "$1" '/' '\x2f')"
18971c
 
18971c
@@ -26,10 +27,11 @@ generator_wait_for_dev()
18971c
     fi
18971c
 
18971c
     if ! [ -f /run/systemd/generator/${_name}.device.d/timeout.conf ]; then
18971c
+        _timeout=$(getarg rd.device.timeout || printf "0")
18971c
         mkdir -p /run/systemd/generator/${_name}.device.d
18971c
         {
18971c
             echo "[Unit]"
18971c
-            echo "JobTimeoutSec=0"
18971c
+            echo "JobTimeoutSec=$_timeout"
18971c
         } > /run/systemd/generator/${_name}.device.d/timeout.conf
18971c
     fi
18971c
 }
18971c
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
18971c
index c2b6108a..16bc74d4 100755
18971c
--- a/modules.d/99base/dracut-lib.sh
18971c
+++ b/modules.d/99base/dracut-lib.sh
18971c
@@ -887,6 +887,7 @@ wait_for_dev()
18971c
     local _name
18971c
     local _needreload
18971c
     local _noreload
18971c
+    local _timeout
18971c
 
18971c
     if [ "$1" = "-n" ]; then
18971c
         _noreload=1
18971c
@@ -913,10 +914,11 @@ wait_for_dev()
18971c
         fi
18971c
 
18971c
         if ! [ -f ${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf ]; then
18971c
+            _timeout=$(getarg rd.device.timeout || printf "0")
18971c
             mkdir -p ${PREFIX}/etc/systemd/system/${_name}.device.d
18971c
             {
18971c
                 echo "[Unit]"
18971c
-                echo "JobTimeoutSec=0"
18971c
+                echo "JobTimeoutSec=$_timeout"
18971c
             } > ${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf
18971c
             _needreload=1
18971c
         fi