From 3842c37f38800bcb693f2ee51568348fce920303 Mon Sep 17 00:00:00 2001 From: Anssi Hannula Date: Sun, 17 Apr 2011 11:08:18 +0000 Subject: service_harddrake: Add or remove nokmsboot option if an unoptimal or fatal situation is detected. --- perl-install/standalone/service_harddrake | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'perl-install/standalone/service_harddrake') diff --git a/perl-install/standalone/service_harddrake b/perl-install/standalone/service_harddrake index c47b9fa96..54f45c284 100755 --- a/perl-install/standalone/service_harddrake +++ b/perl-install/standalone/service_harddrake @@ -61,6 +61,7 @@ my %cfg = getVarsFromSh("$hw_sysconfdir/service.conf"); # default to 'yes' on upgrade: $cfg{AUTORECONFIGURE_RIGHT_XORG_DRIVER} = 'yes' if !exists $cfg{AUTORECONFIGURE_RIGHT_XORG_DRIVER}; +$cfg{HANDLE_KMS_BOOT_CONFIG} = 'yes' if !exists $cfg{HANDLE_KMS_BOOT_CONFIG}; # autoreconfigure laptop-dependent services when switching from laptop to desktop, and vice versa if (!exists $previous_kernel_config{IS_LAPTOP} || $force || $isLaptop != text2bool($previous_kernel_config{IS_LAPTOP})) { @@ -253,6 +254,18 @@ foreach my $card (@cards) { } } +if (!$reboot_needed && text2bool($cfg{HANDLE_KMS_BOOT_CONFIG})) { + if (-x "/sbin/display_driver_helper" && system("display_driver_helper", "--check-loaded") != 0) { + # incorrect driver is loaded, X.org can't start (e.g. proprietary driver loaded while free driver in use, + # or free driver loaded while vesa is configured). + $reboot_needed |= Xconfig::various::setup_kms(); + } elsif (!$reboot_needed && -e "/dev/.late_kms") { + # initrd didn't load the KMS driver; non-fatal but ugly, fix it for next boot + unlink("/dev/.late_kms"); + Xconfig::various::setup_kms(); + } +} + my $is_globetrotter = -f '/usr/sbin/mdkmove'; my (%config, $wait); -- cgit v1.2.1