From 111351ee1d42eaf8812fc8ebbbe232d216462422 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sun, 17 Jan 2021 13:31:09 +0000 Subject: Factor out detection of kernel boot options (to simplify next commit). --- perl-install/standalone/service_harddrake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'perl-install/standalone') diff --git a/perl-install/standalone/service_harddrake b/perl-install/standalone/service_harddrake index fb813e84f..d69af68bd 100755 --- a/perl-install/standalone/service_harddrake +++ b/perl-install/standalone/service_harddrake @@ -37,6 +37,10 @@ my $force = member('--force', @ARGV); my $reboot_needed; my $do_udev_settle; +my $cmdline = cat_("/proc/cmdline"); +my $noxconf = $cmdline =~ /\bnoxconf\b/; +my $nokmsboot = $cmdline =~ /\bnokmsboot\b/; + my $invert_do_it = $ARGV[0] eq 'X11' ? 1 : 0; my ($hw_sysconfdir, $timeout) = ("/etc/sysconfig/harddrake2", $invert_do_it ? 600 : 25); my $last_boot_config = "$hw_sysconfdir/previous_hw"; @@ -357,7 +361,7 @@ foreach my $hw_class (@harddrake::data::tree) { modules::load_category($modules_conf, 'bus/usb'); $modules_conf->write; } elsif ($Ident eq "VIDEO") { - next if cat_("/proc/cmdline") =~ /noxconf/; + next if $noxconf; # explicitely NOT read the existing config (eg: new profile with globetrotter) harddrake::autoconf::xconf($modules_conf, {}, member($cfg{SETUP_FB}, qw(NO no)), $cfg{RESOLUTION_WANTED}); $reboot_needed |= after_x_driver_switch(); @@ -425,7 +429,7 @@ if (!$reboot_needed && text2bool($cfg{HANDLE_KMS_BOOT_CONFIG})) { $reboot_needed |= $kms_changed; if (!$reboot_needed) { my $kms_allowed = system("display_driver_helper", "--is-kms-allowed") == 0; - if (!$kms_allowed && cat_("/proc/cmdline") !~ /\bnokmsboot\b/) { + if (!$kms_allowed && !$nokmsboot) { # Wrong driver loaded and boot parameters incorrect, but fixing the # bootloader configuration failed. # Possibly a direct boot from another bootloader. -- cgit v1.2.1