From 5cb13bdecad5a9e707cc6a11f5082795da1b80e2 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Thu, 2 Oct 2008 10:40:42 +0000 Subject: allow detection of low resources systems (extracted from compssUsers.pl) and netbooks/nettops --- perl-install/detect_devices.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'perl-install/detect_devices.pm') diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index 7948cc649..b2083ca60 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -1085,6 +1085,20 @@ sub is_virtualbox() { any { $_->{driver} eq 'vboxadd' } detect_devices::pci_probe(); } +sub is_netbook_nettop() { + my @cpus = getCPUs(); + (any { $_->{'model name'} =~ /(\bIntel\(R\) Atom\(TM\)\B)/i } @cpus) || + (any { $_->{'model name'} =~ /(\bIntel\(R\) Celeron\(R\) M processor\b|\bVIA C7-M Processor\b|\bGeode\(TM\)\B)/i && $_->{'cpu MHz'} < 1500 } @cpus); +} + +sub has_low_resources() { + availableRamMB() < 100 || arch() =~ /i.86/ && ix86_cpu_frequency() < 350; +} + +sub need_light_desktop() { + has_low_resources() || is_netbook_nettop(); +} + sub has_cpu_flag { my ($flag) = @_; cat_('/proc/cpuinfo') =~ /^flags.*\b$flag\b/m; -- cgit v1.2.1