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