summaryrefslogtreecommitdiffstats
path: root/perl-install/detect_devices.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r--perl-install/detect_devices.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index 3e057d28f..35349ee7c 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -1046,6 +1046,7 @@ sub computer_info() {
+{
isLaptop => member($Chassis, 'Portable', 'Laptop', 'Notebook', 'Hand Held', 'Sub Notebook', 'Docking Station'),
+ isServer => member($Chassis, 'Pizza Box', 'Main Server Chassis', 'Blade'),
if_($BIOS_Year, BIOS_Year => $BIOS_Year),
};
}
@@ -1068,6 +1069,17 @@ sub isLaptop() {
|| (any { member($_->{driver}, qw(ipw2100 ipw2200 ipw3945)) } pci_probe());
}
+sub isServer() {
+ computer_info()->{isServer}
+ || (any { $_->{Type} =~ /ECC/ } dmidecode_category('Memory Module'))
+ || dmidecode_category('System Information')->{Manufacturer} =~ /Supermicro/i
+ || dmidecode_category('System Information')->{'Product Name'} =~ /NetServer|Proliant|PowerEdge|eServer|IBM System x/i
+ || matching_desc__regexp('LSI Logic.*SCSI')
+ || matching_desc__regexp('MegaRAID')
+ || matching_desc__regexp('NetServer')
+ || (any { $_->{'model name'} =~ /(Xeon|Opteron)/i } getCPUs());
+}
+
sub BIGMEM() {
arch() !~ /x86_64|ia64/ && $> == 0 && dmi_detect_memory() > 4 * 1024;
}