summaryrefslogtreecommitdiffstats
path: root/perl-install/detect_devices.pm
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-10-02 10:40:42 +0000
committerOlivier Blin <oblin@mandriva.com>2008-10-02 10:40:42 +0000
commit5cb13bdecad5a9e707cc6a11f5082795da1b80e2 (patch)
tree8ad87f49e5dc716284ad185c86fe15f400248745 /perl-install/detect_devices.pm
parenta763742ee2a460cd399557c52b9adad489418de5 (diff)
downloaddrakx-backup-do-not-use-5cb13bdecad5a9e707cc6a11f5082795da1b80e2.tar
drakx-backup-do-not-use-5cb13bdecad5a9e707cc6a11f5082795da1b80e2.tar.gz
drakx-backup-do-not-use-5cb13bdecad5a9e707cc6a11f5082795da1b80e2.tar.bz2
drakx-backup-do-not-use-5cb13bdecad5a9e707cc6a11f5082795da1b80e2.tar.xz
drakx-backup-do-not-use-5cb13bdecad5a9e707cc6a11f5082795da1b80e2.zip
allow detection of low resources systems (extracted from compssUsers.pl) and netbooks/nettops
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r--perl-install/detect_devices.pm14
1 files changed, 14 insertions, 0 deletions
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;