OpenSolaris dmidecode IPS

I've talked about the SourceJuicer before. If you often grab source tarballs and compile them on Solaris, check it out. And better yet - contribute. It's really not very involved. Today I put the dmidecode utility into the juicer.

Part of the x86gentopo project is adding OEM-specific SMBIOS structures. In searching around to find out if the structure types we were proposing would conflict with already existing OEM extensions, I stumbled upon dmidecode. Quite a nice utility. The /usr/sbin/smbios CLI is the Solaris equivalent. A minor annoyance with dmidecode is that it must be run as root since it directly reads the /dev/xsvc device, whereas smbios uses the /dev/smbios device. But execution aside, both report the same basic information:

# dmidecode -t baseboard # dmidecode 2.10 SMBIOS 2.5 present. Handle 0x0002, DMI type 2, 15 bytes Base Board Information Manufacturer: Sun Microsystems Product Name: Ultra 24 Version: 50 Serial Number: 3K01V3 Asset Tag: Null Features: Board is a hosting board Board is replaceable Location In Chassis: Null Chassis Handle: 0x0003 Type: Motherboard Contained Object Handles: 0 $ smbios -t 2 ID SIZE TYPE 2 60 SMB_TYPE_BASEBOARD (base board) Manufacturer: Sun Microsystems Product: Ultra 24 Version: 50 Serial Number: 3K01V3 Asset Tag: Null Location Tag: Null Chassis: 3 Flags: 0x9 SMB_BBFL_MOTHERBOARD (board is a motherboard) SMB_BBFL_REPLACABLE (board is field-replacable) Board Type: 0xa (motherboard)

Some slight field label differences, but the set of information one would expect. And, the listing of contained object handles from dmidecode is something missing from /usr/sbin/smbios. That's an enhancement the x86gentopo project is working on.

Although, dmidecode has some nice additions that make scripting simpler. For example, to fetch the system serial number (residing in the Type 1 SMBIOS strucure):

# dmidecode -s system-serial-number 0909FMB010

The keyword strings are a nice touch. Compare this with:

$ smbios -i `smbios -s |grep SMB_TYPE_SYSTEM | awk '{print $1}'` \\ | grep Serial | awk '{print $3}' 0909FMB010

While one gets the same result, it's obvious which approach is simpler and more maintainable in a script. And that's the primary reason it prompted me to port the utility. I'd suspect that many administrators have built scripts around dmidecode for basic system inventories. If moving to Solaris, having dmidecode around means one less script to port.

It's available in the /pending repository. /pending is an unstable repository, although dmidecode is about as benign as things get, so there's little risk in using it. It's behaved fine on my two systems running OpenSolaris b117 (one Sun system, one Toshiba laptop). If you do download it and use it, I'd really appreciate it if you let me know how it's working. I want to get the package moved to the more stable /contrib repository, and any reports of dmidecode working "in the wild" would certainly help.

:wq

Comments:

Post a Comment:
Comments are closed for this entry.
About

user9148476

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today