From 7f029dcd7dca52395f38f22c2e7a8f97381c9253 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Sun, 12 Oct 2008 20:33:11 +0000 Subject: [PATCH] -Add more careful treatment of FRU rewrite git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2325 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/ipmi.pm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 02afc72a3..a1f3a5c4d 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -2711,15 +2711,25 @@ sub writefru { } my $frusize=($bytes[2]<<8)+$bytes[1]; ($error,@bytes) = frudump(0,$frusize,16); + if ($error) { + return (1,"Error retrieving FRU: ".$error); + } my $fruhash; ($error,$fruhash) = parsefru(\@bytes); my $newfru=formfru($fruhash,$frusize); unless ($newfru) { return (1,"FRU data will not fit in BMC FRU space, fields too long"); } - my $rc; + my $rc=1; + my $writeattempts=0; my $text; - ($rc,$text) = fruwrite(0,$newfru,8); + while ($rc and $writeattempts<15) { + if ($writeattempts) { + sleep 1; + } + ($rc,$text) = fruwrite(0,$newfru,8); + $writeattempts++; + } if($rc) { return($rc,$text); }