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.pm408
1 files changed, 208 insertions, 200 deletions
diff --git a/perl-install/install/steps_interactive.pm b/perl-install/install/steps_interactive.pm
index 1831f4421..a6f21b2d3 100644
--- a/perl-install/install/steps_interactive.pm
+++ b/perl-install/install/steps_interactive.pm
@@ -1,7 +1,8 @@
-package install::steps_interactive; # $Id$
+package install::steps_interactive;
use strict;
+use feature 'state';
our @ISA = qw(install::steps);
@@ -35,7 +36,7 @@ use log;
#-######################################################################################
sub errorInStep {
my ($o, $err) = @_;
- $err = ugtk2::escape_text_for_TextView_markup_format($err) if $o->isa('install::steps_gtk');
+ $err = ugtk3::escape_text_for_TextView_markup_format($err) if $o->isa('install::steps_gtk');
$o->ask_warn(N("Error"), [ N("An error occurred"), formatError($err) ]);
}
@@ -51,6 +52,8 @@ sub kill_action {
sub acceptLicense {
my ($o) = @_;
+ return if $o->{useless_thing_accepted};
+
any::acceptLicense($o);
}
@@ -72,7 +75,7 @@ fonts, spell checkers, various programs translated etc. that
varies from language to language).")) if $o->{locale}{lang} !~ /^en/ && !lang::load_mo();
} else {
#- no need to have this in po since it is never translated
- $o->ask_warn('', "The characters of your language can not be displayed in console,
+ $o->ask_warn('', "The characters of your language cannot be displayed in console,
so the messages will be displayed in english during installation") if $ENV{LANGUAGE} eq 'C';
}
}
@@ -123,71 +126,79 @@ sub selectKeyboard {
sub selectInstallClass {
my ($o) = @_;
- if (my @l = install::any::find_root_parts($o->{fstab}, $::prefix)) {
- log::l("proposing to upgrade partitions " . join(" ", map { $_->{part} && $_->{part}{device} } @l));
+ return if $::isRestore;
- my @releases = uniq(map { $_->{release} } @l);
- if (@releases != @l) {
- #- same release name so adding the device to differentiate them:
- $_->{release} .= " ($_->{part}{device})" foreach @l;
- }
+ my @l = install::any::find_root_parts($o->{fstab}, $::prefix);
+ # Don't list other archs as ugrading between archs is not supported
+ my $arch = arch() =~ /i.86/ ? $MDK::Common::System::compat_arch{arch()} : arch();
+ # Offer to upgrade only same arch and not mdv-2011+:
+ @l = grep { $_->{arch} eq $arch && $_->{version} !~ /201[1-9]/ } @l;
+ if (@l) {
+ _try_to_upgrade($o, @l);
+ }
+}
- askInstallClass:
- my $p;
- $o->ask_from_({ title => N("Install/Upgrade"),
- interactive_help_id => 'selectInstallClass',
- },
- [
- { label => N("Is this an install or an upgrade?"), title => 1 },
- { val => \$p,
- list => [ @l, N_("_: This is a noun:\nInstall") ],
- type => 'list',
- format => sub { ref($_[0]) ? N("Upgrade %s", $_[0]{release}) : translate($_[0]) }
- } ]);
- if (ref $p) {
- if (arch() =~ /x86_64/ && $p->{arch} eq 'i586') {
- $o->ask_warn('', N("Upgrade from a 32bit to a 64bit distribution is not supported"));
- goto askInstallClass;
- }
- if (arch() =~ /i.86/ && $p->{arch} eq 'x86_64') {
- $o->ask_warn('', N("Upgrade from a 64bit to a 32bit distribution is not supported"));
- goto askInstallClass;
- }
+sub _try_to_upgrade {
+ my ($o, @l) = @_;
+ log::l("proposing to upgrade partitions " . join(" ", map { $_->{part} && $_->{part}{device} } @l));
- _check_unsafe_upgrade_and_warn($o, $p->{part}) or $p = undef;
- }
+ my @releases = uniq(map { "$_->{release} $_->{version}" } @l);
+ if (@releases != @l) {
+ #- same release name so adding the device to differentiate them:
+ $_->{release} .= " ($_->{part}{device})" foreach @l;
+ }
- if (ref $p) {
+ askInstallClass:
+ my $p;
+ $o->ask_from_({ title => N("Install/Upgrade"),
+ interactive_help_id => 'selectInstallClass',
+ },
+ [
+ { label => N("Is this an install or an upgrade?"), title => 1 },
+ { val => \$p,
+ list => [ @l, N_("_: This is a noun:\nInstall") ],
+ type => 'list',
+ format => sub { ref($_[0]) ? N("Upgrade %s", "$_[0]->{release} $_[0]->{version}") : translate($_[0]) }
+ } ]);
+ if (ref $p) {
+ _check_unsafe_upgrade_and_warn($o, $p->{part}) or $p = undef;
+ }
- if ($p->{part}) {
- log::l("choosing to upgrade partition $p->{part}{device}");
- $o->{migrate_device_names} = install::any::use_root_part($o->{all_hds}, $p->{part}, $o);
- }
+ if (ref $p) {
+ _prepare_upgrade($o, $p);
+ }
+}
- #- handle encrypted partitions (esp. /home)
- foreach (grep { $_->{mntpoint} } @{$o->{fstab}}) {
- 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} } ]);
- }
+sub _prepare_upgrade {
+ my ($o, $p) = @_;
+ if ($p->{part}) {
+ log::l("choosing to upgrade partition $p->{part}{device}");
+ $o->{migrate_device_names} = install::any::use_root_part($o->{all_hds}, $p->{part}, $o);
+ }
- $o->{previous_release} = $p;
- $o->{isUpgrade} = (find { $p->{release_file} =~ /$_/ } 'mandriva', 'mandrake', 'conectiva', 'redhat') || 'unknown';
- $o->{upgrade_by_removing_pkgs_matching} ||= {
- conectiva => 'cl',
- redhat => '.', #- everything!
- }->{$o->{isUpgrade}};
- log::l("upgrading $o->{isUpgrade} distribution" . ($o->{upgrade_by_removing_pkgs_matching} ? " (upgrade_by_removing_pkgs_matching $o->{upgrade_by_removing_pkgs_matching})" : ''));
- }
+ #- handle encrypted partitions (esp. /home)
+ foreach (grep { $_->{mntpoint} } @{$o->{fstab}}) {
+ 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->{previous_release} = $p;
+ $o->{isUpgrade} = (find { $p->{release_file} =~ /$_/ } 'mageia', 'mandriva', 'mandrake', 'conectiva', 'redhat') || 'unknown';
+ $o->{upgrade_by_removing_pkgs_matching} ||= {
+ conectiva => 'cl',
+ redhat => '.', #- everything!
+ }->{$o->{isUpgrade}};
+ log::l("upgrading $o->{isUpgrade} distribution" . ($o->{upgrade_by_removing_pkgs_matching} ? " (upgrade_by_removing_pkgs_matching $o->{upgrade_by_removing_pkgs_matching})" : ''));
}
sub _check_unsafe_upgrade_and_warn {
my ($o, $part) = @_;
!_is_unsafe_upgrade($part) || _warn_unsafe_upgrade($o);
}
+
sub _is_unsafe_upgrade {
my ($part) = @_;
@@ -196,6 +207,7 @@ sub _is_unsafe_upgrade {
log::l("block_size $block_size");
$block_size == 1024;
}
+
sub _warn_unsafe_upgrade {
my ($o) = @_;
@@ -208,19 +220,19 @@ sub _warn_unsafe_upgrade {
);
my $choice;
- $o->ask_from_({ messages => N("Installer has detected that your installed Mandriva Linux system could not
+ $o->ask_from_({ messages => N("Installer has detected that your installed Linux system could not
safely be upgraded to %s.
New installation replacing your previous one is recommended.
Warning : you should backup all your personal data before choosing \"New
-Installation\".", 'Mandriva Linux 2009') },
+Installation\".", '%s') },
[ { val => \$choice, type => 'list', list => \@choices, format => \&translate } ]);
log::l("_warn_unsafe_upgrade: got $choice");
if ($choice eq $choices[0]) {
- any::reboot($o);
+ any::reboot();
} elsif ($choice eq $choices[1]) {
undef;
} else {
@@ -239,7 +251,6 @@ sub selectMouse {
if ($o->{mouse}{device} eq "input/mice") {
modules::interactive::load_category($o, $o->{modules_conf}, 'bus/usb', 1, 0);
eval {
- devices::make("usbmouse");
modules::load('usbhid');
};
}
@@ -250,14 +261,14 @@ sub setupSCSI {
install::any::configure_pcmcia($o);
{
- my $_w = $o->wait_message(N("IDE"), N("Configuring IDE"));
+ my $_w = $o->wait_message(N("CD/DVD"), N("Configuring CD/DVD"));
modules::load(modules::category2modules('disk/cdrom'));
}
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, $o->{modules_conf}, 'disk/card_reader|ide|scsi|hardware_raid|sata|firewire', 1, !$have_non_scsi);
- modules::interactive::load_category($o, $o->{modules_conf}, 'disk/card_reader|ide|scsi|hardware_raid|sata|firewire') if !detect_devices::hds(); #- we really want a disk!
+ modules::interactive::load_category($o, $o->{modules_conf}, 'disk/card_reader|ide|scsi|hardware_raid|sata|firewire|virtual', 1, !$have_non_scsi);
+ modules::interactive::load_category($o, $o->{modules_conf}, 'disk/card_reader|ide|scsi|hardware_raid|sata|firewire|virtual') if !detect_devices::hds(); #- we really want a disk!
install::interactive::tellAboutProprietaryModules($o);
@@ -268,34 +279,6 @@ sub setupSCSI {
sub doPartitionDisks {
my ($o) = @_;
- if (arch() =~ /ppc/) {
- my $generation = detect_devices::get_mac_generation();
- if ($generation =~ /NewWorld/) {
- #- mac partition table
- if (defined $partition_table::mac::bootstrap_part) {
- #- do not do anything if we've got the bootstrap setup
- #- otherwise, go ahead and create one somewhere in the drive free space
- } else {
- my $freepart = $partition_table::mac::freepart;
- if ($freepart && $freepart->{size} >= 1) {
- 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");
- my $p = { start => $freepart->{start}, size => MB(1), mntpoint => '' };
- fs::type::set_pt_type($p, 0x401);
- fsedit::add($freepart->{hd}, $p, $o->{all_hds}, { force => 1, primaryOrExtended => 'Primary' });
- $partition_table::mac::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"));
- }
- }
- } elsif ($generation =~ /IBM/) {
- #- dos partition table
- $o->ask_warn('', N("You'll need to create a PPC PReP Boot bootstrap! Install will continue, but to boot your system, you'll need to create the bootstrap partition in DiskDrake"));
- }
- }
-
if (!$o->{isUpgrade}) {
fs::partitioning_wizard::main($o, $o->{all_hds}, $o->{fstab}, $o->{manualFstab}, $o->{partitions}, $o->{partitioning}, $::local_install);
}
@@ -320,11 +303,6 @@ sub formatMountPartitions {
}
#------------------------------------------------------------------------------
-sub setPackages {
- my ($o) = @_;
- install::any::setPackages($o);
-}
-
#- group by CD
sub ask_deselect_media__copy_on_disk {
my ($o, $hdlists, $o_copy_rpms_on_disk) = @_;
@@ -340,13 +318,13 @@ If you want to skip some of them, you can unselect them now.")) },
if_($_ eq $names[0], disabled => sub { 1 }),
} } @names),
if_($o_copy_rpms_on_disk,
- { type => 'label', val => \(formatAlaTeX(N("You have the option to copy the contents of the CDs onto the hard drive before installation.
-It will then continue from the hard drive and the packages will remain available once the system is fully installed."))) },
+ { type => 'label', val => \(formatAlaTeX(N("You have the option to copy the contents of the CDs onto the hard disk drive before installation.
+It will then continue from the hard disk drive and the packages will remain available once the system is fully installed."))) },
{ type => 'bool', text => N("Copy whole CDs"), val => $o_copy_rpms_on_disk },
),
]);
- $_->{selected} = $selection{$_->{name}} foreach @$hdlists;
- log::l("keeping media " . join ',', map { $_->{rpmsdir} } grep { $_->{selected} } @$hdlists);
+ $_->{ignore} = !$selection{$_->{name}} foreach @$hdlists;
+ log::l("keeping media " . join ',', map { $_->{rpmsdir} } grep { !$_->{ignore} } @$hdlists);
}
sub while_suspending_time {
@@ -364,50 +342,35 @@ sub while_suspending_time {
# nb: $file can be a directory
sub ask_change_cd {
- my ($o, $phys_m, $o_rel_file) = @_;
+ my ($o, $medium) = @_;
- while_suspending_time($o, sub { ask_change_cd_($o, $phys_m, $o_rel_file) });
+ while_suspending_time($o, sub { ask_change_cd_($o, $medium) });
}
sub ask_change_cd_ {
- my ($o, $phys_m, $o_rel_file) = @_;
-
- local $| = 1; print "\a";
-
- if ($phys_m->{name} =~ /commercial/i) {
- $o->{useless_thing_accepted2} ||=
- $o->ask_from_list_('', formatAlaTeX(messages::com_license()),
- [ N_("Accept"), N_("Refuse") ], "Accept") eq "Accept" or return;
- }
-
- foreach (1 .. 32) {
- install::media::umount_phys_medium($phys_m);
- install::media::openCdromTray($phys_m->{device});
+ my ($o, $medium) = @_;
+ local $::isWizard = 0; # make button name match text, aka being "cancel" rather than "previous"
$o->ask_okcancel('', N("Change your Cd-Rom!
Please insert the Cd-Rom labelled \"%s\" in your drive and press Ok when done.
-If you do not have it, press Cancel to avoid installation from this Cd-Rom.", $phys_m->{name}), 1) or return;
-
- eval { fs::mount::part($phys_m) };
-
- #- it can be a directory, so don't use -f
- !$o_rel_file || -e install::media::path($phys_m, $o_rel_file) and return 1;
+If you do not have it, press Cancel to avoid installation from this Cd-Rom.", $medium), 1) or return;
- log::l("file " . install::media::path($phys_m, $o_rel_file) . " not found");
- }
- undef;
}
sub selectSupplMedia {
my ($o) = @_;
install::any::selectSupplMedia($o);
}
+
#------------------------------------------------------------------------------
sub choosePackages {
my ($o) = @_;
+ require pkgs;
+ add2hash_($o, { compssListLevel => pkgs::rpmsrate_rate_default() });
+
my $w = $o->wait_message('', N("Looking for available packages..."));
- my $availableC = &install::steps::choosePackages;
+ my $availableC = install::steps::choosePackages($o, pkgs::rpmsrate_rate_max());
require install::pkgs;
@@ -421,11 +384,10 @@ sub choosePackages {
install::steps::rebootNeeded($o);
}
- my $min_mark = 4;
my ($individual, $chooseGroups);
if (!$o->{isUpgrade}) {
- my $tasks_ok = install::pkgs::packageByName($o->{packages}, 'task-kde4') &&
+ my $tasks_ok = install::pkgs::packageByName($o->{packages}, 'task-plasma5-minimal') &&
install::pkgs::packageByName($o->{packages}, 'task-gnome-minimal');
if ($tasks_ok && $availableC >= 2_500_000_000) {
_chooseDesktop($o, $o->{rpmsrate_flags_chosen}, \$chooseGroups);
@@ -437,15 +399,14 @@ sub choosePackages {
}
chooseGroups:
- $o->chooseGroups($o->{packages}, $o->{compssUsers}, $min_mark, \$individual) if $chooseGroups;
+ $o->chooseGroups($o->{packages}, $o->{compssUsers}, \$individual) if $chooseGroups;
($o->{packages_}{ind}) =
- install::pkgs::setSelectedFromCompssList($o->{packages}, $o->{rpmsrate_flags_chosen}, $min_mark, $availableC);
+ install::pkgs::setSelectedFromCompssList($o->{packages}, $o->{rpmsrate_flags_chosen}, $o->{compssListLevel}, $availableC);
$o->choosePackagesTree($o->{packages}) or goto chooseGroups if $individual;
install::any::warnAboutRemovedPackages($o, $o->{packages});
- install::any::warnAboutNaughtyServers($o) or goto chooseGroups if !$o->{isUpgrade};
}
sub choosePackagesTree {
@@ -460,6 +421,7 @@ sub choosePackagesTree {
sort => 1,
});
}
+
sub loadSavePackagesOnFloppy {
my ($o, $packages) = @_;
$o->ask_from('',
@@ -485,20 +447,23 @@ The format is the same as auto_install generated files."),
install::any::g_default_packages($o);
}
}
+
sub _chooseDesktop {
my ($o, $rpmsrate_flags_chosen, $chooseGroups) = @_;
my @l = group_by2(
- KDE => N("KDE"),
+ PLASMA5 => N("Plasma"),
GNOME => N("GNOME"),
Custom => N("Custom"),
);
my $title = N("Desktop Selection");
- my $message = N("You can choose your workstation desktop profile:");
+ my $message = N("You can choose your workstation desktop profile.");
- my $choice;
+ my $default_choice = (find { $rpmsrate_flags_chosen->{"CAT_" . $_->[0]} } @l) || $l[0];
+ my $choice = $default_choice;
if ($o->isa('interactive::gtk')) {
- $choice = install::steps_gtk::reallyChooseDesktop($o, $title, $message, \@l);
+ # perl_checker: require install::steps_gtk
+ $choice = install::steps_gtk::reallyChooseDesktop($o, $title, $message, \@l, $default_choice);
} else {
$o->ask_from_({ title => $title, message => $message }, [
{ val => \$choice, list => \@l, type => 'list', format => sub { $_[0][1] } },
@@ -506,7 +471,7 @@ sub _chooseDesktop {
}
my $desktop = $choice->[0];
log::l("chosen Desktop: $desktop");
- my @desktops = ('KDE', 'GNOME');
+ my @desktops = ('PLASMA5', 'GNOME');
if (member($desktop, @desktops)) {
my ($want, $dontwant) = ($desktop, grep { $desktop ne $_ } @desktops);
$rpmsrate_flags_chosen->{"CAT_$want"} = 1;
@@ -518,8 +483,11 @@ sub _chooseDesktop {
$$chooseGroups = 1;
}
}
+
sub chooseGroups {
- my ($o, $packages, $compssUsers, $min_level, $individual) = @_;
+ my ($o, $packages, $compssUsers, $individual) = @_;
+
+ my $w = $o->wait_message('', N("Looking for available packages..."));
#- for all groups available, determine package which belongs to each one.
#- this will enable getting the size of each groups more quickly due to
@@ -528,15 +496,17 @@ sub chooseGroups {
my $b = install::pkgs::saveSelected($packages);
install::any::unselectMostPackages($o);
- install::pkgs::setSelectedFromCompssList($packages, { CAT_SYSTEM => 1 }, $min_level, 0);
+ install::pkgs::setSelectedFromCompssList($packages, { CAT_SYSTEM => 1 }, $o->{compssListLevel}, 0);
my $system_size = install::pkgs::selectedSize($packages);
- my ($sizes, $pkgs) = install::pkgs::computeGroupSize($packages, $min_level);
+ my ($sizes, $pkgs) = install::pkgs::computeGroupSize($packages, $o->{compssListLevel});
install::pkgs::restoreSelected($b);
log::l("system_size: $system_size");
my %stable_flags = grep_each { $::b } %{$o->{rpmsrate_flags_chosen}};
delete $stable_flags{"CAT_$_"} foreach map { @{$_->{flags}} } @{$o->{compssUsers}};
+ undef $w;
+
my $compute_size = sub {
my %pkgs;
my %flags = %stable_flags; @flags{@_} = ();
@@ -585,35 +555,49 @@ sub chooseGroups {
log::l("compssUsersChoice selected: ", join(', ', map { qq("$_->{path}|$_->{label}") } grep { $_->{selected} } @$compssUsers));
- #- do not try to deselect package (by default no groups are selected).
if (!$o->{isUpgrade}) {
+ #- do not try to deselect package (by default no groups are selected).
install::any::unselectMostPackages($o) if $unselect_all;
+
+ #- if no group have been chosen, ask for using base system only, or no X, or normal.
+ if (!any { $_->{selected} } @$compssUsers) {
+ offer_minimal_options($o) or goto &chooseGroups;
+ }
}
- #- if no group have been chosen, ask for using base system only, or no X, or normal.
- if (!$o->{isUpgrade} && !any { $_->{selected} } @$compssUsers) {
+ 1;
+}
+
+sub offer_minimal_options {
+ my ($o) = @_;
my $docs = !$o->{excludedocs};
- my $minimal;
+ state $minimal;
+ my $recommends = !$o->{no_recommends};
- $o->ask_from(N("Type of install"),
- N("You have not selected any group of packages.
+ $o->ask_from_({ title => N("Type of install"),
+ message => N("You have not selected any group of packages.
Please choose the minimal installation you want:"),
+ interactive_help_id => 'minimal-install'
+ },
[
{ val => \$o->{rpmsrate_flags_chosen}{CAT_X}, type => 'bool', text => N("With X"), disabled => sub { $minimal } },
+ { val => \$recommends, type => 'bool', text => N("Install recommended packages"), 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)") },
],
- ) or return &chooseGroups;
+ ) or return 0;
if ($minimal) {
- $o->{rpmsrate_flags_chosen}{CAT_X} = $docs = 0;
+ $o->{rpmsrate_flags_chosen}{CAT_X} = $docs = $recommends = 0;
$o->{rpmsrate_flags_chosen}{CAT_SYSTEM} = 0;
}
$o->{excludedocs} = !$docs;
$o->{rpmsrate_flags_chosen}{CAT_MINIMAL_DOCS} = $docs;
+ $o->{no_recommends} = !$recommends;
+ $o->{compssListLevel} = pkgs::rpmsrate_rate_max() if !$recommends;
+ log::l("install settings: no_recommends=$o->{no_recommends}, excludedocs=$o->{excludedocs}, really_minimal_install=$minimal");
install::any::unselectMostPackages($o);
- }
- 1;
+ 1;
}
sub reallyChooseGroups {
@@ -623,7 +607,7 @@ sub reallyChooseGroups {
my ($path, $all);
$o->ask_from_({ messages => N("Package Group Selection"),
- interactive_help_id => 'choosePackages',
+ interactive_help_id => 'choosePackageGroups',
}, [
{ val => \$size_text, type => 'label' }, {},
(map {
@@ -648,9 +632,15 @@ sub reallyChooseGroups {
1;
}
+sub beforeInstallPackages {
+ my ($o) = @_;
+ my $_w = $o->{isUpgrade} && $o->wait_message('', N("Preparing upgrade..."));
+ $o->SUPER::beforeInstallPackages;
+}
+
#------------------------------------------------------------------------------
sub installPackages {
- my ($o, $packages) = @_;
+ my ($o) = @_;
my ($current, $total) = (0, 0);
my ($_w, $wait_message) = $o->wait_message_with_progress_bar(N("Installing"));
@@ -668,7 +658,7 @@ sub installPackages {
};
my $install_result;
- catch_cdie { $install_result = $o->install::steps::installPackages($packages) }
+ catch_cdie { $install_result = $o->install::steps::installPackages('interactive') }
sub { installPackages__handle_error($o, $_[0]) };
if ($install::pkgs::cancel_install) {
@@ -740,7 +730,7 @@ sub configureNetwork {
#------------------------------------------------------------------------------
sub installUpdates {
my ($o) = @_;
- my $u = $o->{updates} ||= {};
+ $o->{updates} ||= {};
$o->hasNetwork or return;
@@ -751,6 +741,36 @@ sub installUpdates {
}
$o->ask_yesorno_({ title => N("Updates"), messages => formatAlaTeX(
+N("You now have the opportunity to setup online media.") . "\n\n" .
+N("This allows to install security updates.") . "\n\n" .
+N("To setup those media, you will need to have a working Internet
+connection.
+
+Do you want to setup the update media?")),
+ interactive_help_id => 'installUpdates',
+ }, 1) or do {
+ log::l("installUpdates: skipping since user say no to media setup");
+ return;
+ };
+
+ try_again:
+ #- bring all interface up for installing updates packages.
+ install::interactive::upNetwork($o);
+
+ install::pkgs::clean_rpmdb_shared_regions();
+ if (any::urpmi_add_all_media($o, $o->{previous_release})) {
+ log::l("installUpdates: successfully added media");
+ } else {
+ log::l("installUpdates: failed to add media");
+ if ($o->ask_okcancel(N("Warning"),
+ N("Failure when adding medium") . "\n" . N("Retry?"))) {
+ goto try_again;
+ } else {
+ return 0;
+ }
+ }
+
+ $o->ask_yesorno_({ title => N("Updates"), messages => formatAlaTeX(
N("You now have the opportunity to download updated packages. These packages
have been updated after the distribution was released. They may
contain security or bug fixes.
@@ -760,17 +780,18 @@ connection.
Do you want to install the updates?")),
interactive_help_id => 'installUpdates',
- }, 1) or return;
+ }, 1) or do {
+ log::l("installUpdates: skipping since user say no to updates");
+ return;
+ };
- #- bring all interface up for installing updates packages.
- install::interactive::upNetwork($o);
+ my $binary = find { whereis_binary($_, $::prefix) } if_(check_for_xserver(), 'gurpmi2'), 'urpmi' or return;
+ my $log_file = '/root/drakx/updates.log';
+ run_program::raw({ root => $::prefix, timeout => 'never' }, $binary, '>>', $log_file, '2>>', $log_file, '--auto-select');
- if (any::urpmi_add_all_media($o, $o->{previous_release})) {
- my $binary = find { whereis_binary($_, $::prefix) } 'gurpmi2', 'urpmi' or return;
- run_program::rooted($::prefix, $binary, '--auto-select', '--update');
- }
+ install::pkgs::clean_rpmdb_shared_regions();
- #- not downing network, even ppp. We don't care much since it is the end of install :)
+ #- not downing network, even PPP. We don't care much since it is the end of install :)
}
@@ -845,22 +866,25 @@ sub summary {
$o->pkg_install(map { $_->name } @pkgs) if @pkgs;
lang::write_and_install($o->{locale}, $o->do_pkgs);
- if (!$timezone_manually_set) {
+ if (!$timezone_manually_set && !$o->{isUpgrade}) {
delete $o->{timezone};
install::any::preConfigureTimezone($o); #- now we can precise the timezone thanks to the country
}
},
};
+ local $o->{bootloader}{boot} = 'ESP' if is_uefi();
push @l, {
group => N("System"),
label => N("Bootloader"),
val => sub {
- #-PO: example: lilo-graphic on /dev/hda1
- $o->{bootloader}{boot} ? N("%s on %s", $o->{bootloader}{method}, $o->{bootloader}{boot}) : N("None");
+
+ $o->{bootloader}{boot} ?
+ #-PO: example: grub2-graphic on /dev/sda1
+ N("%s on %s", $o->{bootloader}{method}, $o->{bootloader}{boot}) : N("None");
},
+ if_(is_uefi(), tip => N("EFI System Partition")),
clicked => sub {
any::setupBootloader($o, $o->{bootloader}, $o->{all_hds}, $o->{fstab}, $o->{security}) or return;
- any::installBootloader($o, $o->{bootloader}, $o->{all_hds});
},
} if !$::local_install;
@@ -869,6 +893,9 @@ sub summary {
label => N("User management"),
clicked => sub {
if (my $u = any::ask_user($o, $o->{users}, $o->{security}, needauser => 1)) {
+ #- getpwnam, getgrnam, getgrid works
+ symlinkf("$::prefix/etc/passwd", '/etc/passwd');
+ symlinkf("$::prefix/etc/group", '/etc/group');
any::add_users([$u], $o->{authentication});
}
},
@@ -880,7 +907,7 @@ sub summary {
val => sub {
require services;
my ($l, $activated) = services::services();
- N("Services: %d activated for %d registered", int(@$activated), int(@$l));
+ N("%d activated for %d registered", int(@$activated), int(@$l));
},
clicked => sub {
require services;
@@ -893,17 +920,17 @@ sub summary {
label => N("Keyboard"),
val => sub { $o->{keyboard} && translate(keyboard::keyboard2text($o->{keyboard})) },
clicked => sub { $o->selectKeyboard(1) },
- };
+ } if !$o->{match_all_hardware};
push @l, {
group => N("Hardware"),
label => N("Mouse"),
val => sub { translate($o->{mouse}{type}) . ' ' . translate($o->{mouse}{name}) },
clicked => sub { selectMouse($o, 1); mouse::write($o->do_pkgs, $o->{mouse}) },
- };
+ } if !$o->{match_all_hardware};
- my @sound_cards = detect_devices::getSoundDevices();
+ my @sound_cards = $o->{match_all_hardware} ? () : detect_devices::getSoundDevices();
my $sound_index = 0;
foreach my $device (@sound_cards) {
@@ -922,40 +949,23 @@ sub summary {
$sound_index++;
}
- if (!@sound_cards && ($o->{rpmsrate_flags_chosen}{CAT_GAMES} || $o->{rpmsrate_flags_chosen}{CAT_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, {
- group => N("Hardware"),
- label => N("Sound card"),
- val => sub {},
- clicked => sub {
- if ($o->ask_yesorno('', N("Do you have an ISA sound card?"))) {
- $o->do_pkgs->install(qw(alsa-utils sndconfig aoss));
- $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"));
- }
- },
- };
- }
-
push @l, {
group => N("Hardware"),
label => N("Graphical interface"),
val => sub { $o->{raw_X} ? Xconfig::various::to_string($o->{raw_X}) : '' },
clicked => sub { configureX($o, 'expert') },
- };
+ } if !$o->{match_all_hardware};
push @l, {
group => N("Network & Internet"),
label => N("Network"),
val => sub { $o->{net}{type} },
+ format => sub { $_[0] =~ s/.*:://; $_[0] },
clicked => sub {
require network::netconnect;
network::netconnect::real_main($o->{net}, $o, $o->{modules_conf});
},
- };
+ } if !$o->{match_all_hardware};
$o->{miscellaneous} ||= {};
push @l, {
@@ -967,7 +977,7 @@ sub summary {
network::network::miscellaneous_choose($o, $o->{miscellaneous});
network::network::proxy_configure($o->{miscellaneous}) if !$::testing;
},
- };
+ } if !$o->{match_all_hardware};
push @l, {
group => N("Security"),
@@ -980,13 +990,14 @@ sub summary {
require security::level;
my $security = $o->{security};
set_sec_level:
- if (security::level::level_choose($o, \$security, \$o->{libsafe}, \$o->{security_user})) {
+ if (security::level::level_choose($o, \$security, \$o->{security_user})) {
check_security_level($o, $security) or goto set_sec_level;
$o->{security} = $security;
install::any::set_security($o);
}
},
- };
+ } if -x "$::prefix/usr/sbin/msec";
+ # FIXME: install msec if needed instead
push @l, {
group => N("Security"),
@@ -998,13 +1009,14 @@ sub summary {
},
clicked => sub {
require network::drakfirewall;
- if (my @rc = network::drakfirewall::main($o, $o->{security} <= 3)) {
+ if (my @rc = network::drakfirewall::main($o, $o->{security} < 1)) {
$o->{firewall_ports} = !$rc[0] && $rc[1];
}
},
} if detect_devices::get_net_interfaces();
my $check_complete = sub {
+ return 1 if $o->{match_all_hardware};
require install::pkgs;
my $p = install::pkgs::packageByName($o->{packages}, 'task-x11');
$o->{raw_X} || !$::testing && $p && !$p->flag_installed ||
@@ -1013,6 +1025,7 @@ sub summary {
$o->summary_prompt(\@l, $check_complete);
+ any::installBootloader($o, $o->{bootloader}, $o->{all_hds}) if !$::local_install;
install::steps::configureTimezone($o) if !$timezone_manually_set; #- do not forget it.
}
@@ -1036,24 +1049,19 @@ sub setRootPassword_addUser {
sub setupBootloaderBefore {
my ($o) = @_;
local $o->{pop_wait_messages} = 1;
- my $_w = $o->wait_message(N("Preparing bootloader..."), N("Preparing bootloader..."));
+ my $_w = $o->wait_message(N("Please wait"),
+ #-PO: This is NOT the boot loader (just the kernel initrds)!!!!
+ N("Preparing initial startup program...") . "\n" .
+ N("Be patient, this may take a while...")
+ );
$o->SUPER::setupBootloaderBefore;
}
#------------------------------------------------------------------------------
sub setupBootloader {
my ($o) = @_;
- if (arch() =~ /ppc/) {
- if (detect_devices::get_mac_generation() !~ /NewWorld/ &&
- detect_devices::get_mac_model() !~ /IBM/) {
- $o->ask_warn('', N("You appear to have an OldWorld or Unknown machine, the yaboot bootloader will not work for you. The install will continue, but you'll need to use BootX or some other means to boot your machine. The kernel argument for the root fs is: root=%s", '/dev/' . fs::get::root_($o->{fstab})->{device}));
- log::l("OldWorld or Unknown Machine - no yaboot setup");
- return;
- }
- }
{
any::setupBootloader_simple($o, $o->{bootloader}, $o->{all_hds}, $o->{fstab}, $o->{security}) or return;
- any::installBootloader($o, $o->{bootloader}, $o->{all_hds}) or die "already displayed";
}
}