On Tue, Apr 29, 2014 at 07:27:49PM +0530, Hari Bathini wrote:
During service kdump stop, if firmware assisted dump is enabled
and running, then stop firmware assisted dump by echo'ing 0 to
'/sys/kernel/fadump_registered' file.
Signed-off-by: Mahesh Salgaonkar <mahesh(a)linux.vnet.ibm.com>
Signed-off-by: Hari Bathini <hbathini(a)linux.vnet.ibm.com>
---
kdumpctl | 39 +++++++++++++++++++++++++++++++++------
1 file changed, 33 insertions(+), 6 deletions(-)
diff --git a/kdumpctl b/kdumpctl
index ae17c3b..efd77ce 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -723,18 +723,45 @@ function start()
echo "Starting kdump: [OK]"
}
-function stop()
+stop_fadump()
+{
+ check_current_fadump_status && echo 0 > $FADUMP_REGISTER_SYS_NODE
Do we have to check current status of fadump. Can't we unditionally
write 0 to $FADUMP_REGISTER_SYS_NODE?
+ if check_current_fadump_status; then
+ echo "fadump: failed to un-register"
+ return 1
+ fi
+
+ echo "fadump: un-registered successfully"
+ return 0
+}
+
+stop_kdump()
{
$KEXEC -p -u 2>/dev/null
- if [ $? == 0 ]; then
- echo "kexec: unloaded kdump kernel"
- echo "Stopping kdump: [OK]"
- return 0
- else
+ if [ $? != 0 ]; then
echo "kexec: failed to unloaded kdump kernel"
^^^^^
Typo in original code. Should be "unload" instead of "unloaded".
Would
you mind sending a one line fix for this separately.
Thanks
Vivek