hal: Branch 'master'
Danny Kukawka
dkukawka at kemper.freedesktop.org
Sat May 17 16:27:16 PDT 2008
doc/spec/hal-spec-properties.xml | 42 +++++++++++++++++++++++++++++++++++++-
hald/linux/osspec.c | 7 ++++++
hald/linux/probing/probe-smbios.c | 9 ++++++++
3 files changed, 57 insertions(+), 1 deletion(-)
New commits:
commit c44e5cd53b06d60f2ca340c132b88d5953dc86b5
Author: Danny Kukawka <danny.kukawka at web.de>
Date: Sun May 18 01:26:26 2008 +0200
added system.board.* for base-/mainboard information
Since some machines don't provide usefull system.hardware.*
information I've added new properties to HAL to get information
about the mainboard.
The attached patch adds the following new keys to HAL:
* system.board.vendor
* system.board.product
* system.board.version
* system.board.serial
This should also fix fd.o #15378.
diff --git a/doc/spec/hal-spec-properties.xml b/doc/spec/hal-spec-properties.xml
index bd97e51..1d4d2be 100644
--- a/doc/spec/hal-spec-properties.xml
+++ b/doc/spec/hal-spec-properties.xml
@@ -3370,7 +3370,7 @@ org.freedesktop.Hal.Device.Volume.method_signatures = {'ssas', 'as', 'as'}
</row>
<row>
<entry>
- <literal>system.product</literal> (string)
+ <literal>system.hardware.product</literal> (string)
</entry>
<entry></entry>
<entry>No</entry>
@@ -3478,6 +3478,46 @@ org.freedesktop.Hal.Device.Volume.method_signatures = {'ssas', 'as', 'as'}
The chassis type of the machine.
</entry>
</row>
+ <row>
+ <entry>
+ <literal>system.board.vendor</literal> (string)
+ </entry>
+ <entry></entry>
+ <entry>No</entry>
+ <entry>
+ The name of the manufacturer of the base board.
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <literal>system.board.product</literal> (string)
+ </entry>
+ <entry></entry>
+ <entry>No</entry>
+ <entry>
+ The product name of the base board.
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <literal>system.board.version</literal> (string)
+ </entry>
+ <entry></entry>
+ <entry>No</entry>
+ <entry>
+ The version of the base board.
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <literal>system.board.serial</literal> (string)
+ </entry>
+ <entry></entry>
+ <entry>No</entry>
+ <entry>
+ The serial number of the base board.
+ </entry>
+ </row>
</tbody>
</tgroup>
</informaltable>
diff --git a/hald/linux/osspec.c b/hald/linux/osspec.c
index c753735..e91a8aa 100644
--- a/hald/linux/osspec.c
+++ b/hald/linux/osspec.c
@@ -329,6 +329,7 @@ osspec_privileged_init_preparse_set_dmi (gboolean set, HalDevice *d)
gchar *buf;
static char *product_serial;
static char *product_uuid;
+ static char *board_serial;
static gboolean parsed = FALSE;
if (g_file_test (DMI_SYSFS_PATH, (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) {
@@ -338,12 +339,15 @@ osspec_privileged_init_preparse_set_dmi (gboolean set, HalDevice *d)
product_serial = g_strdup ( buf );
if ((buf = hal_util_get_string_from_file(DMI_SYSFS_PATH, "product_uuid")) != NULL)
product_uuid = g_strdup ( buf );
+ if ((buf = hal_util_get_string_from_file(DMI_SYSFS_PATH, "board_serial")) != NULL)
+ board_serial = g_strdup ( buf );
parsed = TRUE;
} else {
if (d != NULL && parsed) {
hal_device_property_set_string (d, "system.hardware.serial", product_serial);
hal_device_property_set_string (d, "system.hardware.uuid", product_uuid);
+ hal_device_property_set_string (d, "system.board.serial", board_serial);
g_free (product_serial);
g_free (product_uuid);
parsed = FALSE;
@@ -740,6 +744,9 @@ decode_dmi_from_sysfs (HalDevice *d)
hal_util_set_string_from_file(d, "system.hardware.product", DMI_SYSFS_PATH, "product_name");
hal_util_set_string_from_file(d, "system.hardware.version", DMI_SYSFS_PATH, "product_version");
hal_util_set_string_from_file(d, "system.chassis.manufacturer", DMI_SYSFS_PATH, "chassis_vendor");
+ hal_util_set_string_from_file(d, "system.board.product", DMI_SYSFS_PATH, "board_name");
+ hal_util_set_string_from_file(d, "system.board.version", DMI_SYSFS_PATH, "board_version");
+ hal_util_set_string_from_file(d, "system.board.vendor", DMI_SYSFS_PATH, "board_vendor");
computer_dmi_map (d, FALSE);
computer_probing_helper_done (d);
diff --git a/hald/linux/probing/probe-smbios.c b/hald/linux/probing/probe-smbios.c
index 6085599..e6556f2 100644
--- a/hald/linux/probing/probe-smbios.c
+++ b/hald/linux/probing/probe-smbios.c
@@ -45,6 +45,7 @@
#define DMIPARSER_STATE_BIOS 1
#define DMIPARSER_STATE_SYSTEM 2
#define DMIPARSER_STATE_CHASSIS 3
+#define DMIPARSER_STATE_BOARD 4
#define strbegin(buf, str) (strncmp (buf, str, strlen (str)) == 0)
@@ -233,6 +234,8 @@ main (int argc, char *argv[])
dmiparser_state = DMIPARSER_STATE_SYSTEM;
else if (!dmiparser_done_chassis && strbegin (buf, "Chassis Information"))
dmiparser_state = DMIPARSER_STATE_CHASSIS;
+ else if (!dmiparser_done_chassis && strbegin (buf, "Base Board Information"))
+ dmiparser_state = DMIPARSER_STATE_BOARD;
else
/*
* We do not match the other sections,
@@ -273,6 +276,12 @@ main (int argc, char *argv[])
setstr (nbuf, "Manufacturer:", "system.chassis.manufacturer");
setstr (nbuf, "Type:", "system.chassis.type");
dmiparser_done_chassis = TRUE;
+ } else if (dmiparser_state == DMIPARSER_STATE_BOARD) {
+ setstr (nbuf, "Manufacturer:", "system.board.vendor");
+ setstr (nbuf, "Product Name:", "system.board.product");
+ setstr (nbuf, "Version:", "system.board.version");
+ setstr (nbuf, "Serial Number:", "system.board.serial");
+ dmiparser_done_system = TRUE;
}
}
More information about the hal-commit
mailing list