diff options
author | Michael Larabel <michael@phx-laptop.(none)> | 2008-08-01 19:59:02 -0400 |
---|---|---|
committer | Michael Larabel <michael@phx-laptop.(none)> | 2008-08-03 11:50:42 -0400 |
commit | dd097a2049ebccc05cc2e599a2a00519ba1e0322 (patch) | |
tree | 3522ad6700decc969944e068edda60f574e3b65b /pts-core/functions/pts-functions_system.php | |
parent | d435e6a5b6a1b207e3515a43718f7f268a18a08c (diff) | |
download | phoronix-test-suite-upstream-dd097a2049ebccc05cc2e599a2a00519ba1e0322.tar.gz phoronix-test-suite-upstream-dd097a2049ebccc05cc2e599a2a00519ba1e0322.tar.xz phoronix-test-suite-upstream-dd097a2049ebccc05cc2e599a2a00519ba1e0322.zip |
pts-core: Improve HAL motherboard detection
In particular, this should make many mother ASUS motherboards detectable
using HAL. ASUS motherboards don't supply the vendor in this section,
but they do the product name so if we reorder the code we can at least
extract parts of it.
Diffstat (limited to 'pts-core/functions/pts-functions_system.php')
-rw-r--r-- | pts-core/functions/pts-functions_system.php | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/pts-core/functions/pts-functions_system.php b/pts-core/functions/pts-functions_system.php index 6418f24..08208d1 100644 --- a/pts-core/functions/pts-functions_system.php +++ b/pts-core/functions/pts-functions_system.php @@ -275,20 +275,19 @@ function main_system_hardware_string() $product = read_system_hal("system.hardware.product"); $version = read_system_hal("system.hardware.version"); - if($product == "Unknown" || $product == "Not Applicable" || (strpos($version, '.') === FALSE && $version != "Unknown")) - { - $product = $version; - } - if($vendor == "Unknown" || $vendor == "System manufacturer" || $vendor == "To Be Filled By O.E.M." || $vendor == "Not Applicable") - { - $info = "Unknown"; - } + if($vendor != "Unknown" && $vendor != "System manufacturer" && $vendor != "To Be Filled By O.E.M." && $vendor != "Not Applicable") + $info = $vendor; else + $info = ""; + + if($product == "Unknown" || $product == "Not Applicable" || empty($product) || (strpos($version, ".") === FALSE && $version != "Unknown")) + $product = $version; + + if(!empty($product) && $product != "Unknown") { - $info = pts_clean_information_string($vendor . " " . $product); + $info .= " " . $product; } - - return $info; + return pts_clean_information_string($info); } function pts_report_power_mode() { |