Policy on Tools Posting
1. Are there guidelines/procedures specific to submitting command line tools and utilities? I have heard that there may be a repository and/or path dedicated to CLI tools.
2. The specific tools I’m concerned with at the moment are a D-Bus enabled version of fruid-util, ipmb-util and sensor-util as they currently exist in the facebook/openbmc repository. Nothing to write home about. I’ve removed anything Facebook-specific.
3. I presume the correct course of action is to submit Gerrit patches for layers under meta-facebook unless instructed otherwise.
Thanks in advance,
Wilfred
Hi Wilfred,
Quoted 4 lines · Wilfred Smith
1. Are there guidelines/procedures specific to submitting command line tools and utilities? I have heard that there may be a repository and/or path dedicated to CLI tools.
There's not much in the way of commandline tools that are dedicated to OpenBMC right now. The obvious one is obmcutil, but that lives in the phosphor-state-manager repository which isn't really a spot to add other assorted tools.
At a real stretch we could put things in openbmc-tools[1], though that's not really intended for production code, more-so helpers for development and debugging.
[1] https://github.com/openbmc/openbmc-tools
Quoted 3 lines
2. The specific tools I’m concerned with at the moment are a D-Bus enabled version of fruid-util
Maybe this could go in phosphor-inventory-manager?
Quoted 1 line
, ipmb-util
Not really sure where we might put ipmb-util
Quoted 1 line
and sensor-util
Maybe phosphor-hwmon? Not really sure, just putting out some straw-person suggestions.
Are there descriptions and example usage documented anywhere? That would probably help us sort out what the possibilities are.
Quoted 4 lines
as they
currently exist in the facebook/openbmc repository. Nothing to write
home about. I’ve removed anything Facebook-specific.
I guess at this point it just depends on whether you think they would or could be widely adopted.
Quoted 3 lines
3. I presume the correct course of action is to submit Gerrit patches for layers under meta-facebook unless instructed otherwise.
You're talking about the recipes here rather than the actual tools? Or are you proposing putting the source for the tools in meta-facebook? In general we've tried to avoid that.
Cheers,
Andrew
Quoted 3 lines
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 : 84Board_Info_AM1 : 02-000243Board_Info_AM2 : LBG-1GBoard_Language_Code : 0Board_Manufacturer : WistroBoard_Manufacture_Date : Fri Aug 25 19:17:00 2017Board_Part_Number : B81.00X10.0109Board_Product_Name : Tioga Pass Single SideBoard_Serial_Number : WTH1734038ZSA
Bus : 6Chassis_Info_AM1 : M7MX546700026Chassis_Info_AM2 : _71C9N5700774Chassis_Part_Number : B81.00X01.0104Chassis_Serial_Number : WTF17370D2MA1Chassis_Type : 23Common_Format_Version : 1Product_Asset_Tag : 3718452Product_Info_AM1 : 01-002572Product_Info_AM2 : 1505546857Product_Language_Code : 0Product_Manufacturer : WiwynnProduct_Part_Number : B81.00X01.0104Product_Product_Name : Type6 Tioga Pass Single SideProduct_Serial_Number : WTF17370D2MA1Product_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
Quoted 3 lines · Wilfred Smith
1. Are there guidelines/procedures specific to submitting command line tools and utilities? I have heard that there may be a repository and/or path dedicated to CLI tools.
The community has definitely tended to limit wrapper tools within OpenBMC. We had a discussion a while back that we're open to some but the API's to them really need to be thought out and reviewed because command line tools become customer API's (i.e. people start writing scripts on top of these tools that then become key to the manufacturing process or some other critical area).
Anything that goes into OpenBMC needs to support OpenBMC interfaces. For example, I'm not familiar with fruid-util's D-bus service xyz.openbmc_project.FruDevice. A "busctl tree xyz.openbmc_project.Inventory.Manager | cat" shows the inventory items on OpenBMC.
One issue we have within OpenBMC is there may be different implementations of the D-bus API's for a given area. For example, Inventory has different implementations so I'm not sure which repo would best fit your tool. That type of issue leads me to wonder if we should put the tools with the interface definitions in openbmc/phosphor-dbus-interfaces? Or maybe a separate phosphor-tools repo would be more logical for these.
Either way, I think command line tools should each get their own mini-design doc
(https://github.com/openbmc/docs/blob/master/designs/design-template.md)
with requirements and interfaces clearly defined for review by the community. If we can find a generic tool that multiple people find useful, we can then find a place to put it. Otherwise, you could host your tools outside of openbmc/ github and just pull them into recipes from within your meta-facebook layer.
Quoted 3 lines
Thanks in advance,
Wilfred
To what extent Is this an actionable “ruling” vs “thoughts on the matter.”
While large vendors can easily assign someone to create utilities like these, won’t less well staffed vendors be served by having a collection of utilities to choose from? If nothing else, I would think just having the examples available for their adaptation adds significant value. Should everyone need to write their own utility to send a message to ME?
Isn’t FruDevice a well-adopted interface? IpmbBridge?
I suppose I’m unclear on the project audience, so please guide me. Are we providing hobbyist parts that a billion-dollar enterprise with person-hours to burn can use to create a production system or a near-complete solution that requires a few days of “roughing in” and customization by a three-person team in East Canberra? Is OpenBMC more minimalist “Alpine Linux” or fully loaded, ready-to-go “Ubuntu”?
What’s the dividing line between “Core OpenBMC” and “stuff you need to find or build yourself” where the OpenBMC community is aware, but hands-off?
Pardon me if there’s a document somewhere that states this, in which case a link would be appreciated.
Is the safest bet for the moment to follow your mini-design doc path and host in Facebook’s public Github as described in your last paragraph?
Again, pardon my ignorance as a latecomer here.
Wilfred
Quoted 40 lines · Andrew Geissler
Quoted 3 lines · Wilfred Smith
1. Are there guidelines/procedures specific to submitting command line tools and utilities? I have heard that there may be a repository and/or path dedicated to CLI tools.
The community has definitely tended to limit wrapper tools within OpenBMC. We had a discussion a while back that we're open to some but the API's to them really need to be thought out and reviewed because command line tools become customer API's (i.e. people start writing scripts on top of these tools that then become key to the manufacturing process or some other critical area).
Anything that goes into OpenBMC needs to support OpenBMC interfaces. For example, I'm not familiar with fruid-util's D-bus service xyz.openbmc_project.FruDevice. A "busctl tree xyz.openbmc_project.Inventory.Manager | cat" shows the inventory items on OpenBMC.
One issue we have within OpenBMC is there may be different implementations of the D-bus API's for a given area. For example, Inventory has different implementations so I'm not sure which repo would best fit your tool. That type of issue leads me to wonder if we should put the tools with the interface definitions in openbmc/phosphor-dbus-interfaces? Or maybe a separate phosphor-tools repo would be more logical for these.
Either way, I think command line tools should each get their own mini-design doc
(https://github.com/openbmc/docs/blob/master/designs/design-template.md)
with requirements and interfaces clearly defined for review by the community. If we can find a generic tool that multiple people find useful, we can then find a place to put it. Otherwise, you could host your tools outside of openbmc/ github and just pull them into recipes from within your meta-facebook layer.Quoted 3 lines
Thanks in advance,
Wilfred
Quoted 2 lines
Is OpenBMC more
minimalist “Alpine Linux” or fully loaded, ready-to-go “Ubuntu”?
OpenBMC is a meta distribution, in the same way that Yocto is ("The Yocto Project. It's not an embedded Linux distribution, it creates a custom one for you").
OpenBMC is intended to be (heavily?) adapted to the requirements of your environment. It exists to provide a set of tools that you can pick and choose from in developing your environment (platform)-specific BMC distribution. The hope is that at least some of what the project provides is useful to you, and that we can work together on making better tools for everyone in the community.
Quoted 4 lines
What’s the dividing line between “Core OpenBMC” and “stuff you need to find or build yourself” where the OpenBMC community is aware, but hands-off?
There isn't really a line, and that's somewhat the point. I think the reality is the project is a lot more fluid in that regard than you're expecting it to be.
We're helping each-other out by coming to an understanding of everyone's requirements and trying to develop interfaces and tools on the common ground. This way we can leverage our collective experience and development efforts.
Andrew
On 8/15/19, 5:59 AM, "openbmc on behalf of Andrew Geissler" <[email protected] on behalf of [email protected]> wrote:
On Mon, Aug 12, 2019 at 7:58 PM Wilfred Smith <[email protected]> wrote:
>
>
> 1. Are there guidelines/procedures specific to submitting command line tools and utilities? I have heard that there may be a repository and/or path dedicated to CLI tools.
The community has definitely tended to limit wrapper tools within OpenBMC. We had a discussion a while back that we're open to some but the API's to them really need to be thought out and reviewed because command line tools become customer API's (i.e. people start writing scripts on top of these tools that then become key to the manufacturing process or some other critical area).
Anything that goes into OpenBMC needs to support OpenBMC interfaces. For example, I'm not familiar with fruid-util's D-bus service xyz.openbmc_project.FruDevice. A "busctl tree xyz.openbmc_project.Inventory.Manager | cat" shows the inventory items on OpenBMC.
One issue we have within OpenBMC is there may be different implementations of the D-bus API's for a given area. For example, Inventory has different implementations so I'm not sure which repo would best fit your tool. That type of issue leads me to wonder if we should put the tools with the interface definitions in openbmc/phosphor-dbus-interfaces? Or maybe a separate phosphor-tools repo would be more logical for these.
Andrew, I like the idea of having phosphor-tools which can be a placeholder for any commandline tools and can grow as per requirement. Currently it can start with 3 proposed tools.
Either way, I think command line tools should each get their own mini-design doc
(https://github.com/openbmc/docs/blob/master/designs/design-template.md)
Wilfred, Can you please create a document as per this design template and submit for review.
with requirements and interfaces clearly defined for review by the community. If we can find a generic tool that multiple people find useful, we can then find a place to put it. Otherwise, you could host your tools outside of openbmc/ github and just pull them into recipes from within your meta-facebook layer.
> Thanks in advance,
>
> Wilfred