kdumpctl: sync the $TARGET_INITRD after rebuild
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@redhat.com> Reviewed-by: Philipp Rudo <prudo@redhat.com>
This commit is contained in:
parent
6d4062a936
commit
7141d044c8
4
kdumpctl
4
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
|
||||
|
Loading…
Reference in New Issue
Block a user