From 7d1196bd80bf6dc97050045e8df767bd648ae38d Mon Sep 17 00:00:00 2001 From: wanghuaz Date: Wed, 10 Aug 2011 05:28:53 +0000 Subject: [PATCH] Fixed the issue that setbootfromdisk cannot handle the multipath without raid. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10252 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT/postscripts/setbootfromdisk | 34 +++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/xCAT/postscripts/setbootfromdisk b/xCAT/postscripts/setbootfromdisk index 35cee4557..e8d2424bd 100755 --- a/xCAT/postscripts/setbootfromdisk +++ b/xCAT/postscripts/setbootfromdisk @@ -48,8 +48,40 @@ if [[ $OS = "Linux" ]]; then exit 0 fi - if echo $MPATH | grep "sda" + if echo $BOOTDEVICE | grep "mpath" then + found=0 + for i in $MPATH + do + if echo $BOOTDEVICE | grep "$i" + then + found=1 + else + if echo $i | grep "mpath" + then + found=0 + fi + fi + + if [[ $found = 1 ]] + then + if echo $i | grep "sda" + then + logger -t xcat setbootfromdisk: Setting sda sdb to be the default bootup device + echo "setbootfromdisk: setting up sda sdb to be the default bootup device" + bootlist -m normal sda sdb + exit 0 + elif echo $i | grep "sdc" + then + logger -t xcat setbootfromdisk: Setting sdc sdd to be the default bootup device + echo "setbootfromdisk: setting up sdc sdd to be the default bootup device" + bootlist -m normal sdc sdd + exit 0 + fi + fi + done + + if echo $MPATH | grep "sdb" then logger -t xcat setbootfromdisk: Setting sda sdb to be the default bootup device