summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2009-10-27 10:53:32 +0000
committerThierry Vignaud <tv@mandriva.org>2009-10-27 10:53:32 +0000
commit56c5afecb85ba2a021eabe31419b31b3b5fd47f5 (patch)
tree2c2e739881ffb1f4bf492cc6a8bb93790e764b53
parent58fe324b7742e6058d64500dc924ce431eedc161 (diff)
downloaddrakx-56c5afecb85ba2a021eabe31419b31b3b5fd47f5.tar
drakx-56c5afecb85ba2a021eabe31419b31b3b5fd47f5.tar.gz
drakx-56c5afecb85ba2a021eabe31419b31b3b5fd47f5.tar.bz2
drakx-56c5afecb85ba2a021eabe31419b31b3b5fd47f5.tar.xz
drakx-56c5afecb85ba2a021eabe31419b31b3b5fd47f5.zip
(schedule_warn_about_switch, switch_x_driver) split them out (needed
for next commits)
-rwxr-xr-xperl-install/standalone/service_harddrake21
1 files changed, 15 insertions, 6 deletions
diff --git a/perl-install/standalone/service_harddrake b/perl-install/standalone/service_harddrake
index 05f33d44a..9ae4d126b 100755
--- a/perl-install/standalone/service_harddrake
+++ b/perl-install/standalone/service_harddrake
@@ -59,6 +59,19 @@ if (!member($curr_kernel, chomp_(cat_($known_kernels)))) {
append_to_file($known_kernels, "$curr_kernel\n");
}
+sub schedule_warn_about_switch() {
+ touch('/var/run/harddrake_swithed_to_free_driver');
+ touch('/var/run/harddrake-notify-x11-free-driver-switch');
+}
+
+sub switch_x_driver {
+ my ($old_driver, $new_driver) = @_;
+ cp_af('/etc/X11/xorg.conf', "/etc/X11/xorg.conf.mdv$^T");
+ substInFile { s!Driver "($old_driver)"!Driver "$new_driver"!g } '/etc/X11/xorg.conf';
+ log::explanations("switch X.org driver from $old_driver to $new_driver");
+ Xconfig::card::libgl_config_and_more({ Driver => $new_driver });
+}
+
my @cards = (
{
ldetect_driver_regexp => 'Card:NVIDIA',
@@ -93,12 +106,8 @@ foreach my $card (@cards) {
my $driver = $cards[0]{Driver};
my $old_driver = $1 if cat_('/etc/X11/xorg.conf') =~ /Driver "($card->{xorg_driver_regexp})"/;
if ($old_driver) {
- cp_af('/etc/X11/xorg.conf', "/etc/X11/xorg.conf.mdv$^T");
- substInFile { s!Driver "($card->{xorg_driver_regexp})"!Driver "$driver"!g } '/etc/X11/xorg.conf';
- touch('/var/run/harddrake_swithed_to_free_driver');
- log::explanations("switch X.org driver from $old_driver to $driver");
- touch('/var/run/harddrake-notify-x11-free-driver-switch');
- Xconfig::card::libgl_config_and_more({ Driver => $driver });
+ switch_x_driver($card->{xorg_driver_regexp}, $driver);
+ schedule_warn_about_switch();
}
}
}