From fb01e8e151dc78b81563be11265b27350b5f0ead Mon Sep 17 00:00:00 2001 From: lissav Date: Tue, 28 May 2013 13:52:39 +0000 Subject: [PATCH] use NODE name defined in /opt/xcat/xcatinfo file, if there git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16433 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT/postscripts/xcatdsklspost | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index c55e0ee9f..1907c2bad 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -244,6 +244,26 @@ if [ "$MODE" = "4" ]; then # for statelite mode else # for common mode MODE=1,2,3,5 (updatenode,moncfg,node deployment) # non-Statelite MODE + # If we have written the NODE info into the kernel command line, + # put in in xcatinfo + if [ ! -f /opt/xcat/xcatinfo ]; then + mkdir -p /opt/xcat + touch /opt/xcat/xcatinfo + fi + for i in `cat /proc/cmdline`; do + KEY=`echo $i | awk -F= '{print $1}'` + if [ "$KEY" = "NODE" ]; then + NODE=`echo $i | awk -F= '{print $2}'` + break + fi + done + grep 'NODE' /opt/xcat/xcatinfo 2>&1 > /dev/null + if [ $? -eq 0 ]; then + sed -i "s/NODE=.*/NODE=$NODE/" /opt/xcat/xcatinfo + else + echo "NODE=$NODE" >> /opt/xcat/xcatinfo + fi + downloaded=0; # have not downloaded the postscripts # try the -m/-M input (P_SIP) if it is specified, # -m/-M is passed in the updatenode command