6edea0
From 34ef33adfbb0b44ba6143f4ced206f948d814f86 Mon Sep 17 00:00:00 2001
6edea0
From: Kairui Song <kasong@redhat.com>
6edea0
Date: Wed, 27 May 2020 22:07:37 +0800
6edea0
Subject: [PATCH] 99memstrack: hook script should not call exit
6edea0
6edea0
With memstrack module, rd.break may not work because the hook scripts
6edea0
are sourced, not executed, so the exit call will make pre-pivot queue
6edea0
exit early. See 98dracut-systemd/dracut-pre-pivot.sh, everything after
6edea0
"source_hook cleanup" will be ignored.
6edea0
6edea0
Replace with return instead.
6edea0
6edea0
Credits go to Lukas Nykryn <lnykryn@redhat.com> who helped discover and
6edea0
debug this issue.
6edea0
6edea0
Signed-off-by: Kairui Song <kasong@redhat.com>
6edea0
(cherry picked from commit 424f01e2a0ac0b329e68eb63048cf0d6d9c74d37)
6edea0
6edea0
Resolves: #1829528
6edea0
---
6edea0
 modules.d/99memstrack/memstrack-report.sh | 2 +-
6edea0
 1 file changed, 1 insertion(+), 1 deletion(-)
6edea0
6edea0
diff --git a/modules.d/99memstrack/memstrack-report.sh b/modules.d/99memstrack/memstrack-report.sh
6edea0
index 241e8621..3de55bd1 100755
6edea0
--- a/modules.d/99memstrack/memstrack-report.sh
6edea0
+++ b/modules.d/99memstrack/memstrack-report.sh
6edea0
@@ -2,7 +2,7 @@
6edea0
 . /lib/dracut-lib.sh
6edea0
 
6edea0
 if ! [ "$DEBUG_MEM_LEVEL" -ge 4 ]; then
6edea0
-    exit 0
6edea0
+    return 0
6edea0
 fi
6edea0
 
6edea0
 if type -P systemctl >/dev/null; then
6edea0