4

Is there a "usual" way to detect whether a is a laptop, desktop, tablet, phone, embedded device, server, virtual machine and so on without the use of HAL?

In the past this information could be snagged from smbios.chassis.type, but as HAL is now deprecated in most Linux distributions I need to get access to this some other way. I can't see anything obvious in dmidecode.

Gareth Davidson
  • 4,857
  • 2
  • 26
  • 45

1 Answers1

2

Figured it out, the chassis type is the form factor of the device:

myserver:/ # dmidecode -s "chassis-type"
 Rack Mount Chassis

The different types of enclosure are listed in the CIM_Chassis table of the SMBIOS Specification[.pdf]

Gareth Davidson
  • 4,857
  • 2
  • 26
  • 45
  • 2
    Highly dependent on whether the manufacturer actually filled out the DMI structures in a reasonable way, which is unfortunately a very large assumption in some cases, but it's still probably about the best that can be done... – twalberg Mar 21 '14 at 15:27