summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorAnssi Hannula <anssi@mageia.org>2011-04-17 14:34:04 +0000
committerAnssi Hannula <anssi@mageia.org>2011-04-17 14:34:04 +0000
commita34368be185d66de0cd5c590744e8d2e23833ada (patch)
treec631de954532b51125cabc2fdaeb5505a6beeacf /perl-install
parent3f902d7b206ba62b09d834df7056e473ea632128 (diff)
downloaddrakx-a34368be185d66de0cd5c590744e8d2e23833ada.tar
drakx-a34368be185d66de0cd5c590744e8d2e23833ada.tar.gz
drakx-a34368be185d66de0cd5c590744e8d2e23833ada.tar.bz2
drakx-a34368be185d66de0cd5c590744e8d2e23833ada.tar.xz
drakx-a34368be185d66de0cd5c590744e8d2e23833ada.zip
service_harddrake: Add or remove nokmsboot option if an unoptimal or fatal situation is detected.
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/NEWS2
-rwxr-xr-xperl-install/standalone/service_harddrake13
2 files changed, 14 insertions, 1 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS
index 3f36442dd..f3a09f6cc 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -1,6 +1,6 @@
- service_harddrake:
o adapt splash handling for plymouth (for showing dialogs)
- o add/remove nokmsboot boot option if needed when switching the driver
+ o add/remove nokmsboot boot option if needed
o ask for a reboot after a driver switch if needed, and load the new driver
if no reboot is needed
o do not switch a display driver if speedboot has already started X server,
diff --git a/perl-install/standalone/service_harddrake b/perl-install/standalone/service_harddrake
index bc4e13aea..c4be98a0b 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);