Hi Lichen,
On Tue, 1 Mar 2022 13:09:00 +0800
Lichen Liu <lichliu(a)redhat.com> wrote:
There is a system-wide sync call at the end of mkdumprd, move it to
kdumpctl after rebuild initrd and add another one for mkfadumprd.
Sync only the $TARGET_INITRD to avoid a system-wide sync taking too
long on a system with high disk activity.
Also update the sync in kdumpctl:restore_default_initrd which will
mv the $DEFAULT_INITRD_BAK to $DEFAULT_INITRD.
Signed-off-by: Lichen Liu <lichliu(a)redhat.com>
looks good. Thanks!
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
---
kdumpctl | 4 +++-
mkdumprd | 4 ----
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/kdumpctl b/kdumpctl
index 9fd76ac..8ad47bf 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -79,6 +79,7 @@ rebuild_fadump_initrd()
return 1
fi
+ sync -f "$TARGET_INITRD"
return 0
}
@@ -100,6 +101,7 @@ rebuild_kdump_initrd()
dwarn "Tips: If early kdump is enabled, also require rebuilding the system
initramfs to make the changes take effect for early kdump."
fi
+ sync -f "$TARGET_INITRD"
return 0
}
@@ -180,7 +182,7 @@ restore_default_initrd()
rm -f $INITRD_CHECKSUM_LOCATION
if mv "$DEFAULT_INITRD_BAK" "$DEFAULT_INITRD"; then
derror "Restoring original initrd as fadump mode is disabled."
- sync
+ sync -f "$DEFAULT_INITRD"
fi
fi
fi
diff --git a/mkdumprd b/mkdumprd
index 593ec77..5996d50 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -458,7 +458,3 @@ if ! is_fadump_capable; then
fi
dracut "${dracut_args[@]}" "$@"
-
-_rc=$?
-sync
-exit $_rc