summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2006-03-03 17:18:00 +0000
committerOlivier Blin <oblin@mandriva.org>2006-03-03 17:18:00 +0000
commit2ec16ef14a1f7bc42ac92255c4f2725fa8c25d10 (patch)
tree552cc1f24140cba211e9c11853de8b16aed05551 /perl-install/standalone
parent88259f712e60642bbd9917d53ca35fc38c4fbdde (diff)
downloaddrakx-2ec16ef14a1f7bc42ac92255c4f2725fa8c25d10.tar
drakx-2ec16ef14a1f7bc42ac92255c4f2725fa8c25d10.tar.gz
drakx-2ec16ef14a1f7bc42ac92255c4f2725fa8c25d10.tar.bz2
drakx-2ec16ef14a1f7bc42ac92255c4f2725fa8c25d10.tar.xz
drakx-2ec16ef14a1f7bc42ac92255c4f2725fa8c25d10.zip
autoconf laptop services when switching between laptop and desktop
Diffstat (limited to 'perl-install/standalone')
-rwxr-xr-xperl-install/standalone/service_harddrake8
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)) {