From 6f7b710c51427d1bbe2031376c65fdab1a2f5551 Mon Sep 17 00:00:00 2001 From: Anssi Hannula Date: Sun, 17 Apr 2011 14:01:57 +0000 Subject: Add display_driver_helper script and add/remove nokmsboot boot option as needed. --- lib/Xconfig/main.pm | 1 + lib/Xconfig/various.pm | 15 +++++++++++++++ 2 files changed, 16 insertions(+) (limited to 'lib/Xconfig') 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; -- cgit v1.2.1