summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2003-07-23 14:51:13 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2003-07-23 14:51:13 +0000
commit57105fe0f0fb3cdc2898ad92ae4860e8352d8897 (patch)
tree0b665a83a1df4886b78da956912a4a583c100ec0 /perl-install
parentfa00bbe656c20cc82af802313af0d229582c2eee (diff)
downloaddrakx-57105fe0f0fb3cdc2898ad92ae4860e8352d8897.tar
drakx-57105fe0f0fb3cdc2898ad92ae4860e8352d8897.tar.gz
drakx-57105fe0f0fb3cdc2898ad92ae4860e8352d8897.tar.bz2
drakx-57105fe0f0fb3cdc2898ad92ae4860e8352d8897.tar.xz
drakx-57105fe0f0fb3cdc2898ad92ae4860e8352d8897.zip
new autologin scheme (spec87): directly configure display manager
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/any.pm32
1 files changed, 26 insertions, 6 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index 14d7872df..0e52930ce 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -457,23 +457,43 @@ sub pack_passwd {
sub get_autologin {
my ($_o) = @_;
- my %l = getVarsFromSh("$::prefix/etc/sysconfig/autologin");
my %desktop = getVarsFromSh("$::prefix/etc/sysconfig/desktop");
- { autologin => text2bool($l{AUTOLOGIN}) && $l{USER}, desktop => $desktop{DESKTOP} };
+ my $dm = $desktop{DISPLAYMANAGER};
+ my $desktop = $desktop{DESKTOP} || 'KDE';
+ if ($desktop{DISPLAYMANAGER} eq 'GNOME') {
+ my %l = getVarsFromSh("$::prefix/etc/X11/gdm/gdm.conf");
+ return { autologin => text2bool($l{AutomaticLoginEnable}) && $l{AutomaticLogin}, desktop => $desktop };
+ } else { # KDM / MdkKDM
+ my %l = getVarsFromSh("$::prefix/usr/share/config/kdm/kdmrc");
+ return { autologin => text2bool($l{AutoLoginEnable}) && $l{AutoLoginUser}, desktop => $desktop };
+ }
}
sub set_autologin {
my ($user, $desktop) = @_;
-
+ print "\n\nconfig => ($user, $desktop)\n";
+ my $autologin = bool2text($user);
+ my $found;
+ # Configure KDM / MDKKDM
+ substInFile {
+ s/^(AutoLoginEnable=).*/$1$autologin/;
+ $found ||= s/^(AutoLoginUser=).*/$1$user/;
+ } "$::prefix/usr/share/config/kdm/kdmrc";
+ substInFile {
+ s/^(AutoLoginEnable=.*)$/$1\nAutoLoginUser=$user/;
+ } "$::prefix/usr/share/config/kdm/kdmrc" if !$found;
+ # Configure GDM
+ substInFile {
+ s/^(AutomaticLoginEnable=).*/$1$autologin/;
+ s/^(AutomaticLogin=).*/$1$user/;
+ } "$::prefix/etc/X11/gdm/gdm.conf";
+
if ($user) {
my %l = getVarsFromSh("$::prefix/etc/sysconfig/desktop");
$l{DESKTOP} = $desktop;
setVarsInSh("$::prefix/etc/sysconfig/desktop", \%l);
log::l("cat $::prefix/etc/sysconfig/desktop ($desktop):\n", cat_("$::prefix/etc/sysconfig/desktop"));
}
- setVarsInShMode("$::prefix/etc/sysconfig/autologin", 0644,
- { USER => $user, AUTOLOGIN => bool2yesno($user), EXEC => "/usr/X11R6/bin/startx.autologin" });
- log::l("cat $::prefix/etc/sysconfig/autologin ($user):\n", cat_("$::prefix/etc/sysconfig/autologin"));
}
sub rotate_log {