diff options
author | Burt P <pburt0@gmail.com> | 2018-10-13 17:09:19 -0500 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2019-05-25 14:23:16 -0700 |
commit | ad57a3f7fe910cf509485e8b394007ce397df0ad (patch) | |
tree | 12568bca94348131c2abdd2e5a0485de1f8ef632 | |
parent | f5cee38e1bdc678e8271c3eb91b827036e67d4de (diff) |
Allow DMI on non-x86
There's nothing preventing this from running on non-x86.
If it is not available it will just say so, like PCI.
Signed-off-by: Burt P <pburt0@gmail.com>
-rw-r--r-- | includes/devices.h | 4 | ||||
-rw-r--r-- | modules/devices.c | 12 | ||||
-rw-r--r-- | modules/devices/dmi.c | 9 |
3 files changed, 7 insertions, 18 deletions
diff --git a/includes/devices.h b/includes/devices.h index 4cb0d122..7223b91e 100644 --- a/includes/devices.h +++ b/includes/devices.h @@ -69,10 +69,8 @@ void scan_sensors_do(void); void sensors_init(void); void sensors_shutdown(void); -#if defined(ARCH_x86) || defined(ARCH_x86_64) /* SPD */ void scan_spd_do(void); -#endif /* ARCH_x86 */ extern gchar *battery_list; extern gchar *input_icons; @@ -93,10 +91,8 @@ extern GHashTable *sensor_compute; extern GHashTable *sensor_labels; extern GModule *cups; -#if defined(ARCH_x86) || defined(ARCH_x86_64) extern gchar *spd_info; extern gchar *dmi_info; -#endif extern gchar *dtree_info; extern gchar *gpu_list; diff --git a/modules/devices.c b/modules/devices.c index cbc01dae..a03ff9f9 100644 --- a/modules/devices.c +++ b/modules/devices.c @@ -50,10 +50,8 @@ gchar *callback_printers(); gchar *callback_storage(); gchar *callback_input(); gchar *callback_usb(); -#if defined(ARCH_x86) || defined(ARCH_x86_64) gchar *callback_dmi(); gchar *callback_spd(); -#endif gchar *callback_dtree(); gchar *callback_device_resources(); @@ -67,10 +65,8 @@ void scan_printers(gboolean reload); void scan_storage(gboolean reload); void scan_input(gboolean reload); void scan_usb(gboolean reload); -#if defined(ARCH_x86) || defined(ARCH_x86_64) void scan_dmi(gboolean reload); void scan_spd(gboolean reload); -#endif void scan_dtree(gboolean reload); void scan_device_resources(gboolean reload); @@ -107,13 +103,11 @@ static ModuleEntry entries[] = { [ENTRY_SENSORS] = {N_("Sensors"), "therm.png", callback_sensors, scan_sensors, MODULE_FLAG_NONE}, [ENTRY_INPUT] = {N_("Input Devices"), "inputdevices.png", callback_input, scan_input, MODULE_FLAG_NONE}, [ENTRY_STORAGE] = {N_("Storage"), "hdd.png", callback_storage, scan_storage, MODULE_FLAG_NONE}, -#if defined(ARCH_x86) || defined(ARCH_x86_64) [ENTRY_DMI] = {N_("DMI"), "computer.png", callback_dmi, scan_dmi, MODULE_FLAG_NONE}, [ENTRY_SPD] = {N_("Memory SPD"), "memory.png", callback_spd, scan_spd, MODULE_FLAG_NONE}, +#if defined(ARCH_x86) || defined(ARCH_x86_64) [ENTRY_DTREE] = {"#"}, #else - [ENTRY_DMI] = {"#"}, - [ENTRY_SPD] = {"#"}, [ENTRY_DTREE] = {N_("Device Tree"), "devices.png", callback_dtree, scan_dtree, MODULE_FLAG_NONE}, #endif /* x86 or x86_64 */ [ENTRY_RESOURCES] = {N_("Resources"), "resources.png", callback_device_resources, scan_device_resources, MODULE_FLAG_NONE}, @@ -539,7 +533,6 @@ gchar *hi_get_field(gchar * field) return g_strdup(field); } -#if defined(ARCH_x86) || defined(ARCH_x86_64) void scan_dmi(gboolean reload) { SCAN_START(); @@ -553,7 +546,6 @@ void scan_spd(gboolean reload) scan_spd_do(); SCAN_END(); } -#endif void scan_dtree(gboolean reload) { @@ -644,7 +636,6 @@ gchar *callback_processors() return processor_get_info(processors); } -#if defined(ARCH_x86) || defined(ARCH_x86_64) gchar *callback_dmi() { return g_strdup(dmi_info); @@ -654,7 +645,6 @@ gchar *callback_spd() { return g_strdup(spd_info); } -#endif gchar *callback_dtree() { diff --git a/modules/devices/dmi.c b/modules/devices/dmi.c index 31b0c43d..0f8af169 100644 --- a/modules/devices/dmi.c +++ b/modules/devices/dmi.c @@ -153,8 +153,11 @@ void __scan_dmi() dmi_ok = dmi_get_info(); if (!dmi_ok) { - dmi_info = g_strdup("[No DMI information]\n" - "There was an error retrieving the information.=\n" - "Please try running HardInfo as root.=\n"); + dmi_info = g_strdup_printf("[%s]\n%s=\n", + _("DMI Unavailable"), + (getuid() == 0) + ? _("DMI is not avaliable. Perhaps this platform does not provide DMI.") + : _("DMI is not available; Perhaps try running HardInfo as root.") ); + } } |