summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-09-05 14:21:48 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-09-05 14:21:48 +0000
commit44b596453c50044debba901575eb015045ae845d (patch)
tree478ad04ac879df73742947911a123b2e7bd82652 /perl-install
parent25365fea641e9e5bcec2372695c9438d099b78eb (diff)
downloaddrakx-44b596453c50044debba901575eb015045ae845d.tar
drakx-44b596453c50044debba901575eb015045ae845d.tar.gz
drakx-44b596453c50044debba901575eb015045ae845d.tar.bz2
drakx-44b596453c50044debba901575eb015045ae845d.tar.xz
drakx-44b596453c50044debba901575eb015045ae845d.zip
no_comment
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/Xconfigurator.pm25
-rw-r--r--perl-install/any.pm18
-rw-r--r--perl-install/fs.pm5
-rw-r--r--perl-install/install_any.pm8
-rw-r--r--perl-install/install_steps_interactive.pm2
-rw-r--r--perl-install/printerdrake.pm8
6 files changed, 30 insertions, 36 deletions
diff --git a/perl-install/Xconfigurator.pm b/perl-install/Xconfigurator.pm
index cbe6e98d8..6c4dadbd4 100644
--- a/perl-install/Xconfigurator.pm
+++ b/perl-install/Xconfigurator.pm
@@ -1110,21 +1110,24 @@ Would you like X to start when you reboot?"), 1);
my %l; @l{@etc_pass_fields} = split ':';
$l{uid} > 500, $l{name};
} cat_("$o->{prefix}/etc/passwd");
- my $cmd = $prefix ? "chroot $prefix" : "";
- my @wm = map { lc } (split (' ', `$cmd /usr/sbin/chksession -l`));
- my $flag='no';
- unless (exists $o->{miscellaneous}{autologuser} || $::auto || !@users || $o->{authentication}{NIS}) {
+
+ unless ($::auto || !@users || $o->{authentication}{NIS}) {
+ my $cmd = $prefix ? "chroot $prefix" : "";
+ my @wm = map { lc } (split (' ', `$cmd /usr/sbin/chksession -l`));
+
+ my %l = getVarsFromSh("$prefix/etc/sysconfig/autologin");
+ $o->{autologin} ||= $l{USER};
+
$in->ask_from_entries_refH(_("Autologin"),
_("I can set up your computer to automatically log on one user.
If you don't want to use this feature, click on the cancel button."),
- [ _("Choose the default user:") => { val => \$o->{miscellaneous}{autologuser}, list => \@users, not_edit => 1},
- _("Choose the window_manager to run:") => { val => \$o->{miscellaneous}{autologwm}, list => \@wm, not_edit => 1}, ])
- ? do { $flag='yes';
- $::isStandalone ? system("urpmi --auto autologin") : $o->pkg_install("autologin");
- } : delete $o->{miscellaneaous}{autologuser};
+ [ _("Choose the default user:") => { val => \$o->{autologin}, list => \@users },
+ _("Choose the window_manager to run:") => { val => \$o->{desktop}, list => \@wm }, ]) or delete $o->{autologin};
+ }
+ if ($o->{autologin}) {
+ $::isStandalone ? system("urpmi --auto autologin") : $o->pkg_install("autologin");
+ any::setAutologin($prefix, $o->{autologin}, $o->{desktop});
}
- any::setAutologin($prefix, $o->{miscellaneous}{autologuser}, $o->{miscellaneous}{autologwm}, "/usr/X11R6/bin/startx", $flag);
-
run_program::rooted($prefix, "chkconfig", "--del", "gpm") if $o->{mouse}{device} =~ /ttyS/ && !$::isStandalone;
}
}
diff --git a/perl-install/any.pm b/perl-install/any.pm
index a74ce59a7..a81fece57 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -122,7 +122,7 @@ sub setupBootloader {
my $silo_install_lang = $silo_install_lang[$b->{use_partition}];
my @l = (
arch() =~ /sparc/ ? (
-_("Bootloader installation") => { val => \$silo_install_lang, list => \@silo_install_lang, not_edit => 1 },
+_("Bootloader installation") => { val => \$silo_install_lang, list => \@silo_install_lang },
) : (
_("Boot device") => { val => \$b->{boot}, list => [ map { "/dev/$_" } (map { $_->{device} } @$hds, @$fstab), detect_devices::floppies() ], not_edit => !$::expert },
_("LBA (doesn't work on old BIOSes)") => { val => \$b->{lba32}, type => "bool", text => "lba" },
@@ -236,19 +236,9 @@ _("Default") => { val => \$default, type => 'bool' },
}
sub setAutologin {
- my ($prefix, $user, $wm, $exe, $flag) = @_;
- my $f = "$prefix/etc/sysconfig/autologin";
- my $t1 = "USER=";
- my $t2 = "EXEC=";
- my $t3 = "AUTOLOGIN=";
- $wm=uc($wm);
- substInFile { s/^(\Q$t1\E|\Q$t2\E|\Q$t3\E).*\n//; $_ .= "$t1$user\n$t2$exe\n$t3=$flag" if eof } $f;
- `chmod 644 $f`;
- local *F;
- open F, ">$prefix/etc/sysconfig/desktop" or die "Can't open $!";
- print F <<END;
-$wm
-END
+ my ($prefix, $user) = @_;
+ setVarsInSh("$prefix/etc/sysconfig/autologin",
+ { USER => $user, AUTOLOGIN => bool2yesno($user), EXEC => "/usr/X11R6/bin/startx" });
}
diff --git a/perl-install/fs.pm b/perl-install/fs.pm
index cd7434edd..7b9563ebb 100644
--- a/perl-install/fs.pm
+++ b/perl-install/fs.pm
@@ -71,8 +71,9 @@ sub get_mntpoints_from_fstab {
$p->{device} eq $_->{device} or next;
$_->{type} ne 'auto' && $_->{type} ne type2fs($p->{type}) and
log::l("err, fstab and partition table do not agree for $_->{device} type: " . (type2fs($p->{type}) || type2name($p->{type})) . " vs $_->{type}"), next;
- $p->{mntpoint} ||= $_->{mntpoint};
- $p->{options} ||= $_->{options};
+ delete $_->{unsafeMntpoint} || !$_->{mntpoint} or next;
+ $p->{mntpoint} = $_->{mntpoint};
+ $p->{options} = $_->{options};
}
}
}
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index 534a24b8c..6d1aaa803 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -622,7 +622,7 @@ sub suggest_mount_points {
);
foreach my $part (@parts) {
- $part->{mntpoint} and next; #- if already found via an fstab
+ $part->{mntpoint} && !$part->{unsafeMntpoint} and next; #- if already found via an fstab
my $handle = any::inspect($part, $prefix) or return;
my $d = $handle->{dir};
@@ -631,7 +631,7 @@ sub suggest_mount_points {
$mnt ||= (grep { -d $_ && (stat($_))[4] >= 500 && -e "$_/.bashrc" } glob_("$d")) ? '/home' : '';
next if $uniq && fsedit::mntpoint2part($mnt, \@parts);
- $part->{mntpoint} = $mnt;
+ $part->{mntpoint} = $mnt; delete $part->{unsafeMntpoint};
#- try to find other mount points via fstab
fs::get_mntpoints_from_fstab(\@parts, $d, $uniq) if $mnt eq '/';
@@ -695,14 +695,14 @@ sub getHds {
} else {
my %w; foreach (@win) {
my $v = $w{$_->{device_windobe}}++;
- $_->{mntpoint} = "/mnt/win_" . lc($_->{device_windobe}) . ($v ? $v+1 : ''); #- lc cuz of StartOffice(!) cf dadou
+ $_->{mntpoint} = $_->{unsafeMntpoint} = "/mnt/win_" . lc($_->{device_windobe}) . ($v ? $v+1 : ''); #- lc cuz of StartOffice(!) cf dadou
}
}
my @sunos = grep { isSunOS($_) && type2name($_->{type}) =~ /root/i } @{$o->{fstab}}; #- take only into account root partitions.
if (@sunos) {
my $v = '';
- map { $_->{mntpoint} = "/mnt/sunos" . ($v && ++$v) } @sunos;
+ map { $_->{mntpoint} = $_->{unsafeMntpoint} = "/mnt/sunos" . ($v && ++$v) } @sunos;
}
#- a good job is to mount SunOS root partition, and to use mount point described here in /etc/vfstab.
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index 7c72309a6..b28942087 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -801,7 +801,7 @@ sub miscellaneous {
!$::beginner || $clicked and $o->ask_from_entries_refH('',
_("Miscellaneous questions"), [
_("Use hard drive optimisations?") => { val => \$u->{HDPARM}, type => 'bool', text => _("(may cause data corruption)") },
-_("Choose security level") => { val => \$s, list => [ map { $l{$_} } ikeys %l ], not_edit => 1 },
+_("Choose security level") => { val => \$s, list => [ map { $l{$_} } ikeys %l ] },
_("Precise RAM size if needed (found %d MB)", availableRam / 1024 + 3) => \$u->{memsize}, #- add three for correction.
arch() !~ /^sparc/ ? (
_("Removable media automounting") => { val => \$o->{useSupermount}, type => 'bool', text => 'supermount' }, ) : (),
diff --git a/perl-install/printerdrake.pm b/perl-install/printerdrake.pm
index 0570bd693..ddc3ba945 100644
--- a/perl-install/printerdrake.pm
+++ b/perl-install/printerdrake.pm
@@ -274,8 +274,8 @@ _("Eject page after job?") => { val => \$printer->{AUTOSENDEOF}, type => 'bool'
_("Resolution") => { val => \$printer->{RESOLUTION}, type => 'list', not_edit => !$::expert, list => \@res } ) : (),
@list_col > 1 ? (
$is_uniprint ? (
-_("Uniprint driver options") => { val => \$printer->{BITSPERPIXEL}, type => 'list', not_edit => 1, list => \@col } ) : (
-_("Color depth options") => { val => \$printer->{BITSPERPIXEL}, type => 'list', not_edit => 1, list => \@col } ), ) : (),
+_("Uniprint driver options") => { val => \$printer->{BITSPERPIXEL}, type => 'list', list => \@col } ) : (
+_("Color depth options") => { val => \$printer->{BITSPERPIXEL}, type => 'list', list => \@col } ), ) : (),
$db_entry{GSDRIVER} ne 'TEXT' && $db_entry{GSDRIVER} ne 'POSTSCRIPT' && $db_entry{GSDRIVER} ne 'ppa' ? (
_("Print text as PostScript?") => { val => \$printer->{ASCII_TO_PS}, type => 'bool' }, ) : (),
#+_("Reverse page order") => { val => \$printer->{REVERSE_ORDER}, type => 'bool' },
@@ -388,7 +388,7 @@ how is the printer connected?"), [
_("Name of printer") => { val => \$printer->{QUEUE} },
_("Description") => { val => \$printer->{Info} },
_("Location") => { val => \$printer->{Location} },
-_("Printer Connection") => { val => \$printer->{str_type}, not_edit => 1, list => [ printer::printer_type($printer) ] },
+_("Printer Connection") => { val => \$printer->{str_type}, list => [ printer::printer_type($printer) ] },
],
) or printer::remove_queue($printer), $continue = 1, last;
} else {
@@ -398,7 +398,7 @@ name (often lp) and a spool directory associated with it. What
name and directory should be used for this queue and how is the printer connected?"), [
_("Name of queue") => { val => \$printer->{QUEUE} },
_("Spool directory") => { val => \$printer->{SPOOLDIR} },
-_("Printer Connection") => { val => \$printer->{str_type}, not_edit => 1, list => [ printer::printer_type($printer) ] },
+_("Printer Connection") => { val => \$printer->{str_type}, list => [ printer::printer_type($printer) ] },
],
changed => sub {
$printer->{SPOOLDIR} = printer::default_spooldir($printer) unless $_[0];