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