diff options
author | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2018-11-04 14:52:58 +0000 |
---|---|---|
committer | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2018-11-04 21:26:19 +0000 |
commit | 2b7939fa62a89129c5a86e2acc85a20a459f8ff8 (patch) | |
tree | b511e1e08b1c9fe382f1ac4cb975a5c913a02ae2 /perl-install | |
parent | 924042fea828994a5ec3937a81bcd1ffd0f72b69 (diff) | |
download | drakx-2b7939fa62a89129c5a86e2acc85a20a459f8ff8.tar drakx-2b7939fa62a89129c5a86e2acc85a20a459f8ff8.tar.gz drakx-2b7939fa62a89129c5a86e2acc85a20a459f8ff8.tar.bz2 drakx-2b7939fa62a89129c5a86e2acc85a20a459f8ff8.tar.xz drakx-2b7939fa62a89129c5a86e2acc85a20a459f8ff8.zip |
Adapt drakdm and set_autologin for display-manager service, not prefdm (mga#22593)
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/NEWS | 2 | ||||
-rw-r--r-- | perl-install/any.pm | 11 | ||||
-rw-r--r-- | perl-install/install/NEWS | 1 | ||||
-rwxr-xr-x | perl-install/standalone/drakedm | 19 |
4 files changed, 20 insertions, 13 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS index 62302778f..98a1ceced 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,3 +1,5 @@ +- adapt drakdm and set_autologin for display-manager service, not prefdm (mga#22593) + Version 18.3 - 12 Oct 2018 - drakboot: diff --git a/perl-install/any.pm b/perl-install/any.pm index 13229965e..b12b9785f 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -770,15 +770,9 @@ sub get_autologin() { xfce4 => 'lightdm', LXDE => 'lxdm', ); - my %dm_canonical = ( - gnome => 'gdm', - plasma => 'sddm', - ); my $dm = - lc($desktop{DISPLAYMANAGER}) || - $desktop_to_dm{$desktop} || - basename(chomp_(run_program::rooted_get_stdout($::prefix, "/etc/X11/lookupdm"))); - $dm = $dm_canonical{$dm} if exists $dm_canonical{$dm}; + basename(readlink("$::prefix/etc/systemd/system/display-manager.service")) =~ s/(.*)\.service/$1/r || + $desktop_to_dm{$desktop}; my $autologin_user; if ($dm eq "gdm") { @@ -872,6 +866,7 @@ sub set_autologin { $desktop{DESKTOP} = $autologin->{desktop}; $desktop{DISPLAYMANAGER} = $autologin->{dm}; setVarsInSh($sys_conffile, \%desktop); + symlinkf("/usr/lib/systemd/system/$autologin->{dm}.service", "$::prefix/etc/systemd/system/display-manager.service"); if ($autologin->{user}) { my $home = (getpwnam($autologin->{user}))[7]; diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS index 1c715fecc..08ef72f32 100644 --- a/perl-install/install/NEWS +++ b/perl-install/install/NEWS @@ -1,3 +1,4 @@ +- adapt set_autologin for display-manager service, not prefdm (mga#22593) - drakx-in-chroot: o allow monitor-edid to be suppressed in post-install scriptlets diff --git a/perl-install/standalone/drakedm b/perl-install/standalone/drakedm index a8be26875..6e7d42304 100755 --- a/perl-install/standalone/drakedm +++ b/perl-install/standalone/drakedm @@ -47,8 +47,8 @@ if (!$::expert) { @list = grep { -e $_->{EXEC} } @list; } -my ($dm_NAME) = cat_($cfg_file) =~ /^DISPLAYMANAGER=(.*)/m; -my $dm = (find { uc($_->{NAME}) eq uc($dm_NAME) } @list) || $list[0]; +my $dm_name = basename(readlink("/etc/systemd/system/display-manager.service")) =~ s/(.*)\.service/$1/r; +my $dm = (find { basename($_->{EXEC}) eq $dm_name } @list) || $list[0]; start: if ($in->ask_from(N("Choosing a display manager"), @@ -68,12 +68,21 @@ several different X sessions on your local machine at the same time.")), && $dm ) { $in->do_pkgs->ensure_is_installed($dm->{PACKAGE}, $dm->{EXEC}) or goto start; - addVarsInSh($cfg_file, { DISPLAYMANAGER => $dm->{NAME} }); - log::explanations(qq(Switching to "$dm->{NAME}" display manager)); - if (any::running_window_manager()) { + $dm_name = basename($dm->{EXEC}); + addVarsInSh($cfg_file, { DISPLAYMANAGER => $dm_name }); + symlinkf("/usr/lib/systemd/system/$dm_name.service", "$::prefix/etc/systemd/system/display-manager.service"); + log::explanations(qq(Switching to "$dm_name" display manager)); + # martinw: I can't find a way to get a clean switch between display managers when one is running. + # But keep the old code (to preserve the translations) in case someone else can. + my $can_switch_cleanly = 0; + if ($can_switch_cleanly && any::running_window_manager()) { $in->ask_yesorno('', N("The change is done, do you want to restart the dm service?"), 1) and $in->ask_yesorno('', N("You are going to close all running programs and lose your current session. Are you really sure that you want to restart the dm service?"), 1) and run_program::raw({ detach => 1 }, 'systemctl', 'restart', 'display-manager.service', '>', '/dev/null', '2>', '/dev/null'); + } elsif (any::running_window_manager()) { + $in->ask_warn('', N("The change is done and will take effect when you next boot the system")); + } else { + run_program::run('systemctl', 'daemon-reload'); } } |