Policy on Tools Posting

Wilfred Smith wilfredsmith at fb.com
Thu Aug 15 06:48:09 AEST 2019


> 
> Are there descriptions and example usage documented anywhere? That
> would probably help us sort out what the possibilities are.



The mailing list strips attachments and images, so here’s text from the document I’ve been building for them. I’m still working on sensor-util. 

Once you’ve mulled it over, please let me know where I should put these.

FWIW, I think there will be a few more of these in the near future. They’re designed to be a single-executable (like Busybox) such that NV storage is minimized. There are build options for BZip’ed online help prose and bash completion.

Thanks,

Wilfred

---------------------------------------------
Overview: fruid-util

[img]

fruid-util is a Facebook-originated utility for OpenBMC. It runs on the server’s BMC and allows display of the FRU information for the components of the containing server. The FRU information is typically stored in a non-volatile memory (i.e. EEPROM, NOR/NAND flash, SPI) part within the component.

This utility exclusively reads information that has been made available through the BMC’s D-Bus service named “xyz.openbmc_project.FruDevice”. The FruDevice service may expose multiple objects, each representing a server component. Each of those server component objects exposes some number of properties as key-value pairs. For example, a “motherboard” component” may have its CPU type as a FRU property.

The previous version of this utility allowed the display of the properties for a component when its name was specified. Unfortunately, those names do not always map directly to the name of a server component object. For example, the object name for the motherboard may be “Tioga_Pass_Single_Side”. A mapping file may be specified, allowing the legacy keywords to be mapped to one or more object names based on a regular expression. 

The utility also allows probing for the presence of component object names and property key names with string comparisons accomplished by normal shell features.

Usage

fruid-util [—version] | [—mapFile pathToMapFile] [—perl] [ [—component ] componentexpr] [—property propertyexpr]
 

Exit codes

[img]


Map File Format

The mapping file is a UTF-8 text file containing one or more mapping lines, each terminated by a C standard newline sequence (e.g. CRLF).

Each mapping line consists of a keyword, followed by optional whitespace, an equals sign (‘=‘),optional whitespace and a regular expression that matches the desired component object names. 

If any line begins with a ‘#’ in column 1, it will be ignored and treated as a comment line

Example Output

To the extent reasonable and possible, output matches that of the original fruid-util utility. No attempt is made to generate FRU properties that are unavailable through the FRUDevice service.

fruid-util 

FRU Information					    : Tioga_Pass_Single_Side
———————————————					    : —————————
Address				   		    : 84
Board_Info_AM1					    : 02-000243
Board_Info_AM2					    : LBG-1G
Board_Language_Code				    : 0
Board_Manufacturer				    : Wistro
Board_Manufacture_Date          			: Fri Aug 25 19:17:00 2017
Board_Part_Number               			: B81.00X10.0109
Board_Product_Name						: Tioga Pass Single Side
Board_Serial_Number						: WTH1734038ZSA
Bus										: 6
Chassis_Info_AM1							: M7MX546700026
Chassis_Info_AM2							: _71C9N5700774
Chassis_Part_Number						: B81.00X01.0104
Chassis_Serial_Number						: WTF17370D2MA1
Chassis_Type								: 23
Common_Format_Version						: 1
Product_Asset_Tag						: 3718452
Product_Info_AM1							: 01-002572
Product_Info_AM2							: 1505546857
Product_Language_Code						: 0
Product_Manufacturer						: Wiwynn
Product_Part_Number						: B81.00X01.0104
Product_Product_Name						: Type6 Tioga Pass Single Side
Product_Serial_Number						: WTF17370D2MA1
Product_Version							: PVT

Function Call
Other utilities built on this platform may access this functionality by way of a C function call. The results of the query are written to stdout and are identical to the command line results.

exitCode <- fruidUtil( std::string& componentExpr, std::string& propertyExpr, std::string& mapPath, bool bPerlRegEx = false ); 

Overview: ipmb-util

Ipmb-util allows an IPMB (IPMI bridged) command to be sent to a target with the response written to stdout. 
[img]
Usage

Ipmb-util bus address netfn cmdID [b1 … bn] [—retries = n ] [ —timeout = ms ]
Ipmb-util bus address —file cmdPath [—retries = n ] [ —timeout = ms ]

where:
	bus and address specify the destination for the message
	netfn specifies the net function in hex (e.g. 18 for NetFn 06/LUN 00)
	cmdID specifies the command to be sent (e.g. 01 for GET DEVICE ID)
	retries specifies the number of times the command will be retried, default is 5
	timeout is the maximum delay for a response in milliseconds (default is 3 seconds)
	b1…bn are byte arguments for the command, specified as 2 hex digits per byte with whitespace between bytes

Command File Format
[img]
If a cmdPath is specified, each line of the command file contains 
	netfn cmdID [b1…bn]

where:
	netfn specifies the net function in hex (e.g. 18 for NetFn 06/LUN 00)
	cmdID specifies the command to be sent (e.g. 01 for GET DEVICE ID)
	b1…bn are byte arguments for the command, specified as 2 hex digits per byte with whitespace between bytes

Exit Codes

[img]


Function Call

Other utilities built on this platform may access this functionality by way of a C function call. The results of the query are written to stdout and are identical to the command line results.

exitCode <- ipmbUtil( Byte bus, Byte address, Byte cmdID, std::vector<Byte> abyArgs, unsigned int retryCount = 5, unsigned long timeoutInMs = 3000 );

exitCode <- ipmbUtil( Byte bus, Byte address,std::string& aCmdPath, unsigned int retryCount = 5, unsigned long timeoutInMs = 3000 );

Example Output


[img]

OK 03 02 01 05 10





More information about the openbmc mailing list