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.pm232
1 files changed, 132 insertions, 100 deletions
diff --git a/perl-install/install/steps_interactive.pm b/perl-install/install/steps_interactive.pm
index e4926cb09..55985e01a 100644
--- a/perl-install/install/steps_interactive.pm
+++ b/perl-install/install/steps_interactive.pm
@@ -1,7 +1,8 @@
-package install::steps_interactive; # $Id: steps_interactive.pm 267011 2010-03-19 12:00:12Z pterjan $
+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) ]);
}
@@ -53,7 +54,7 @@ sub acceptLicense {
my ($o) = @_;
return if $o->{useless_thing_accepted};
- any::acceptLicense($o, $o->{meta_class} eq 'powerpack');
+ any::acceptLicense($o);
}
sub selectLanguage {
@@ -130,7 +131,8 @@ sub selectInstallClass {
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();
- @l = grep { $_->{arch} eq $arch } @l;
+ # 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);
}
@@ -196,6 +198,7 @@ sub _check_unsafe_upgrade_and_warn {
my ($o, $part) = @_;
!_is_unsafe_upgrade($part) || _warn_unsafe_upgrade($o);
}
+
sub _is_unsafe_upgrade {
my ($part) = @_;
@@ -204,6 +207,7 @@ sub _is_unsafe_upgrade {
log::l("block_size $block_size");
$block_size == 1024;
}
+
sub _warn_unsafe_upgrade {
my ($o) = @_;
@@ -247,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');
};
}
@@ -258,7 +261,7 @@ 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);
@@ -276,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);
}
@@ -386,6 +361,7 @@ sub selectSupplMedia {
my ($o) = @_;
install::any::selectSupplMedia($o);
}
+
#------------------------------------------------------------------------------
sub choosePackages {
my ($o) = @_;
@@ -411,7 +387,7 @@ sub choosePackages {
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-plasma-minimal') &&
install::pkgs::packageByName($o->{packages}, 'task-gnome-minimal');
if ($tasks_ok && $availableC >= 2_500_000_000) {
_chooseDesktop($o, $o->{rpmsrate_flags_chosen}, \$chooseGroups);
@@ -445,6 +421,7 @@ sub choosePackagesTree {
sort => 1,
});
}
+
sub loadSavePackagesOnFloppy {
my ($o, $packages) = @_;
$o->ask_from('',
@@ -470,11 +447,12 @@ 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"),
+ PLASMA => N("Plasma"),
GNOME => N("GNOME"),
Custom => N("Custom"),
);
@@ -484,6 +462,7 @@ sub _chooseDesktop {
my $default_choice = (find { $rpmsrate_flags_chosen->{"CAT_" . $_->[0]} } @l) || $l[0];
my $choice = $default_choice;
if ($o->isa('interactive::gtk')) {
+ # 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 }, [
@@ -492,7 +471,7 @@ sub _chooseDesktop {
}
my $desktop = $choice->[0];
log::l("chosen Desktop: $desktop");
- my @desktops = ('KDE', 'GNOME');
+ my @desktops = ('PLASMA', 'GNOME');
if (member($desktop, @desktops)) {
my ($want, $dontwant) = ($desktop, grep { $desktop ne $_ } @desktops);
$rpmsrate_flags_chosen->{"CAT_$want"} = 1;
@@ -504,9 +483,12 @@ sub _chooseDesktop {
$$chooseGroups = 1;
}
}
+
sub chooseGroups {
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
#- limitation of current implementation.
@@ -523,6 +505,8 @@ sub chooseGroups {
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{@_} = ();
@@ -571,41 +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;
- my $suggests;
+ state $minimal;
+ my $recommends = !$o->{no_recommends};
$o->ask_from_({ title => N("Type of install"),
- message =>N("You have not selected any group of packages.
+ message => N("You have not selected any group of packages.
Please choose the minimal installation you want:"),
- interactive_help_id => 'choosePackages#minimal-install'
+ interactive_help_id => 'minimal-install'
},
[
{ val => \$o->{rpmsrate_flags_chosen}{CAT_X}, type => 'bool', text => N("With X"), disabled => sub { $minimal } },
- { val => \$suggests, type => 'bool', text => N("Install suggested packages"), 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 = $suggests = 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_suggests} = !$suggests;
- $o->{compssListLevel} = pkgs::rpmsrate_rate_max() if !$suggests;
+ $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 {
@@ -615,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 {
@@ -640,6 +632,12 @@ sub reallyChooseGroups {
1;
}
+sub beforeInstallPackages {
+ my ($o) = @_;
+ my $_w = $o->{isUpgrade} && $o->wait_message('', N("Preparing upgrade..."));
+ $o->SUPER::beforeInstallPackages;
+}
+
#------------------------------------------------------------------------------
sub installPackages {
my ($o) = @_;
@@ -732,7 +730,7 @@ sub configureNetwork {
#------------------------------------------------------------------------------
sub installUpdates {
my ($o) = @_;
- my $u = $o->{updates} ||= {};
+ $o->{updates} ||= {};
$o->hasNetwork or return;
@@ -743,6 +741,56 @@ 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;
+ };
+
+ my $urpmi_options = { mirror_url => '$MIRRORLIST', downloader => $o->{options}{downloader} };
+
+ try_again:
+ #- bring all interface up for installing updates packages.
+ install::interactive::upNetwork($o);
+
+ any::ask_mirror_and_downloader($o, $urpmi_options);
+
+ if (!any::urpmi_set_downloader($o, $o->{packages}, $urpmi_options->{downloader})) {
+ log::l("installUpdates: failed to change urpmi downloader");
+ local $::isWizard = 0; # make button names "ok" and "cancel", not "next" and "previous"
+ if ($o->ask_okcancel(N("Warning"),
+ N("That downloader could not be installed") . "\n" . N("Retry?"))) {
+ goto try_again;
+ } else {
+ return 0;
+ }
+ }
+
+ if ($urpmi_options->{mirror_url} ne '$MIRRORLIST') {
+ $urpmi_options->{mirror_url} = any::ask_mirror($o, 'distrib', $urpmi_options->{mirror_url});
+ }
+
+ install::pkgs::clean_rpmdb_shared_regions();
+ if (any::urpmi_add_all_media($o, $o->{previous_release}, $urpmi_options->{mirror_url})) {
+ log::l("installUpdates: successfully added media");
+ } else {
+ log::l("installUpdates: failed to add media");
+ local $::isWizard = 0; # make button names "ok" and "cancel", not "next" and "previous"
+ 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.
@@ -752,20 +800,18 @@ connection.
Do you want to install the updates?")),
interactive_help_id => 'installUpdates',
- }, 1) or return;
-
- #- bring all interface up for installing updates packages.
- install::interactive::upNetwork($o);
+ }, 1) or do {
+ log::l("installUpdates: skipping since user say no to updates");
+ return;
+ };
- install::pkgs::clean_rpmdb_shared_regions();
- if (any::urpmi_add_all_media($o, $o->{previous_release})) {
- my $binary = find { whereis_binary($_, $::prefix) } 'gurpmi2', 'urpmi' or return;
+ my $binary = find { whereis_binary($_, $::prefix) } if_(check_for_xserver(), 'gurpmi2'), 'urpmi' or return;
my $log_file = '/root/drakx/updates.log';
- run_program::rooted($::prefix, $binary, '>>', $log_file, '2>>', $log_file, '--auto-select', '--update');
- }
+ run_program::raw({ root => $::prefix, timeout => 'never' }, $binary, '>>', $log_file, '2>>', $log_file, '--auto-select');
+
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 :)
}
@@ -840,19 +886,23 @@ 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;
},
@@ -863,6 +913,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});
}
},
@@ -887,17 +940,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) {
@@ -916,40 +969,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, {
@@ -961,7 +997,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,7 +1016,8 @@ sub summary {
install::any::set_security($o);
}
},
- };
+ } if -x "$::prefix/usr/sbin/msec";
+ # FIXME: install msec if needed instead
push @l, {
group => N("Security"),
@@ -999,6 +1036,7 @@ sub summary {
} 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 ||
@@ -1031,7 +1069,9 @@ sub setRootPassword_addUser {
sub setupBootloaderBefore {
my ($o) = @_;
local $o->{pop_wait_messages} = 1;
- my $_w = $o->wait_message(N("Preparing bootloader..."), N("Preparing bootloader...") . "\n" .
+ 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;
@@ -1040,14 +1080,6 @@ sub 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;
}