summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/install2.pm1
-rw-r--r--perl-install/install_any.pm1
-rw-r--r--perl-install/install_steps_interactive.pm36
3 files changed, 21 insertions, 17 deletions
diff --git a/perl-install/install2.pm b/perl-install/install2.pm
index f81b7ba8d..12fb6e877 100644
--- a/perl-install/install2.pm
+++ b/perl-install/install2.pm
@@ -545,6 +545,7 @@ sub main {
if ($::g_auto_install) {
(my $root = `/bin/pwd`) =~ s|(/[^/]*){5}$||;
symlinkf $root, "/tmp/rhimage" or die "unable to create link /tmp/rhimage";
+ $o->{method} ||= "cdrom";
}
unless ($::testing) {
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index 3bcaecb44..53926c3ec 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -581,6 +581,7 @@ sub loadO {
local $/ = "\0";
no strict;
eval <$fh>;
+ close $fh;
$@ and log::l("Bad kickstart file $f (failed $@)");
}
add2hash_($o ||= {}, $O);
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index 928ca4d25..a0b363efd 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -111,9 +111,8 @@ sub selectInstallClass($@) {
);
my $verifInstallClass = sub {
- $o->{installClass} = $c{$_[0]};
- $::beginner = $o->{installClass} eq "beginner";
- $::expert = $o->{installClass} eq "expert" &&
+ $::beginner = $c{$_[0]} eq "beginner";
+ $::expert = $c{$_[0]} eq "expert" &&
$o->ask_from_list_('',
_("Are you sure you are an expert?
Hey no kidding, you will be allowed powerfull but dangerous things here."),
@@ -124,7 +123,9 @@ Hey no kidding, you will be allowed powerfull but dangerous things here."),
first(list2kv(@c)), ${{reverse %c}}{$o->{installClass}},
[ __("Install"), __("Upgrade") ], $o->{isUpgrade} ? "Upgrade" : "Install") eq "Upgrade";
- unless ($::beginner || $o->{isUpgrade}) {
+ if ($::beginner || $o->{isUpgrade}) {
+ $o->{installClass} = "normal";
+ } else {
my %c = (
normal => _("Normal"),
developer => _("Development"),
@@ -640,14 +641,14 @@ _("Use NIS") => { val => \$o->{authentication}{NIS}, type => 'bool', text => _("
#------------------------------------------------------------------------------
sub addUser($) {
my ($o, $clicked) = @_;
- my $u = $o->{user} ||= $o->{security} < 1 ? { name => "mandrake", passwd => "mandrake", realname => "default" } : {};
+ my $u = $o->{user} ||= $o->{security} < 1 ? { name => "mandrake", password => "mandrake", realname => "default" } : {};
$u->{password2} ||= $u->{password} ||= "";
$u->{shell} ||= "/bin/bash";
$u->{icon} ||= translate('default');
my @fields = qw(realname name password password2);
my @shells = install_any::shells($o);
- if (($o->{security} >= 2 || $clicked) && $o->ask_from_entries_refH(
+ if (($o->{security} >= 2 && !$::beginner || $clicked) && $o->ask_from_entries_refH(
[ _("Add user"), _("Accept user"), $o->{security} >= 4 && !@{$o->{users}} ? () : _("Done") ],
_("Enter a user\n%s", $o->{users} ? _("(already added %s)", join(", ", map { $_->{realname} || $_->{name} } @{$o->{users}})) : ''),
[
@@ -965,7 +966,7 @@ sub setupXfree {
sub generateAutoInstFloppy($) {
my ($o) = @_;
- return unless $::expert && $::corporate;
+ $::expert && $::corporate || $::g_auto_install or return;
my ($floppy) = detect_devices::floppies();
@@ -980,23 +981,24 @@ sub generateAutoInstFloppy($) {
${{ hd => 'hd', cdrom => 'cdrom', ftp => 'network', nfs => 'network', http => 'network' }}{$o->{method}};
if (my $fd = install_any::getFile("$image.img")) {
- my $w = $o->wait_message('', _("Creating auto install floppy"));
- local *OUT;
- open OUT, ">$dev" or log::l("failed to write $dev"), return;
- local $/ = \ (16 * 1024);
- print OUT foreach <$fd>;
+ my $w = $o->wait_message('', _("Creating auto install floppy"));
+ local *OUT;
+ open OUT, ">$dev" or log::l("failed to write $dev"), return;
+ local $/ = \ (16 * 1024);
+ print OUT foreach <$fd>;
}
fs::mount($dev, "/floppy", "vfat", 0);
substInFile { s/timeout.*//; s/^(\s*append)/$1 kickstart=floppy/ } "/floppy/syslinux.cfg";
- local $o->{partitioning}{clearall} = 1;
- install_any::g_auto_install("/floppy/auto_inst.cfg");
-
output "/floppy/ks.cfg", install_any::generate_ks_cfg($o);
- output "/floppy/boot.msg", "0c",
+ output "/floppy/boot.msg", "\n0c",
"!! If you press enter, an auto-install is going to start.
All data on this computer is going to be lost !!
-", "07";
+", "07\n";
+
+ local $o->{partitioning}{clearall} = 1;
+ install_any::g_auto_install("/floppy/auto_inst.cfg");
+
fs::umount("/floppy");
}