From 7b5bf4758b034e4b12c20f3f99d09677678a3fa4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= <nabijaczleweli@nabijaczleweli.xyz>
Date: Fri, 28 May 2021 13:55:12 +0200
Subject: [PATCH] i-t: let rootdelay= set $ZFS_INITRD_PRE_MOUNTROOT_SLEEP
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia ZiemiaƄska <nabijaczleweli@nabijaczleweli.xyz>
Ref: https://github.com/openzfs/zfs/issues/11420#issuecomment-850338673
Closes #11663
Closes #12148
---
 contrib/initramfs/scripts/zfs | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/contrib/initramfs/scripts/zfs b/contrib/initramfs/scripts/zfs
index d74b2062ad..701e45e67b 100644
--- a/contrib/initramfs/scripts/zfs
+++ b/contrib/initramfs/scripts/zfs
@@ -273,6 +273,8 @@ import_pool()
 # with more logging etc.
 load_module_initrd()
 {
+	[ -n "$ROOTDELAY" ] && ZFS_INITRD_PRE_MOUNTROOT_SLEEP="$ROOTDELAY"
+
 	if [ "$ZFS_INITRD_PRE_MOUNTROOT_SLEEP" -gt 0 ] 2>/dev/null
 	then
 		if [ "$quiet" != "y" ]; then