From aba3aac607e4be847b5a24bf851655645b1a7033 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 16 Dec 2004 15:24:53 +0000 Subject: create function detect_devices::BIGMEM() which calls c::dmiDetectMemory(), but only if we are root (this helps testings install without dying) --- perl-install/detect_devices.pm | 4 ++++ perl-install/install_any.pm | 2 +- perl-install/pkgs.pm | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index f21abc636..67296c01a 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -837,6 +837,10 @@ sub isLaptop() { || cat_('/proc/cpuinfo') =~ /\bmobile\b/i; } +sub BIGMEM() { + arch() !~ /x86_64|ia64/ && $> == 0 && c::dmiDetectMemory() > 4 * 1024; +} + sub is_i586() { my $cpuinfo = cat_('/proc/cpuinfo'); $cpuinfo =~ /^cpu family\s*:\s*(\d+)/m && $1 < 6 || diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index e4898fb18..7c9e1bcb2 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -687,7 +687,7 @@ sub setDefaultPackages { $o->{rpmsrate_flags_chosen}{USB} = 1 if $o->{modules_conf}->get_probeall("usb-interface"); $o->{rpmsrate_flags_chosen}{PCMCIA} = 1 if detect_devices::hasPCMCIA(); $o->{rpmsrate_flags_chosen}{HIGH_SECURITY} = 1 if $o->{security} > 3; - $o->{rpmsrate_flags_chosen}{BIGMEM} = 1 if c::dmiDetectMemory() > 4 * 1024; + $o->{rpmsrate_flags_chosen}{BIGMEM} = 1 if detect_devices::BIGMEM(); $o->{rpmsrate_flags_chosen}{SMP} = 1 if detect_devices::hasSMP(); $o->{rpmsrate_flags_chosen}{CDCOM} = 1 if any { $_->{descr} =~ /commercial/i } values %{$o->{packages}{mediums}}; $o->{rpmsrate_flags_chosen}{TV} = 1 if detect_devices::getTVcards(); diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index d42dad558..3312b514f 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -207,7 +207,7 @@ sub bestKernelPackage { } my @prefered_exts = detect_devices::is_i586() ? '-i586-up-1GB' : - (arch() !~ /x86_64|ia64/ && c::dmiDetectMemory() > 4 * 1024) ? ('-enterprise', '-smp') : + detect_devices::BIGMEM() ? ('-enterprise', '-smp') : detect_devices::hasSMP() ? '-smp' : ''; foreach my $prefered_ext (@prefered_exts, '') { -- cgit v1.2.1