summaryrefslogtreecommitdiffstats
path: root/lib/Xconfig/various.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Xconfig/various.pm')
-rw-r--r--lib/Xconfig/various.pm15
1 files changed, 15 insertions, 0 deletions
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;