diff options
author | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2018-11-20 18:33:44 +0000 |
---|---|---|
committer | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2018-11-20 20:47:48 +0000 |
commit | f6fb10dd51fff62d4ff274829f1b33a4cca68f0b (patch) | |
tree | 775ff3e14f4ade19165a7eaf8605366077396822 /perl-install/any.pm | |
parent | 8e28fd495cf50d4b2e446f309004bec938b91d4f (diff) | |
download | drakx-f6fb10dd51fff62d4ff274829f1b33a4cca68f0b.tar drakx-f6fb10dd51fff62d4ff274829f1b33a4cca68f0b.tar.gz drakx-f6fb10dd51fff62d4ff274829f1b33a4cca68f0b.tar.bz2 drakx-f6fb10dd51fff62d4ff274829f1b33a4cca68f0b.tar.xz drakx-f6fb10dd51fff62d4ff274829f1b33a4cca68f0b.zip |
Fix DM preference when none is selected.
/etc/X11/lookupdm has been removed from initscripts, but we still need
that functionality to select the preferred DM during installation.
Diffstat (limited to 'perl-install/any.pm')
-rw-r--r-- | perl-install/any.pm | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm index 0c7110da9..8cd3ead4c 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -756,6 +756,15 @@ sub adapt_desktop_for_plasma { return $desktop ? ($h{$desktop} || lc($desktop)) . '.desktop' : ''; } +sub available_dms() { + my @l; + foreach (glob("$::prefix/usr/share/X11/dm.d/*.conf")) { + my %dm = getVarsFromSh($_); + push @l, $dm{EXEC} if $dm{EXEC}; + } + @l; +} + sub get_autologin() { my %desktop = getVarsFromSh("$::prefix/etc/sysconfig/desktop"); my $gdm_file = "$::prefix/etc/X11/gdm/custom.conf"; @@ -772,7 +781,8 @@ sub get_autologin() { ); my $dm = basename(readlink("$::prefix/etc/systemd/system/display-manager.service")) =~ s/(.*)\.service/$1/r || - $desktop_to_dm{$desktop}; + $desktop_to_dm{$desktop} || + basename(first(available_dms())); my $autologin_user; if ($dm eq "gdm") { |