summaryrefslogtreecommitdiffstats
path: root/perl-install/install_steps_interactive.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/install_steps_interactive.pm')
-rw-r--r--perl-install/install_steps_interactive.pm254
1 files changed, 135 insertions, 119 deletions
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index 6e2e61270..d8b2a574c 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -1,7 +1,6 @@
package install_steps_interactive; # $Id$
-use diagnostics;
use strict;
use vars qw(@ISA $new_bootstrap);
@@ -12,8 +11,8 @@ use vars qw(@ISA $new_bootstrap);
#- misc imports
#-######################################################################################
use common;
-use partition_table qw(:types);
-use partition_table::raw;
+use partition_table;
+use fs::type;
use install_steps;
use install_interactive;
use install_any;
@@ -29,7 +28,6 @@ use modules::interactive;
use lang;
use keyboard;
use any;
-use fs;
use log;
#-######################################################################################
@@ -75,6 +73,13 @@ so the messages will be displayed in english during installation") if $ENV{LANGU
sub acceptLicense {
my ($o) = @_;
+ $o->{release_notes} = do {
+ my $f = install_any::getFile('release-notes.txt');
+ join('', <$f>);
+ };
+
+ return if $o->{useless_thing_accepted};
+
my $r = $::testing ? 'Accept' : 'Refuse';
($::recovery ?
@@ -83,6 +88,7 @@ sub acceptLicense {
cancel => N("Quit"),
messages => formatAlaTeX(install_messages::main_license() . "\n\n\n" . install_messages::warning_about_patents()),
interactive_help_id => 'acceptLicense',
+ more_buttons => [ [ N("Release Notes"), sub { $o->ask_warn(N("Release Notes"), $o->{release_notes}) }, 1 ] ],
callbacks => { ok_disabled => sub { $r eq 'Refuse' } },
},
[ { list => [ N_("Accept"), N_("Refuse") ], val => \$r, type => 'list', format => sub { translate($_[0]) } } ]))
@@ -123,7 +129,7 @@ sub selectKeyboard {
{ val => \$ext_keyboard, type => 'list', format => $format,
list => [ difference2([ keyboard::KEYBOARDs() ], \@best) ], advanced => @best > 1 }
]);
- $o->{keyboard}{KEYBOARD} = $other ? $ext_keyboard : $KEYBOARD;
+ $o->{keyboard}{KEYBOARD} = @best <= 1 || $other ? $ext_keyboard : $KEYBOARD;
delete $o->{keyboard}{unsafe};
}
keyboard::group_toggle_choose($o, $o->{keyboard}) or goto &selectKeyboard;
@@ -156,15 +162,15 @@ sub selectInstallClass {
if (ref $p) {
my $part = $p->{part};
log::l("choosing to upgrade partition $part->{device}");
- install_any::use_root_part($o->{all_hds}, $part, $o->{prefix});
+ $o->{migrate_device_names} = install_any::use_root_part($o->{all_hds}, $part, $o);
foreach (grep { $_->{mntpoint} } @{$o->{fstab}}) {
- my ($options, $_unknown) = fs::mount_options_unpack($_);
+ my ($options, $_unknown) = fs::mount_options::unpack($_);
$options->{encrypted} or next;
$o->ask_from_({ focus_first => 1 },
[ { label => N("Encryption key for %s", $_->{mntpoint}),
hidden => 1, val => \$_->{encrypt_key} } ]);
}
- $o->{isUpgrade} = 1;
+ $o->{isUpgrade} = $p->{release_file} =~ /redhat/ ? 'redhat' : 'mandrake';
}
}
}
@@ -206,7 +212,7 @@ sub selectMouse {
}
if ($o->{mouse}{device} eq "usbmouse") {
- modules::interactive::load_category($o, 'bus/usb', 1, 1);
+ modules::interactive::load_category($o, $o->{modules_conf}, 'bus/usb', 1, 1);
eval {
devices::make("usbmouse");
modules::load(qw(hid mousedev usbmouse));
@@ -221,9 +227,9 @@ sub setupSCSI {
my ($o) = @_;
if (!$::noauto && arch() =~ /i.86/) {
- if ($o->{pcmcia} ||= !$::testing && c::pcmcia_probe()) {
+ if ($o->{pcmcia} ||= detect_devices::real_pcmcia_probe()) {
my $w = $o->wait_message(N("PCMCIA"), N("Configuring PCMCIA cards..."));
- my $results = install_any::configure_pcmcia($o->{pcmcia});
+ my $results = install_any::configure_pcmcia($o->{modules_conf}, $o->{pcmcia});
undef $w;
$results and $o->ask_warn('', $results);
}
@@ -232,11 +238,11 @@ sub setupSCSI {
my $_w = $o->wait_message(N("IDE"), N("Configuring IDE"));
modules::load(modules::category2modules('disk/cdrom'));
}
- modules::interactive::load_category($o, 'bus/firewire', 1);
+ modules::interactive::load_category($o, $o->{modules_conf}, 'bus/firewire', 1);
my $have_non_scsi = detect_devices::hds(); #- at_least_one scsi device if we have no disks
- modules::interactive::load_category($o, 'disk/scsi|hardware_raid|firewire', 1, !$have_non_scsi);
- modules::interactive::load_category($o, 'disk/scsi|hardware_raid|firewire') if !detect_devices::hds(); #- we really want a disk!
+ modules::interactive::load_category($o, $o->{modules_conf}, 'disk/ide|scsi|hardware_raid|firewire', 1, !$have_non_scsi);
+ modules::interactive::load_category($o, $o->{modules_conf}, 'disk/ide|scsi|hardware_raid|firewire') if !detect_devices::hds(); #- we really want a disk!
install_interactive::tellAboutProprietaryModules($o);
@@ -265,7 +271,7 @@ sub ask_mntpoint_s { #- }{}
[ map { { label => partition_table::description($_),
val => \$_->{mntpoint},
not_edit => 0,
- list => [ '', fsedit::suggestions_mntpoint(fsedit::empty_all_hds()) ] }
+ list => [ '', fsedit::suggestions_mntpoint(fs::get::empty_all_hds()) ] }
} grep { !$_->{real_mntpoint} || common::usingRamdisk() } @fstab ]) or return;
}
$o->SUPER::ask_mntpoint_s($fstab);
@@ -286,7 +292,9 @@ sub doPartitionDisks {
log::l("creating bootstrap partition on drive /dev/$freepart->{hd}{device}, block $freepart->{start}");
$partition_table::mac::bootstrap_part = $freepart->{part};
log::l("bootstrap now at $partition_table::mac::bootstrap_part");
- fsedit::add($freepart->{hd}, { start => $freepart->{start}, size => 1 << 11, pt_type => 0x401, mntpoint => '' }, $o->{all_hds}, { force => 1, primaryOrExtended => 'Primary' });
+ my $p = { start => $freepart->{start}, size => 1 << 11, mntpoint => '' };
+ fs::type::set_pt_type($p, 0x401);
+ fsedit::add($freepart->{hd}, $p, $o->{all_hds}, { force => 1, primaryOrExtended => 'Primary' });
$new_bootstrap = 1;
} else {
$o->ask_warn('', N("No free space for 1MB bootstrap! Install will continue, but to boot your system, you'll need to create the bootstrap partition in DiskDrake"));
@@ -335,7 +343,7 @@ sub choosePartitionsToFormat {
({
text => partition_table::description($e), type => 'bool',
val => \$e->{toFormatTmp}
- }, if_(!isLoopback($_) && !isThisFs("reiserfs", $_) && !isThisFs("xfs", $_) && !isThisFs("jfs", $_), {
+ }, if_(!isLoopback($_) && !member($_->{fs_type}, 'reiserfs', 'xfs', 'jfs'), {
text => partition_table::description($e), type => 'bool', advanced => 1,
disabled => sub { !$e->{toFormatTmp} },
val => \$e->{toFormatCheck}
@@ -344,7 +352,7 @@ sub choosePartitionsToFormat {
#- ok now we can really set toFormat
foreach (@l) {
$_->{toFormat} = delete $_->{toFormatTmp};
- $_->{isFormatted} = 0;
+ set_isFormatted($_, 0);
}
}
@@ -382,6 +390,47 @@ sub setPackages {
pkgs::selectPackagesToUpgrade($o->{packages}, $o->{prefix});
}
}
+
+sub deselectFoundMedia {
+ my ($o, $p) = @_;
+ install_any::deselectFoundMedia($o, $p);
+}
+
+sub mirror2text { $crypto::mirrors{$_[0]} ? $crypto::mirrors{$_[0]}[0] . '|' . $_[0] : "-|URL" }
+sub askSupplMirror {
+ my ($o, $message) = @_;
+ my $u = $o->{updates} ||= {};
+ require crypto;
+ my @mirrors = do {
+ my $_w = $o->wait_message('', N("Contacting Mandrakelinux web site to get the list of available mirrors..."));
+ crypto::mirrors($o->{distro_type});
+ };
+ push @mirrors, '-';
+ $o->ask_from_(
+ {
+ messages => N("Choose a mirror from which to get the packages"),
+ cancel => N("Cancel"),
+ },
+ [ { separator => '|',
+ format => \&mirror2text,
+ list => \@mirrors,
+ val => \$u->{mirror},
+ }, ],
+ ) or $u->{mirror} = '';
+ delete $o->{updates};
+ if ($u->{mirror} eq '-') {
+ return $o->ask_from_entry('', $message) || '';
+ }
+ my $url = "ftp://$u->{mirror}$crypto::mirrors{$u->{mirror}}[1]";
+ $url =~ s/\bmedia\/?$//;
+ log::l("mirror chosen [$url]");
+ return $url;
+}
+
+sub selectSupplMedia {
+ my ($o, $suppl_method) = @_;
+ install_any::selectSupplMedia($o, $suppl_method);
+}
#------------------------------------------------------------------------------
sub choosePackages {
my ($o, $packages, $compssUsers, $_first_time) = @_;
@@ -407,22 +456,23 @@ sub choosePackages {
my $min_mark = 4;
my $b = pkgs::saveSelected($packages);
- my $_level = pkgs::setSelectedFromCompssList($packages, { map { $_ => 1 } map { @{$compssUsers->{$_}{flags}} } @{$o->{compssUsersSorted}} }, $min_mark, 0);
+ my %all_compssUsers_flags = map { $_ => 1 } map { @{$_->{flags}} } @$compssUsers;
+ my $_level = pkgs::setSelectedFromCompssList($packages, \%all_compssUsers_flags, $min_mark, 0);
my $max_size = pkgs::selectedSize($packages) + 1; #- avoid division by zero.
log::l("max size (level $min_mark) is : " . formatXiB($max_size));
pkgs::restoreSelected($b);
undef $w;
chooseGroups:
- $o->chooseGroups($packages, $compssUsers, $min_mark, \$individual, $max_size) if !$o->{isUpgrade} && !$::corporate && $o->{meta_class} ne 'desktop';
+ $o->chooseGroups($packages, $compssUsers, $min_mark, \$individual, $max_size) if !$o->{isUpgrade} && $o->{meta_class} ne 'desktop';
($o->{packages_}{ind}) =
- pkgs::setSelectedFromCompssList($packages, $o->{compssUsersChoice}, $min_mark, $availableC);
+ pkgs::setSelectedFromCompssList($packages, $o->{rpmsrate_flags_chosen}, $min_mark, $availableC);
$o->choosePackagesTree($packages) or goto chooseGroups if $individual;
install_any::warnAboutRemovedPackages($o, $o->{packages});
- install_any::warnAboutNaughtyServers($o) or goto chooseGroups if !$o->{isUpgrade};
+ install_any::warnAboutNaughtyServers($o) or goto chooseGroups if !$o->{isUpgrade} && $o->{meta_class} ne 'firewall';
}
sub choosePackagesTree {
@@ -475,7 +525,6 @@ sub chooseGroups {
#- limitation of current implementation.
#- use an empty state for each one (no flag update should be propagated).
-#- OLD VERSION
my $b = pkgs::saveSelected($packages);
install_any::unselectMostPackages($o);
pkgs::setSelectedFromCompssList($packages, {}, $min_level, $max_size);
@@ -484,9 +533,8 @@ sub chooseGroups {
pkgs::restoreSelected($b);
log::l("system_size: $system_size");
- my @groups = @{$o->{compssUsersSorted}};
- my %stable_flags = grep_each { $::b } %{$o->{compssUsersChoice}};
- delete $stable_flags{$_} foreach map { @{$compssUsers->{$_}{flags}} } @groups;
+ my %stable_flags = grep_each { $::b } %{$o->{rpmsrate_flags_chosen}};
+ delete $stable_flags{$_} foreach map { @{$_->{flags}} } @{$o->{compssUsers}};
my $compute_size = sub {
my %pkgs;
@@ -502,20 +550,16 @@ sub chooseGroups {
next A;
}
}
- log::l("computed size $total_size");
+ log::l("computed size $total_size (flags " . join(' ', keys %flags) . ")");
log::l("chooseGroups: ", join(" ", sort keys %pkgs));
int $total_size;
};
- my %val = map {
- $_ => every { $o->{compssUsersChoice}{$_} } @{$compssUsers->{$_}{flags}}
- } @groups;
-# @groups = grep { $size{$_} = round_down($size{$_} / sqr(1024), 10) } @groups; #- don't display the empty or small one (eg: because all packages are below $min_level)
my ($size, $unselect_all);
my $available_size = install_any::getAvailableSpace($o) / sqr(1024);
my $size_to_display = sub {
- my $lsize = $system_size + $compute_size->(map { @{$compssUsers->{$_}{flags}} } grep { $val{$_} } @groups);
+ my $lsize = $system_size + $compute_size->(map { @{$_->{flags}} } grep { $_->{selected} } @$compssUsers);
#- if a profile is deselected, deselect everything (easier than deselecting the profile packages)
$unselect_all ||= $size > $lsize;
@@ -524,51 +568,51 @@ sub chooseGroups {
};
while (1) {
- if ($available_size < 140) {
+ if ($available_size < 200) {
# too small to choose anything. Defaulting to no group chosen
- $val{$_} = 0 foreach keys %val;
+ $_->{selected} = 0 foreach @$compssUsers;
last;
}
- $o->reallyChooseGroups($size_to_display, $individual, \%val) or return;
+ $o->reallyChooseGroups($size_to_display, $individual, $compssUsers) or return;
- last if $::testing || pkgs::correctSize($size / sqr(1024)) < $available_size;
+ last if $::testing || pkgs::correctSize($size / sqr(1024)) < $available_size || every { !$_->{selected} } @$compssUsers;
$o->ask_warn('', N("Selected size is larger than available space"));
}
- $o->{compssUsersChoice}{$_} = 0 foreach map { @{$compssUsers->{$_}{flags}} } grep { !$val{$_} } keys %val;
- $o->{compssUsersChoice}{$_} = 1 foreach map { @{$compssUsers->{$_}{flags}} } grep { $val{$_} } keys %val;
+ $o->{rpmsrate_flags_chosen}{$_} = 0 foreach map { @{$_->{flags}} } grep { !$_->{selected} } @$compssUsers;
+ $o->{rpmsrate_flags_chosen}{$_} = 1 foreach map { @{$_->{flags}} } grep { $_->{selected} } @$compssUsers;
- log::l("compssUsersChoice: " . (!$val{$_} && "not ") . "selected [$_] as [$o->{compssUsers}{$_}{label}]") foreach keys %val;
+ log::l("compssUsersChoice selected: ", join(', ', map { qq("$_->{path}|$_->{label}") } grep { $_->{selected} } @$compssUsers));
#- do not try to deselect package (by default no groups are selected).
$o->{isUpgrade} or $unselect_all and install_any::unselectMostPackages($o);
#- if no group have been chosen, ask for using base system only, or no X, or normal.
- if (!$o->{isUpgrade} && !any { $_ } values %val) {
+ if (!$o->{isUpgrade} && !any { $_->{selected} } @$compssUsers) {
my $docs = !$o->{excludedocs};
- my $minimal = !any { $_ } values %{$o->{compssUsersChoice}};
+ my $minimal = !any { $_ } values %{$o->{rpmsrate_flags_chosen}};
$o->ask_from(N("Type of install"),
N("You haven't selected any group of packages.
Please choose the minimal installation you want:"),
[
- { val => \$o->{compssUsersChoice}{X}, type => 'bool', text => N("With X"), disabled => sub { $minimal } },
+ { val => \$o->{rpmsrate_flags_chosen}{X}, type => 'bool', text => N("With X"), disabled => sub { $minimal } },
{ val => \$docs, type => 'bool', text => N("With basic documentation (recommended!)"), disabled => sub { $minimal } },
{ val => \$minimal, type => 'bool', text => N("Truly minimal install (especially no urpmi)") },
],
- changed => sub { $o->{compssUsersChoice}{X} = $docs = 0 if $minimal },
+ changed => sub { $o->{rpmsrate_flags_chosen}{X} = $docs = 0 if $minimal },
) or return &chooseGroups;
$o->{excludedocs} = !$docs || $minimal;
#- reselect according to user selection.
if ($minimal) {
- $o->{compssUsersChoice}{$_} = 0 foreach keys %{$o->{compssUsersChoice}};
+ $o->{rpmsrate_flags_chosen}{$_} = 0 foreach keys %{$o->{rpmsrate_flags_chosen}};
} else {
- my $X = $o->{compssUsersChoice}{X}; #- don't let setDefaultPackages modify this one
+ my $X = $o->{rpmsrate_flags_chosen}{X}; #- don't let setDefaultPackages modify this one
install_any::setDefaultPackages($o, 'clean');
- $o->{compssUsersChoice}{X} = $X;
+ $o->{rpmsrate_flags_chosen}{X} = $X;
}
install_any::unselectMostPackages($o);
}
@@ -576,7 +620,7 @@ Please choose the minimal installation you want:"),
}
sub reallyChooseGroups {
- my ($o, $size_to_display, $individual, $val) = @_;
+ my ($o, $size_to_display, $individual, $compssUsers) = @_;
my $size_text = &$size_to_display;
@@ -588,22 +632,22 @@ sub reallyChooseGroups {
{ val => \$size_text, type => 'label' }, {},
(map {
my $old = $path;
- $path = $o->{compssUsers}{$_}{path};
+ $path = $_->{path};
if_($old ne $path, { val => translate($path) }),
{
- val => \$val->{$_},
+ val => \$_->{selected},
type => 'bool',
disabled => sub { $all },
- text => translate($o->{compssUsers}{$_}{label}),
- help => translate($o->{compssUsers}{$_}{descr}),
+ text => translate($_->{label}),
+ help => translate($_->{descr}),
}
- } @{$o->{compssUsersSorted}}),
+ } @$compssUsers),
if_($o->{meta_class} eq 'desktop', { text => N("All"), val => \$all, type => 'bool' }),
if_($individual, { text => N("Individual package selection"), val => $individual, advanced => 1, type => 'bool' }),
]);
if ($all) {
- $val->{$_} = 1 foreach keys %$val;
+ $_->{selected} = 1 foreach @$compssUsers;
}
1;
}
@@ -637,7 +681,9 @@ sub chooseCD {
}
if (install_any::method_is_from_ISO_images($o->{method})) {
- $mediumsDescr{$_} = to_bool(install_any::find_ISO_image_labelled($_)) foreach @mediumsDescr;
+ $mediumsDescr{$_} = install_any::method_is_from_ISO_images($packages->{mediums}{$_}{method})
+ ? to_bool(install_any::find_ISO_image_labelled($_)) : 1
+ foreach @mediumsDescr;
} elsif ($o->{method} eq "cdrom") {
#- if no other medium available or a poor beginner, we are choosing for him!
#- note first CD is always selected and should not be unselected!
@@ -692,7 +738,7 @@ sub installPackages {
my ($method, $medium) = @_;
#- if not using a cdrom medium or an iso image, always abort.
- return unless install_any::method_allows_medium_change($method) && !$::oem;
+ return if !install_any::method_allows_medium_change($method) || $::oem;
my $name = pkgs::mediumDescr($o->{packages}, $medium);
local $| = 1; print "\a";
@@ -742,9 +788,17 @@ sub updateModulesFromFloppy {
#------------------------------------------------------------------------------
sub configureNetwork {
my ($o) = @_;
- require network::network;
- network::network::easy_dhcp($o->{netc}, $o->{intf}) and $o->{netcnx}{type} = 'lan';
- $o->SUPER::configureNetwork;
+ require network::ethernet;
+ modules::load_category($o->{modules_conf}, network::ethernet::get_eth_categories());
+
+ if ($o->{meta_class} eq 'firewall') {
+ require network::netconnect;
+ network::netconnect::main($o->{prefix}, $o->{netcnx} ||= {}, $o, $o->{modules_conf}, $o->{netc}, $o->{mouse}, $o->{intf}, 0, 1);
+ } else {
+ require network::network;
+ network::network::easy_dhcp($o->{modules_conf}, $o->{netc}, $o->{intf}) and $o->{netcnx}{type} = 'lan';
+ $o->SUPER::configureNetwork;
+ }
}
#------------------------------------------------------------------------------
@@ -763,7 +817,7 @@ contain security or bug fixes.
To download these packages, you will need to have a working Internet
connection.
-Do you want to install the updates ?")),
+Do you want to install the updates?")),
interactive_help_id => 'installUpdates',
}) or return;
}
@@ -912,7 +966,7 @@ sub summary {
my @pkgs = pkgs::packagesProviding($o->{packages}, "locales-$pkg_locale");
$o->pkg_install(map { $_->name } @pkgs) if @pkgs;
- lang::write($o->{prefix}, $o->{locale});
+ lang::write($o->{locale});
if (!$timezone_manually_set) {
delete $o->{timezone};
install_any::preConfigureTimezone($o); #- now we can precise the timezone thanks to the country
@@ -930,7 +984,7 @@ sub summary {
group => N("System"),
label => N("Mouse"),
val => sub { translate($o->{mouse}{type}) . ' ' . translate($o->{mouse}{name}) },
- clicked => sub { $o->selectMouse(1); mouse::write($o, $o->{mouse}) },
+ clicked => sub { $o->selectMouse(1); mouse::write($o->do_pkgs, $o->{mouse}) },
};
push @l, {
@@ -968,13 +1022,13 @@ sub summary {
},
clicked => sub {
require harddrake::sound;
- harddrake::sound::config($o, $device);
+ harddrake::sound::config($o, $o->{modules_conf}, $device);
},
};
$sound_index++;
}
- if (!@sound_cards && ($o->{compssUsersChoice}{GAMES} || $o->{compssUsersChoice}{AUDIO})) {
+ if (!@sound_cards && ($o->{rpmsrate_flags_chosen}{GAMES} || $o->{rpmsrate_flags_chosen}{AUDIO})) {
#- if no sound card are detected AND the user selected things needing a sound card,
#- propose a special case for ISA cards
push @l, {
@@ -983,7 +1037,7 @@ sub summary {
val => sub {},
clicked => sub {
if ($o->ask_yesorno('', N("Do you have an ISA sound card?"))) {
- $o->do_pkgs->install(qw(alsaconf sndconfig));
+ $o->do_pkgs->install(qw(alsa-utils sndconfig));
$o->ask_warn('', N("Run \"alsaconf\" or \"sndconfig\" after installation to configure your sound card"));
} else {
$o->ask_warn('', N("No sound card detected. Try \"harddrake\" after installation"));
@@ -999,7 +1053,7 @@ sub summary {
val => sub { $tv->{description} },
clicked => sub {
require harddrake::v4l;
- harddrake::v4l::config($o, $tv->{driver});
+ harddrake::v4l::config($o, $o->{modules_conf}, $tv->{driver});
}
};
}
@@ -1018,7 +1072,7 @@ sub summary {
clicked => sub {
local $::expert = $::expert;
require network::netconnect;
- network::netconnect::main($o->{prefix}, $o->{netcnx} ||= {}, $o, $o->{netc}, $o->{mouse}, $o->{intf}, 0, 1);
+ network::netconnect::main($o->{prefix}, $o->{netcnx} ||= {}, $o, $o->{modules_conf}, $o->{netc}, $o->{mouse}, $o->{intf}, 0, 1);
#- in case netcnx type is not updated.
require network::network;
network::network::probe_netcnx_type($o->{prefix}, $o->{netc}, $o->{intf}, $o->{netcnx});
@@ -1072,7 +1126,10 @@ sub summary {
#-PO: example: lilo-graphic on /dev/hda1
N("%s on %s", $o->{bootloader}{method}, $o->{bootloader}{boot})
},
- clicked => sub { any::setupBootloader($o, $o->{bootloader}, $o->{all_hds}, $o->{fstab}, $o->{security}) },
+ clicked => sub {
+ any::setupBootloader($o, $o->{bootloader}, $o->{all_hds}, $o->{fstab}, $o->{security});
+ any::installBootloader($o, $o->{bootloader}, $o->{all_hds});
+ },
};
push @l, {
@@ -1096,7 +1153,12 @@ sub summary {
$o->summary_prompt(\@l, $check_complete);
- $o->cleanupPrinter;
+ if ($o->{printer}) {
+ #- Clean up $o->{printer} so that the records for an auto-installation
+ #- contain only the important stuff
+ require printer::printerdrake;
+ printer::printerdrake::final_cleanup($o->{printer});
+ }
install_steps::configureTimezone($o) if !$timezone_manually_set; #- do not forget it.
}
@@ -1125,18 +1187,9 @@ sub configurePrinter {
eval { add2hash($printer, printer::main::getinfo($o->{prefix})) };
$printer->{PAPERSIZE} = $o->{locale}{lang} eq 'en_US' || $o->{locale}{country} eq 'CA' ? 'Letter' : 'A4';
- printer::printerdrake::main($printer, $o, $clicked, sub { install_interactive::upNetwork($o, 'pppAvoided') });
+ printer::printerdrake::main($printer, $o->{security}, $o, $clicked, sub { install_interactive::upNetwork($o, 'pppAvoided') });
}
-
-sub cleanupPrinter {
- my ($o) = @_;
- #- Clean up $o->{printer} so that the records for an auto-installation
- #- contain only the important stuff
- return if !defined($o->{printer});
- require printer::printerdrake;
- printer::printerdrake::final_cleanup($o->{printer});
-}
#------------------------------------------------------------------------------
sub setRootPassword {
@@ -1146,29 +1199,7 @@ sub setRootPassword {
if ($o->{security} >= 1 || $clicked) {
require authentication;
- my $authentication_kind = authentication::to_kind($o->{authentication} ||= {});
-
- $o->ask_from_({
- title => N("Set root password and network authentication methods"),
- messages => N("Set root password"),
- interactive_help_id => "setRootPassword",
- cancel => ($o->{security} <= 2 && !$::corporate ?
- #-PO: keep this short or else the buttons will not fit in the window
- N("No password") : ''),
- focus_first => 1,
- callbacks => {
- complete => sub {
- $sup->{password} eq $sup->{password2} or $o->ask_warn('', [ N("The passwords do not match"), N("Please try again") ]), return 1,0;
- length $sup->{password} < 2 * $o->{security}
- and $o->ask_warn('', N("This password is too short (it must be at least %d characters long)", 2 * $o->{security})), return 1,0;
- return 0
- } } }, [
-{ label => N("Password"), val => \$sup->{password}, hidden => 1 },
-{ label => N("Password (again)"), val => \$sup->{password2}, hidden => 1 },
-{ label => N("Authentication"), val => \$authentication_kind, list => [ authentication::kinds() ], format => \&authentication::kind2description, advanced => 1 },
- ]) or delete $sup->{password};
-
- authentication::ask_parameters($o, $o->{netc}, $o->{authentication}, $authentication_kind) or goto &setRootPassword;
+ authentication::ask_root_password_and_authentication($o, $o->{netc}, $sup, $o->{authentication} ||= {}, $o->{meta_class}, $o->{security});
}
install_steps::setRootPassword($o);
}
@@ -1185,7 +1216,7 @@ sub addUser {
if !member('mandrake', map { $_->{name} } @{$o->{users}});
}
if ($o->{security} >= 1 || $clicked) {
- my @suggested_names = @{$o->{users}} ? () : all("$::prefix/home");
+ my @suggested_names = @{$o->{users}} ? () : grep { !/lost\+found/ } all("$::prefix/home");
any::ask_users($o, $o->{users}, $o->{security}, \@suggested_names);
}
add2hash($o, any::get_autologin());
@@ -1225,22 +1256,7 @@ try to force installation even if that destroys the first partition?"));
} else {
any::setupBootloader($o, $o->{bootloader}, $o->{all_hds}, $o->{fstab}, $o->{security}) or return;
}
-
- {
- my $_w = $o->wait_message('', N("Installing bootloader"));
- eval { $o->SUPER::setupBootloader };
- }
- if (my $err = $@) {
- $err =~ s/^\w+ failed// or die;
- $err = formatError($err);
- while ($err =~ s/^Warning:.*//m) {}
- $o->ask_warn('', [ N("Installation of bootloader failed. The following error occured:"), $err ]);
- die "already displayed";
- } elsif (arch() =~ /ppc/) {
- my $of_boot = cat_("$o->{prefix}/tmp/of_boot_dev") || die "Can't open $o->{prefix}/tmp/of_boot_dev";
- chop($of_boot);
- $o->ask_warn('', N("You may need to change your Open Firmware boot-device to\n enable the bootloader. If you don't see the bootloader prompt at\n reboot, hold down Command-Option-O-F at reboot and enter:\n setenv boot-device %s,\\\\:tbxi\n Then type: shut-down\nAt your next boot you should see the bootloader prompt.", $of_boot));
- }
+ any::installBootloader($o, $o->{bootloader}, $o->{all_hds}) or die "already displayed";
}
}
@@ -1251,7 +1267,7 @@ sub miscellaneous {
require security::level;
security::level::level_choose($o, \$o->{security}, \$o->{libsafe}, \$o->{security_user});
- if ($o->{security} > 2 && find { isFat($_) } @{$o->{fstab}}) {
+ if ($o->{security} > 2 && find { $_->{fs_type} eq 'vfat' } @{$o->{fstab}}) {
$o->ask_okcancel('', N("In this security level, access to the files in the Windows partition is restricted to the administrator."))
or goto &miscellaneous;
}