summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAnssi Hannula <anssi@mageia.org>2011-04-17 14:01:57 +0000
committerAnssi Hannula <anssi@mageia.org>2011-04-17 14:01:57 +0000
commit6f7b710c51427d1bbe2031376c65fdab1a2f5551 (patch)
treef6c47470998c3f73ba8df0a9f148e540bdc700a7 /lib
parentf2771a7825bdbc12bfc0ab7ea0aeb89cb5c72d15 (diff)
downloaddrakx-kbd-mouse-x11-6f7b710c51427d1bbe2031376c65fdab1a2f5551.tar
drakx-kbd-mouse-x11-6f7b710c51427d1bbe2031376c65fdab1a2f5551.tar.gz
drakx-kbd-mouse-x11-6f7b710c51427d1bbe2031376c65fdab1a2f5551.tar.bz2
drakx-kbd-mouse-x11-6f7b710c51427d1bbe2031376c65fdab1a2f5551.tar.xz
drakx-kbd-mouse-x11-6f7b710c51427d1bbe2031376c65fdab1a2f5551.zip
Add display_driver_helper script and add/remove nokmsboot boot option as needed.
Diffstat (limited to 'lib')
-rw-r--r--lib/Xconfig/main.pm1
-rw-r--r--lib/Xconfig/various.pm15
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/Xconfig/main.pm b/lib/Xconfig/main.pm
index 7400ed9..694c4f4 100644
--- a/lib/Xconfig/main.pm
+++ b/lib/Xconfig/main.pm
@@ -208,6 +208,7 @@ sub write {
my $only_resolution = $raw_X->is_only_resolution_modified;
$raw_X->write;
Xconfig::various::check_xorg_conf_symlink();
+ Xconfig::various::setup_kms();
if ($X->{resolutions}[0]{bios}) {
Xconfig::various::setupFB($X->{resolutions}[0]{bios}) if !$o_skip_fb_setup;;
'need_reboot';
diff --git a/lib/Xconfig/various.pm b/lib/Xconfig/various.pm
index 516bd12..ab077f5 100644
--- a/lib/Xconfig/various.pm
+++ b/lib/Xconfig/various.pm
@@ -393,4 +393,19 @@ sub setupFB {
}, $bios_vga_mode);
}
+sub setup_kms {
+ change_bootloader_config(
+ sub {
+ my ($bootloader) = @_;
+ my $kms_ok = run_program::rooted($::prefix, "/sbin/display_driver_helper", "--is-kms-allowed") || 0;
+ return if $kms_ok != bootloader::get_append_simple($bootloader, "nokmsboot");
+ if ($kms_ok) {
+ bootloader::remove_append_simple($bootloader, "nokmsboot");
+ } else {
+ bootloader::set_append_simple($bootloader, "nokmsboot");
+ }
+ 1;
+ });
+}
+
1;