From 8cd07b985ce798656997caa9ae3239855fa47d2a Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 17 Jun 2004 07:49:45 +0000 Subject: autoconfigure mouse when swtiching back between 2.4.x and 2.6.x kernels --- perl-install/standalone/service_harddrake | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'perl-install/standalone') diff --git a/perl-install/standalone/service_harddrake b/perl-install/standalone/service_harddrake index 47e0bcd98..6e95cfdf4 100755 --- a/perl-install/standalone/service_harddrake +++ b/perl-install/standalone/service_harddrake @@ -5,6 +5,7 @@ use lib qw(/usr/lib/libDrakX); use strict; use diagnostics; use standalone; #- warning, standalone must be loaded very first, for 'explanations' +use c; use common; use interactive; use detect_devices; @@ -21,6 +22,13 @@ $last_boot_config .= '_X11' if $invert_do_it; modules::mergein_conf('/etc/modules.conf'); +# autoreconfigure the mouse on major kernel change: +my $prev_kernel = { getVarsFromSh("$hw_sysconfdir/kernel") }->{KERNEL}; +my $curr_kernel = c::kernel_version(); +$curr_kernel =~ s/(^\d+\.\d+).*/\1/; +setVarsInSh("$hw_sysconfdir/kernel", KERNEL => $curr_kernel); +system("mousedrake --auto") if $curr_kernel ne $prev_kernel; + if (find { $_->{driver} =~ /Card:NVIDIA/ } detect_devices::probeall()) { if (find { -e join('', "/lib/modules/", c::kernel_version(), "/kernel/drivers/$_") } map { ("video/$_", "char/$_") } qw(NVdriver nvidia.o nvidia.o.gz nvidia.ko nvidia.ko.gz)) { # log::explanations("switch XFree86 driver from nv to nvidia"); -- cgit v1.2.1