To build this package, do the following steps:
meson setup builddir
ninja -C builddir
License: GNU General Public License v3.0
use "ipmitool fru list",Missing complete FRUID0 device information in the echo data
root@test-evb:~# ipmitool fru list
FRU Device Description : Builtin FRU Device (ID 0)
FRU Device Description : motherboard (ID 1)
Device not present (Requested sensor, data, or record not found)
root@test-evb:# ipmitool fru list 0# ipmitool fru list 1
Chassis Type : Rack Mount Chassis
Board Mfg Date : Sun Feb 18 02:35:00 2024 UTC
Board Mfg : Biggest International Corp.
Board Product : Some Cool Product
Product Manufacturer : China OpenBmc
Product Name : test S10B316
Product Part Number : 12345789
Product Serial : 12345789
root@test-evb:
Device not present (Requested sensor, data, or record not found)
This is exposed when building under GCC 5.2:
arm-openbmc-linux-gnueabi-g++ -march=armv5e -marm -mthumb-interwork --sysroot=/scratch/joel/openbmc/build/tmp/sysroots/palmetto -O2 -pipe -g -feliminate-unused-debug-types -fpic -std=gnu++14 -fvisibility-inlines-hidden -c -o writefrudata.o writefrudata.C
cc1: warning: command line option '-std=gnu++14' is valid for C++/ObjC++ but not for C
writefrudata.C: In function 'int ipmi_validate_fru_area(uint8_t, const char*, sd_bus*, bool)':
writefrudata.C:588:51: error: cannot convert 'std::ifstream {aka std::basic_ifstream<char>}' to 'bool' in initialization
bool present = std::ifstream(fru_file_name);
^
<builtin>: recipe for target 'writefrudata.o' failed
make: *** [writefrudata.o] Error 1
workspace\sources\phosphor-ipmi-host\dbus-sdr\storagecommands.cpp
//
ipmi::registerHandler(ipmi::prioOpenBmcBase, ipmi::netFnStorage,
ipmi::storage::cmdWriteFruData,
ipmi::Privilege::Operator, ipmiStorageWriteFruData);
workspace\sources\phosphor-ipmi-fru\strgfnhandler.cpp
void register_netfn_storage_write_fru()
{
std::printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n", NETFUN_STORAGE,
IPMI_CMD_WRITE_FRU_DATA);
ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_WRITE_FRU_DATA, NULL,
ipmiStorageWriteFruData, SYSTEM_INTERFACE);
}
Hi,
Found a copy-paste typo in readeeprom.cpp. The fruid_str parsed value is not actually checked for emptiness, the eeprom_str is checked instead. This may result in false-positive argument checks.
The attached patch fixes this typo.
Regards,
Dmitry
0001-read-eeprom-fix-fruid-str-emptines-check.patch.gz
Even though std::string is part of the supported types of Value std::variant, it's deceivingly hard to use.
I was running into this issue: https://stackoverflow.com/questions/44086269/why-does-my-variant-convert-a-stdstring-to-a-bool where:
"The type of "hello" is const char [6], which decays to const char *. The conversion from const char * to bool is a built-in conversion, while the conversion from const char * to std::string is a user-defined conversion, which means the former is performed."
The fix was to declare the string using a Folded Block Scalar > and then wrapping the string in std::string("hello") for example.
A comment / documentation somewhere of this behavior may be useful as this is not very obvious.
variable 'offset' in function 'ipmiStorageWriteFruData' is declared as uint8_t, but it should be uint16_t.
ipmi_ret_t ipmiStorageWriteFruData(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
ipmi_request_t request,
ipmi_response_t response,
ipmi_data_len_t dataLen,
ipmi_context_t context)
{
...
uint16_t offset = 0; // offset should be declared as uint16_t
...
offset = ((uint16_t)reqptr->offsetms) << 8 | reqptr->offsetls; // otherwise, this operation shall give unexcepted result
My understanding is we are importing code from another open source package and thus this is going to be GPLv3. Need confirmation that I picked the correct license for the initial commit.
Use “ipmitool fru edit”,want to modify the information of a certain domain;Then ipmitool fru list to check ,The data viewed using ipmitool is OK [it is the modified data];
But:
Mar 09 16:06:01 test-evb ipmid[327]: FRU file is incomplete
Mar 09 16:06:01 test-evb ipmid[327]: Populating FRU areas failed
Mar 09 16:06:01 test-evb ipmid[327]: Incomplete FRU file
Mar 09 16:06:01 test-evb ipmid[327]: Populating FRU areas failed
Mar 09 16:06:01 test-evb ipmid[327]: Incomplete FRU file
Mar 09 16:06:01 test-evb ipmid[327]: Populating FRU areas failed
Mar 09 16:06:01 test-evb ipmid[327]: Incomplete FRU file
Mar 09 16:06:01 test-evb ipmid[327]: Populating FRU areas failed
test befoe:
root@test-evb:# ipmitool fru list#
FRU Device Description : Builtin FRU Device (ID 0)
Board Mfg Date : Wed Jan 10 04:58:00 2024 UTC
Board Mfg : AnyCompany
Board Product : HangZhou
Board Serial : pn123456789987654321
Board Part Number : Cloudnineinfo123456789
root@test-evb:
EEPROM Data:
root@test-evb:~# hexdump -Cv /sys/class/i2c-dev/i2c-28/device/28-0050/eeprom
00000000 01 00 00 01 00 00 00 fe 01 0a 19 aa ea e0 ca 41 |...............A|
00000010 6e 79 43 6f 6d 70 61 6e 79 c8 48 61 6e 67 5a 68 |nyCompany.HangZh|
00000020 6f 75 d4 70 6e 31 32 33 34 35 36 37 38 39 39 38 |ou.pn12345678998|
00000030 37 36 35 34 33 32 31 d6 43 6c 6f 75 64 6e 69 6e |7654321.Cloudnin|
00000040 65 69 6e 66 6f 31 32 33 34 35 36 37 38 39 c7 4e |einfo123456789.N|
00000050 6f 74 68 69 6e 67 c1 e8 ff ff ff ff ff ff ff ff |othing..........|
00000060 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
00000070 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
00000080 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
00000090 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
test after:
root@test-evb:# ipmitool fru list#
FRU Device Description : Builtin FRU Device (ID 0)
Board Mfg Date : Wed Jan 10 04:58:00 2024 UTC
Board Mfg : CloudNineInfo
Board Product : HangZhou
Board Serial : pn123456789987654321
Board Part Number : Cloudnineinfo123456789
root@test-evb:
EEPROM Data:
root@test-evb:~# hexdump -Cv /sys/class/i2c-dev/i2c-28/device/28-0050/eeprom
00000000 01 00 00 01 00 00 00 fe 01 0a 19 aa ea e0 ca 41 |...............A|
00000010 6e 79 43 6f 6d 70 61 6e 79 c8 48 61 6e 67 5a 68 |nyCompany.HangZh|
00000020 6f 75 d4 70 6e 31 32 33 34 35 36 37 38 39 39 38 |ou.pn12345678998|
00000030 37 36 35 34 33 32 31 d6 43 6c 6f 75 64 6e 69 6e |7654321.Cloudnin|
00000040 65 69 6e 66 6f 31 32 33 34 35 36 37 38 39 c7 4e |einfo123456789.N|
00000050 6f 74 68 69 6e 67 c1 e8 ff ff ff ff ff ff ff ff |othing..........|
00000060 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
00000070 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
00000080 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
00000090 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
Reading vpd on IO board on PVT Barreleye seg faults and data is not added to the inventory.
System running 8.0.1 openbmc.
'''
root@barreleye:~# phosphor-read-eeprom --eeprom /sys/bus/i2c/devices/0-0050/eeprom --fruid 64
Segmentation fault
'''
What should be sent to dbus and in what format
MFG_Name = 0x9801
Model_Number = "9965439-092.A00LF "
Version = 0x0000
IPMI Incoming: Seq 0x1c, NetFn 0x28, CMD: 0x12
0x000000: 03 00 00 01 00 00 00 01 00 00 fe 01 05 00 02 98 ................
0x000010: 01 01 0b d2 39 39 36 35 34 33 39 2d 30 39 32 2e ....9965439-092.
0x000020: 41 30 30 4c 46 20 02 00 00 04 15 20 e6 91 00 00 A00LF ..... ....
0x000030: 00 c1 48 ..H
01 00 00 00 01 00 00 fe
^-- Product area
01 - version
05 - length = 5*8 = 40
00 - Language code
02 - 0b00 000010 = MFG Name - Binary for 2 bytes
98 01 - 0x9801 is the MFG name
01 - Product Name length - Binary for 1 byte
0b - Name is 0x0b
d2 - 0b11010010 Product Model Number - Ascii for 18 bytes
39 39 36 35 34 33 39 2d 30 39 32 2e 41 30 30 4c 46 20 - (9965439-092.A00LF )
02 - Product Version Length - binary for 2 bytes
00 00
04 - Product Serial number length
15 20 e6 91 - 0x1520e691 is the serial number
00 - Asset tag length
00 fru file id length
00 - Custom product info area length
C1 - Done
48 - CRC
During system boot time the mapper is under heavy load and could be flaky in returning the service name. Better to try call phosphor-inventory-manager directly if the mapper call fails.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.