analogdevicesinc / fru_tools Goto Github PK
View Code? Open in Web Editor NEWTools to display/manipulate FMC FRU info
License: GNU General Public License v2.0
Tools to display/manipulate FMC FRU info
License: GNU General Public License v2.0
When we try to have longer serial numbers, we quickly run out of room...
rgetz@brain:~/github/fru_tools$ ./fru-dump ./masterfiles/AD-FMCOMMS3-EBZ-FRU.bin -s 123456789012345 -t 0123456789 -d now -o fru.bin
read 251 bytes from ./masterfiles/AD-FMCOMMS3-EBZ-FRU.bin
changing serial number to 123456789012345
changing tuning parameter to '0123456789'
changing date to Sun Dec 19 19:36:00 2021
fru_dump 0.8.1.6, built 18Dec2021
Not able to pack things into 255 char, no output
This is because the custom
fields are tagged as binary, and can not be packed.
This is because the overall header is using 8-byte offsets, so some null padding happens...
The easy solution is to pack the custom fields.
Hi,
fru-dump crashes when called with -b:
root:~# ./fru-dump -v -b -i /sys/bus/i2c/devices/0-0050/eeprom
read 256 bytes from /sys/bus/i2c/devices/0-0050/eeprom
Date of Man : Mon Jan 1 00:00:00 1996
Manufacturer : XXXXXXX
Product Name : XXXXXXX
Serial Number :
Part Number :
FRU File ID :
Custom Fields:
Field 0 (len=2): 61 00 |a.|
Segmentation fault
The simple reason is that a NULL-pointer check in free_FRU is missing. I can provide a patch if that's of interest,
CU,
Uli
Lines 284 to 285 in 9c360ea
The bound-condition should be i+2<size, because index i+2 is being de-referenced.
This bug causes the last character to be missed if size is multiple of three.
free_FRU() catches SIGSEGV in case fru->MultiRecord_Area == NULL
Command line was "fru-dump -b "
Program received signal SIGSEGV, Segmentation fault.
0x0000555555556b22 in free_FRU (fru=0x55555555d890) at fru.c:647
647 free(fru->MultiRecord_Area->supplies[j]);
(gdb) bt
#0 0x0000555555556b22 in free_FRU (fru=0x55555555d890) at fru.c:647
#1 0x000055555555585a in main (argc=, argv=) at operating-system.c:568
(gdb) p fru
$1 = (struct FRU_DATA *) 0x55555555d890
(gdb) p *fru
$2 = {Internal_Area = 0x0, Chassis_Info = 0x0, Board_Area = 0x55555555d8c0, Product_Info = 0x0, MultiRecord_Area = 0x0}
For general help/questions, and interaction with the development team, try Analog Devices EngineerZone.
http://ez.analog.com/community/linux-device-drivers/linux-software-drivers
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.