diff options
Diffstat (limited to 'perl-install/standalone')
-rwxr-xr-x | perl-install/standalone/service_harddrake | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/perl-install/standalone/service_harddrake b/perl-install/standalone/service_harddrake index 870868c0c..d1f2b651d 100755 --- a/perl-install/standalone/service_harddrake +++ b/perl-install/standalone/service_harddrake @@ -34,17 +34,23 @@ $last_boot_config .= '_X11' if $invert_do_it; my $modules_conf = modules::any_conf->read; +my $isLaptop = detect_devices::isLaptop(); my $curr_kernel = c::kernel_version(); $curr_kernel =~ s/(^\d+\.\d+).*/$1/; my %previous_kernel_config = getVarsFromSh("$hw_sysconfdir/kernel"); -setVarsInSh("$hw_sysconfdir/kernel", { KERNEL => $curr_kernel }); +setVarsInSh("$hw_sysconfdir/kernel", { KERNEL => $curr_kernel, IS_LAPTOP => bool2text($isLaptop) }); # autoreconfigure the mouse on major kernel change: if ($curr_kernel ne $previous_kernel_config{KERNEL}) { log::explanations("Autoconfiguring mouse since we switched between 2.4.x and 2.6.x kernels"); harddrake::autoconf::mouse_conf($modules_conf); } +# autoreconfigure laptop-dependent services when switching from laptop to desktop, and vice versa +if (!exists $previous_kernel_config{IS_LAPTOP} || $force || $isLaptop ne to_bool($previous_kernel_config{IS_LAPTOP})) { + log::explanations("Autoconfiguring laptop tools since we switched between laptop and desktop systems"); + harddrake::autoconf::laptop($isLaptop); +} if (find { $_->{driver} =~ /Card:NVIDIA/ } detect_devices::probeall()) { if (find { -e join('', "/lib/modules/", c::kernel_version(), "/kernel/drivers/$_") } map { ("extra/$_", "video/$_", "char/$_", "char/drm/$_") } qw(NVdriver nvidia.o nvidia.o.gz nvidia.ko nvidia.ko.gz)) { |