summaryrefslogtreecommitdiffstats
path: root/perl-install/detect_devices.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2011-08-22 11:33:37 +0000
committerThierry Vignaud <tv@mageia.org>2011-08-22 11:33:37 +0000
commite1de3d3e802c171f7ca1c4d10d9da4a02ae1a8ef (patch)
tree304b55ad4bd59346cae901ffd49b0ec1b6cf370e /perl-install/detect_devices.pm
parent7f0d77a7038da9667ec08274b5b704ff1cc80bde (diff)
downloaddrakx-e1de3d3e802c171f7ca1c4d10d9da4a02ae1a8ef.tar
drakx-e1de3d3e802c171f7ca1c4d10d9da4a02ae1a8ef.tar.gz
drakx-e1de3d3e802c171f7ca1c4d10d9da4a02ae1a8ef.tar.bz2
drakx-e1de3d3e802c171f7ca1c4d10d9da4a02ae1a8ef.tar.xz
drakx-e1de3d3e802c171f7ca1c4d10d9da4a02ae1a8ef.zip
(hasCPUMicrocode) add support to detect if CPU microcode is upgradable
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r--perl-install/detect_devices.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index 46655599b..117f14ed8 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -1238,6 +1238,7 @@ sub matching_types() {
mips_ict => is_mips_ict(),
mips_st_ls2f => is_mips_st_ls2f(),
cpufreq => hasCPUFreq(),
+ microcode => hasCPUMicrocode(),
laptop => isLaptop(),
'numpad' => hasNumpad(),
'touchpad' => hasTouchpad(),
@@ -1246,6 +1247,15 @@ sub matching_types() {
};
}
+sub hasCPUMicrocode() {
+ state $hasCPUMicrocode;
+ if (!defined $hasCPUMicrocode) {
+ eval { modules::load('microcode') };
+ $hasCPUMicrocode = to_bool(find { 'microcode' } modules::loaded_modules());
+ }
+ return $hasCPUMicrocode;
+}
+
sub hasCPUFreq() { require cpufreq; cpufreq::get_modules() }
sub hasWacom() { find { $_->{vendor} == 0x056a || $_->{driver} =~ /wacom/ } usb_probe() }
sub hasTouchpad() { any { $_->{Synaptics} || $_->{ALPS} || $_->{Elantech} } getInputDevices() }