From 430d4b801c337acddae4564503808680ceb71ab7 Mon Sep 17 00:00:00 2001 From: Olivier Singla <47356901+olivier-singla@users.noreply.github.com> Date: Fri, 10 May 2019 01:47:15 -0400 Subject: [PATCH] decode-syseeprom : added new option to show the Product Name. (#496) Added a new option -p to display the Product Name. --- scripts/decode-syseeprom | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/decode-syseeprom b/scripts/decode-syseeprom index ffa50ce24f5e..8121fe787910 100755 --- a/scripts/decode-syseeprom +++ b/scripts/decode-syseeprom @@ -70,6 +70,8 @@ def get_cmdline_opts(): default=False, help="print eeprom from database") optcfg.add_option("-s", dest="serial", action="store_true", default=False, help="print device serial number/service tag") + optcfg.add_option("-p", dest="modelstr", action="store_true", default=False, + help="print the device product name") optcfg.add_option("-m", dest="mgmtmac", action="store_true", default=False, help="print the base mac address for management interfaces") optcfg.add_option("--init", dest="init", action="store_true", default=False, @@ -138,6 +140,10 @@ def run(target, opts, args, support_eeprom_db): print e else: print serial or "Undefined." + elif opts.modelstr: + mm = target.modelstr(e) + if mm != None: + print mm else: target.decode_eeprom(e) (is_valid, valid_crc) = target.is_checksum_valid(e)