From ee4114d07ab6b5068ad3ed802ec357d0bcc0c5b2 Mon Sep 17 00:00:00 2001 From: Ilya Smirnov Date: Wed, 22 Feb 2017 23:41:48 -0600 Subject: Modify eSEL script to take input files with eSEL data The eSEL.pl can now be run with different options. The options are: get_ami_data - just fetch AMI eSEL data into a binary file, don't do any processing; decode_ami_data (takes a file) - parse AMI eSEL binary file; get_and_decode_ami - does both of the above; decode_obmc_data (takes a file) - parses the OpenBmc eSEL file. Change-Id: Ib226b6e12cff1ca805aed909ad647d33d1016ff3 RTC:166211 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36896 Reviewed-by: Stephen M. Cprek Tested-by: Jenkins Server Reviewed-by: Andrew J. Geissler Tested-by: Jenkins OP Build CI Tested-by: FSP CI Jenkins Reviewed-by: William G. Hoffa Reviewed-by: Daniel M. Crowell --- src/build/debug/eSEL.pl | 650 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 650 insertions(+) create mode 100755 src/build/debug/eSEL.pl (limited to 'src/build/debug/eSEL.pl') diff --git a/src/build/debug/eSEL.pl b/src/build/debug/eSEL.pl new file mode 100755 index 000000000..c8c9723d1 --- /dev/null +++ b/src/build/debug/eSEL.pl @@ -0,0 +1,650 @@ +#!/usr/bin/perl +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/build/debug/eSEL.pl $ +# +# OpenPOWER HostBoot Project +# +# Contributors Listed Below - COPYRIGHT 2017 +# [+] International Business Machines Corp. +# +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. See the License for the specific language governing +# permissions and limitations under the License. +# +# IBM_PROLOG_END_TAG +use strict; +use Cwd; +use POSIX; +use Switch; +use Getopt::Long; +use File::Basename; +use Data::Dumper; + +use constant ESEL_HEADER_LENGTH => 16; + +# options and usage +my $target = ''; # Target BMC name / IP (convert to IP) +my $userid = 'ADMIN'; # BMC user id to use for the ipmitool cmd +my $passwd = 'admin'; # BMC password to use for the ipmitool cmd +my $dirname = dirname(__FILE__); +my $errl_path = $dirname; +my $fspt_path = $dirname; +my $img_path = $dirname; +my $output_path = cwd(); +my $debug = 0; +my $usage = 0; +my $version = "201702221413"; +my $option = ""; +my $esel_file = ""; +my $bad_option = 0; + +my %options_table = ( + get_ami_data => 0, + decode_ami_data => 0, + get_and_decode_ami => 0, + decode_obmc_data => 0, + decode_hberrl_data => 0 +); + +sub printUsage +{ + print "All directory paths passed as arguments to the tool MUST be Fully qualified path names.\n"; + print "Usage: eSEL_ami.pl [-h] -t [-U ] [-P ]\n"; + print " [-o ] # default: $output_path\n"; + print " [-e ] # default: $errl_path(*) \n"; + print " [-f ] # default $fspt_path(*)\n"; + print " [-i ] # default $img_path(*)\n"; + print " [-l ]\n"; + print " [-p