diff options
author | Thierry Vignaud <tv@mandriva.org> | 2009-10-27 10:53:34 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2009-10-27 10:53:34 +0000 |
commit | d4b794c691af933fbbd879cfd72b44955f356485 (patch) | |
tree | 32a76d2c16ef1aced4ba2c1c2a5ed2646407a94b /perl-install/standalone/service_harddrake | |
parent | 56c5afecb85ba2a021eabe31419b31b3b5fd47f5 (diff) | |
download | drakx-backup-do-not-use-d4b794c691af933fbbd879cfd72b44955f356485.tar drakx-backup-do-not-use-d4b794c691af933fbbd879cfd72b44955f356485.tar.gz drakx-backup-do-not-use-d4b794c691af933fbbd879cfd72b44955f356485.tar.bz2 drakx-backup-do-not-use-d4b794c691af933fbbd879cfd72b44955f356485.tar.xz drakx-backup-do-not-use-d4b794c691af933fbbd879cfd72b44955f356485.zip |
reconfigure X11 driver if current X11 driver is neither one of
currently supported driver for the card, nor a legacy driver ('fbdev'
or 'vesa')
Diffstat (limited to 'perl-install/standalone/service_harddrake')
-rwxr-xr-x | perl-install/standalone/service_harddrake | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/perl-install/standalone/service_harddrake b/perl-install/standalone/service_harddrake index 9ae4d126b..59e366296 100755 --- a/perl-install/standalone/service_harddrake +++ b/perl-install/standalone/service_harddrake @@ -15,6 +15,7 @@ use detect_devices; use harddrake::data; use harddrake::autoconf; use harddrake::sound; +use Xconfig::card; use modules; use Storable qw(store retrieve); @@ -59,6 +60,15 @@ if (!member($curr_kernel, chomp_(cat_($known_kernels)))) { append_to_file($known_kernels, "$curr_kernel\n"); } + +sub get_xorg_driver() { + my $x = Xconfig::xfree->read; + if ($x) { + my ($dev_section) = grep { $_->{name} eq 'Device' } @{$x->{raw}}; + $dev_section && $dev_section->{l}{Driver}{val}; + } +} + sub schedule_warn_about_switch() { touch('/var/run/harddrake_swithed_to_free_driver'); touch('/var/run/harddrake-notify-x11-free-driver-switch'); @@ -89,6 +99,16 @@ foreach my $card (@cards) { my $device = find { $_->{driver} =~ /$card->{ldetect_driver_regexp}/ } detect_devices::probeall(); next if !$device; + my $id = $device->{driver} =~ /Card:(.*)/ && $1; + my $card_data = Xconfig::card::readCardsDB("/usr/share/ldetect-lst/Cards+")->{$id}; + my $current_driver = get_xorg_driver(); + + if (!member($current_driver, $card_data->{Driver}, $card_data->{Driver2}, 'fbdev', 'vesa')) { + switch_x_driver($current_driver, $card_data->{Driver}); + schedule_warn_about_switch() if $current_driver =~ $card->{xorg_driver_regexp}; + next; + } + if (find { -e join('', "/lib/modules/", c::kernel_version(), $_) } map { ("/dkms/$_", "/dkms-binary/$_", "/kernel/$_") } map { "/drivers/$_" } map { ("extra/$_", "video/$_", "char/$_", "char/drm/$_") } map { $_, "$_.gz" } @{$card->{module_names}}) { @@ -101,7 +121,6 @@ foreach my $card (@cards) { # s!#*( Load.*glx)!\1!g; # } $_ foreach "/etc/X11/XF86Config-4", "/etc/X11/XF86Config"; } else { - require Xconfig::card; my @cards = Xconfig::card::probe(); my $driver = $cards[0]{Driver}; my $old_driver = $1 if cat_('/etc/X11/xorg.conf') =~ /Driver "($card->{xorg_driver_regexp})"/; |