diff options
author | Renato Botelho <renato@netgate.com> | 2016-03-28 15:52:16 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-03-28 15:52:16 -0300 |
commit | 042326a301562e16e5f266b78f60aeea03c83ae9 (patch) | |
tree | f97378ad77b9ebd0b3259c4a3a18c9b31cc2a0f1 /src/etc | |
parent | 24d4fddeb35eb5c3d0b1e2408f094218343653de (diff) | |
download | pfsense-042326a301562e16e5f266b78f60aeea03c83ae9.zip pfsense-042326a301562e16e5f266b78f60aeea03c83ae9.tar.gz |
Identify specific hardware models of some Netgate products
Diffstat (limited to 'src/etc')
-rw-r--r-- | src/etc/inc/system.inc | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc index f700b2f..d8285d3 100644 --- a/src/etc/inc/system.inc +++ b/src/etc/inc/system.inc @@ -2183,6 +2183,8 @@ function system_identify_specific_platform() { return array('name' => 'generic-pc-cdrom', 'descr' => gettext("Generic PC (CD-ROM)")); } + $hw_model = get_single_sysctl('hw.model'); + /* Try to guess from smbios strings */ unset($output); $_gb = exec('/bin/kenv smbios.system.product 2>/dev/null', $output); @@ -2194,7 +2196,24 @@ function system_identify_specific_platform() { return (array('name' => 'APU', 'descr' => 'Netgate APU')); break; case 'RCC-VE': - return (array('name' => 'RCC-VE', 'descr' => 'Netgate RCC-VE')); + $result = array(); + $result['name'] = 'RCC-VE'; + + /* Detect specific models */ + if (!function_exists('does_interface_exist')) { + require_once("interfaces.inc"); + } + if (!does_interface_exist('igb4')) { + $result['model'] = 'SG-2440'; + } elseif (strpos($hw_model, "C2558") !== false) { + $result['model'] = 'SG-4860'; + } elseif (strpos($hw_model, "C2758") !== false) { + $result['model'] = 'SG-8860'; + } else { + $result['model'] = 'RCC-VE'; + } + $result['descr'] = 'Netgate ' . $result['model']; + return $result; break; case 'DFFv2': return (array('name' => 'RCC-DFF', 'descr' => 'Netgate RCC-DFF')); @@ -2216,8 +2235,6 @@ function system_identify_specific_platform() { return array('name' => $g['platform'], 'descr' => $g['platform']); } - $hw_model = get_single_sysctl('hw.model'); - if (strpos($hw_model, "PC Engines WRAP") !== false) { return array('name' => 'wrap', 'descr' => gettext('PC Engines WRAP')); } |