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