From 452134db27e220e0ef5bb1e5665abf1ea34e99e2 Mon Sep 17 00:00:00 2001 From: xq2005 Date: Mon, 26 Mar 2012 08:39:51 +0000 Subject: [PATCH] support kdump on sles in enablekdump git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12001 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT/postscripts/enablekdump | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/xCAT/postscripts/enablekdump b/xCAT/postscripts/enablekdump index 9d8c35fac..5a42003b3 100755 --- a/xCAT/postscripts/enablekdump +++ b/xCAT/postscripts/enablekdump @@ -4,6 +4,15 @@ # # create /etc/sysconfig/network-scripts/ +pmatch () +{ + case $1 in + $2) return 0;; # zero return code means string matched by pattern + esac + + return 1 # non-zero return code means string not matched by pattern +} + for i in `/bin/cat /proc/cmdline`; do KEY=`/bin/echo $i | /bin/awk -F= '{print $1}'` if [ "$KEY" = "ifname" ]; then @@ -62,15 +71,21 @@ if [ ! -z "$DUMP" ]; then KDIP=${XCAT%:*} fi - if [ "$KDPROTO" = "nfs" ]; then - echo "net $KDIP:$KDPATH" > /etc/kdump.conf - fi - # workaround for RHEL6 # the $KDIP:$KDPATH directory will be used to generate the initrd for kdump service /bin/mount $KDIP:$KDPATH /var/tmp - /etc/init.d/kdump restart + if [ "$KDPROTO" = "nfs" ]; then + if (pmatch $OSVER "sles*") || (pmatch $OSVER "suse*") || [ -f /etc/SuSE-release ]; then + echo "$DUMP" > /etc/sysconfig/kdump; + /etc/init.d/boot.kdump restart + else + if (pmatch $OSVER "fedora*") || (pmatch $OSVER "rhel6*") || (pmatch $OSVER "rhels6*") || [ -f /etc/fedora-release ] || [ -f /etc/redhat-release ];then + echo "net $KDIP:$KDPATH" > /etc/kdump.conf + /etc/init.d/kdump restart + fi + fi + fi /bin/umount /var/tmp else