From 7871c8e9327e4e5b18de9d8081b0f32fa38c2c1f Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 24 Dec 2012 19:03:59 +0100 Subject: hostnamed: make chassis type configurable via /etc/machine-info For many usecases it is useful to store the chassis type somewhere, and /etc/machine-info sounds like a good place. Ideally we could always detect the chassis type from firmware, but frequently that's not available and in many embedded devices probably entirely unrealistic. This patch adds a configurable setting CHASSIS= to /etc/machine-info and exposes this via hostnamectl/hostnamed. hostnamed will guess the chassis type from DMI if nothing is set explicitly. I also added support for detecting it from ACPI, which should be more useful as ACPI 5.0 actually knows a "tablet" chassis type, which neither DMI nor previous ACPI versions knew. This also enables DMI-based and ACPI-based detection for non-x86 systems as ACPI is apparently coming to ARM platforms soon. I tried to minimize the vocabulary of chassis types understood and added: desktop, laptop, server, tablet, handset. This is much less than either APCI or DMI know. If we need more types later on we can easily add them. --- man/machine-info.xml | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'man/machine-info.xml') diff --git a/man/machine-info.xml b/man/machine-info.xml index b310d71334..1c3a21c643 100644 --- a/man/machine-info.xml +++ b/man/machine-info.xml @@ -128,6 +128,34 @@ similar icon name. + + CHASSIS= + + The chassis + type. Currently, the following chassis + types are defined: + desktop, + laptop, + server, + tablet, + handset, as well as + the special chassis types + vm and + container for + virtualized systems that lack an + immediate physical chassis. Note that + many systems allow detection of the + chassis type automatically (based on + firmware information or + suchlike). This setting (if set) shall + take precedence over automatically + detected information and is useful to + override misdetected configuration or + to manually configure the chassis type + where automatic detection is not + available. + + @@ -135,8 +163,9 @@ Example - PRETTY_HOSTNAME="Lennart's Computer" -ICON_NAME=computer-laptop + PRETTY_HOSTNAME="Lennart's Tablet" +ICON_NAME=computer-tablet +CHASSIS=tablet -- cgit v1.2.3-54-g00ecf