summaryrefslogtreecommitdiffstats
path: root/perl-install/any.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/any.pm')
-rw-r--r--perl-install/any.pm172
1 files changed, 61 insertions, 111 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index c291bdae5..e3bc3b3ae 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -116,7 +116,7 @@ sub install_acpi_pkgs {
my $acpi = bootloader::get_append_with_key($b, 'acpi');
my $use_acpi = !member($acpi, 'off', 'ht');
if ($use_acpi) {
- $do_pkgs->ensure_files_are_installed([ [ 'acpi', '/usr/bin/acpi' ], [ 'acpid', '/usr/sbin/acpid' ] ], $::isInstall);
+ $do_pkgs->ensure_files_are_installed([ [ qw(acpi acpi) ], [ qw(acpid acpid) ] ], $::isInstall);
}
require services;
services::set_status($_, $use_acpi, $::isInstall) foreach qw(acpi acpid);
@@ -144,12 +144,6 @@ sub setupBootloaderBefore {
$bootloader->{message_text} = delete $bootloader->{message};
}
- #- remove previous ide-scsi lines
- bootloader::modify_append($bootloader, sub {
- my ($_simple, $dict) = @_;
- @$dict = grep { $_->[1] ne 'ide-scsi' } @$dict;
- });
-
if (cat_("/proc/cmdline") =~ /mem=nopentium/) {
bootloader::set_append_with_key($bootloader, mem => 'nopentium');
}
@@ -240,7 +234,9 @@ sub setupBootloaderUntilInstalled {
my $before = fs::fstab_to_string($all_hds);
setupBootloader($in, $b, $all_hds, $fstab, $security) or $in->exit;
if ($before ne fs::fstab_to_string($all_hds)) {
- #- for /tmp using tmpfs when "clean /tmp" is chosen
+ #- ovitters: This fstab comparison was needed for optionally
+ #- setting up /tmp using tmpfs. That code was removed. Not removing
+ #- this code as I'm not sure if something still relies on this
fs::write_fstab($all_hds);
}
} while !installBootloader($in, $b, $all_hds);
@@ -283,11 +279,6 @@ Assign a new Volume ID?", $dev)))) {
$in->ask_warn('', [ N("Installation of bootloader failed. The following error occurred:"), $err ]);
return;
}
- } elsif (arch() =~ /ppc/) {
- if (detect_devices::get_mac_model() !~ /IBM/) {
- my $of_boot = bootloader::dev2yaboot($b->{boot});
- $in->ask_warn('', N("You may need to change your Open Firmware boot-device to\n enable the bootloader. If you do not 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));
- }
}
1;
}
@@ -299,7 +290,7 @@ sub setupBootloader_simple {
require bootloader;
bootloader::ensafe_first_bios_drive($hds)
- || $b->{bootUnsafe} || arch() =~ /ppc/ or return 1; #- default is good enough
+ || $b->{bootUnsafe} or return 1; #- default is good enough
if (arch() !~ /ia64/) {
setupBootloader__mbr_or_not($in, $b, $hds, $fstab) or return 0;
@@ -315,8 +306,7 @@ sub setupBootloader_simple {
sub setupBootloader__boot_bios_drive {
my ($in, $b, $hds) = @_;
- if (arch() =~ /ppc/ ||
- !is_empty_hash_ref($b->{bios})) {
+ if (!is_empty_hash_ref($b->{bios})) {
#- some bios mapping already there
return 1;
} elsif (bootloader::mixed_kind_of_disks($hds) && $b->{boot} =~ /\d$/) { #- on a partition
@@ -353,14 +343,6 @@ sub setupBootloader__mbr_or_not {
log::l("setupBootloader__mbr_or_not");
- if (arch() =~ /ppc/) {
- if (defined $partition_table::mac::bootstrap_part) {
- $b->{boot} = $partition_table::mac::bootstrap_part;
- log::l("set bootstrap to $b->{boot}");
- } else {
- die "no bootstrap partition - yaboot.conf creation failed";
- }
- } else {
my $floppy = detect_devices::floppy();
my @l = (
@@ -385,15 +367,9 @@ sub setupBootloader__mbr_or_not {
#- remove bios mapping if the user changed the boot device
delete $b->{bios} if $new_boot && $new_boot ne $b->{boot};
$b->{boot} = $new_boot or return;
- }
1;
}
-sub get_apple_boot_parts {
- my ($fstab) = @_;
- map { "/dev/$_" } (map { $_->{device} } (grep { isAppleBootstrap($_) } @$fstab));
-}
-
sub setupBootloader__general {
my ($in, $b, $all_hds, $fstab, $_security) = @_;
@@ -403,18 +379,15 @@ sub setupBootloader__general {
my $prev_enable_apic = my $enable_apic = !bootloader::get_append_simple($b, 'noapic');
my $prev_enable_lapic = my $enable_lapic = !bootloader::get_append_simple($b, 'nolapic');
my $prev_enable_smp = my $enable_smp = !bootloader::get_append_simple($b, 'nosmp');
- my $prev_clean_tmp = my $clean_tmp = any { $_->{mntpoint} eq '/tmp' } @{$all_hds->{special} ||= []};
my $prev_boot = $b->{boot};
my $prev_method = $b->{method};
$b->{password2} ||= $b->{password} ||= '';
$::Wizard_title = N("Boot Style Configuration");
- if (arch() !~ /ppc/) {
my (@boot_devices, %boot_devices);
foreach (bootloader::allowed_boot_parts($b, $all_hds)) {
my $dev = "/dev/$_->{device}";
push @boot_devices, $dev;
- my $desc = formatXiB($_->{size}*512);
my $name = $_->{mntpoint} || $_->{info} || $_->{device_LABEL};
unless ($name) {
$name = formatXiB($_->{size}*512) . " " if $_->{size};
@@ -453,25 +426,7 @@ sub setupBootloader__general {
$ok && $ok2;
} },
{ label => N("Password (again)"), val => \$b->{password2}, hidden => 1 },
- { text => N("Clean /tmp at each boot"), val => \$clean_tmp, type => 'bool', advanced => 1 },
]) or return 0;
- } else {
- $b->{boot} = $partition_table::mac::bootstrap_part;
- $in->ask_from_({ messages => N("Bootloader main options"),
- title => N("Bootloader main options"),
- interactive_help_id => 'setupYabootGeneral',
- }, [
- { label => N("Bootloader to use"), val => \$b->{method},
- list => \@method_choices, format => \&bootloader::method2text },
- { label => N("Init Message"), val => \$b->{'init-message'} },
- { label => N("Boot device"), val => \$b->{boot}, list => [ get_apple_boot_parts($fstab) ] },
- { label => N("Open Firmware Delay"), val => \$b->{delay} },
- { label => N("Kernel Boot Timeout"), val => \$b->{timeout} },
- { label => N("Enable CD Boot?"), val => \$b->{enablecdboot}, type => "bool" },
- { label => N("Enable OF Boot?"), val => \$b->{enableofboot}, type => "bool" },
- { label => N("Default OS?"), val => \$b->{defaultos}, list => [ 'linux', 'macos', 'macosx', 'darwin' ] },
- ]) or return 0;
- }
#- remove bios mapping if the user changed the boot device
delete $b->{bios} if $b->{boot} ne $prev_boot;
@@ -503,14 +458,6 @@ sub setupBootloader__general {
($enable_lapic ? \&bootloader::set_append_simple : \&bootloader::remove_append_simple)->($b, 'lapic');
}
- if ($prev_clean_tmp != $clean_tmp) {
- if ($clean_tmp && !fs::get::has_mntpoint('/tmp', $all_hds)) {
- push @{$all_hds->{special}}, { device => 'none', mntpoint => '/tmp', fs_type => 'tmpfs' };
- } else {
- @{$all_hds->{special}} = grep { $_->{mntpoint} ne '/tmp' } @{$all_hds->{special}};
- }
- }
-
if (bootloader::main_method($prev_method) eq 'lilo' &&
bootloader::main_method($b->{method}) eq 'grub') {
log::l("switching for lilo to grub, ensure we don't read lilo.conf anymore");
@@ -550,9 +497,7 @@ sub setupBootloader__entries {
{ label => N("Xen append"), val => \$e->{xen_append} }
),
if_($b->{password}, { label => N("Requires password to boot"), val => \$e->{lock}, type => "bool" }),
- if_(arch() !~ /ppc|ia64/,
{ label => N("Video mode"), val => \$vga, list => [ '', Xconfig::resolution_and_depth::bios_vga_modes() ], format => \&Xconfig::resolution_and_depth::to_string, advanced => 1 },
-),
{ label => N("Initrd"), val => \$e->{initrd}, list => [ map { if_(/^initrd/, "/boot/$_") } all("$::prefix/boot") ], not_edit => 0, advanced => 1 },
{ label => N("Network profile"), val => \$netprofile, list => [ sort(uniq('', $netprofile, network::network::netprofile_list())) ], advanced => 1 },
);
@@ -561,26 +506,15 @@ sub setupBootloader__entries {
{ label => N("Root"), val => \$e->{kernel_or_dev}, list => [ map { "/dev/$_->{device}" } @$fstab, detect_devices::floppies() ] },
);
}
- if (arch() !~ /ppc/) {
@l = (
{ label => N("Label"), val => \$e->{label} },
@l,
{ text => N("Default"), val => \$default, type => 'bool' },
);
- } else {
- unshift @l, { label => N("Label"), val => \$e->{label}, list => ['macos', 'macosx', 'darwin'] };
- if ($e->{type} eq "image") {
- @l = ({ label => N("Label"), val => \$e->{label} },
- (@l[1..2], { label => N("Append"), val => \$append }),
- { label => N("NoVideo"), val => \$e->{novideo}, type => 'bool' },
- { text => N("Default"), val => \$default, type => 'bool' }
- );
- }
- }
$in->ask_from_(
{
- interactive_help_id => arch() =~ /ppc/ ? 'setupYabootAddEntry' : 'setupBootloaderAddEntry',
+ interactive_help_id => 'setupBootloaderAddEntry',
callbacks => {
complete => sub {
$e->{label} or $in->ask_warn('', N("Empty label not allowed")), return 1;
@@ -604,8 +538,7 @@ sub setupBootloader__entries {
my @labels = map { $_->{label} } @{$b->{entries}};
my ($e, $prefix);
if ($in->ask_from_list_('', N("Which type of entry do you want to add?"),
- [ N_("Linux"), arch() =~ /sparc/ ? N_("Other OS (SunOS...)") : arch() =~ /ppc/ ?
- N_("Other OS (MacOS...)") : N_("Other OS (Windows...)") ]
+ [ N_("Linux"), N_("Other OS (Windows...)") ]
) eq "Linux") {
$e = { type => 'image',
root => '/dev/' . fs::get::root($fstab)->{device}, #- assume a good default.
@@ -613,7 +546,7 @@ sub setupBootloader__entries {
$prefix = "linux";
} else {
$e = { type => 'other' };
- $prefix = arch() =~ /sparc/ ? "sunos" : arch() =~ /ppc/ ? "macos" : "windows";
+ $prefix = "windows";
}
$e->{label} = $prefix;
for (my $nb = 0; member($e->{label}, @labels); $nb++) {
@@ -673,12 +606,13 @@ sub get_autologin() {
my %desktop = getVarsFromSh("$::prefix/etc/sysconfig/desktop");
my $gdm_file = "$::prefix/etc/X11/gdm/custom.conf";
my $kdm_file = common::read_alternative('kdm4-config');
+ my $lightdm_conffile = "$::prefix/etc/lightdm/lightdm.conf.d/50-mageia-autologin.conf";
my $autologin_file = "$::prefix/etc/sysconfig/autologin";
my $desktop = $desktop{DESKTOP} || first(sessions());
my %desktop_to_dm = (
GNOME => 'gdm',
KDE4 => 'kdm',
- xfce4 => 'gdm',
+ xfce4 => 'lightdm',
LXDE => 'lxdm',
);
my %dm_canonical = (
@@ -698,6 +632,9 @@ sub get_autologin() {
} elsif ($dm eq "kdm") {
my %conf = read_gnomekderc($kdm_file, 'X-:0-Core');
$autologin_user = text2bool($conf{AutoLoginEnable}) && $conf{AutoLoginUser};
+ } elsif ($dm eq "lightdm") {
+ my %conf = read_gnomekderc($lightdm_conffile, 'SeatDefaults');
+ $autologin_user = text2bool($conf{'#dummy-autologin'}) && $conf{"autologin-user"};
} else {
my %conf = getVarsFromSh($autologin_file);
$autologin_user = text2bool($conf{AUTOLOGIN}) && $conf{USER};
@@ -712,15 +649,15 @@ sub is_standalone_autologin_needed {
}
sub set_autologin {
- my ($do_pkgs, $autologin) = @_;
+ my ($do_pkgs, $autologin, $o_auto) = @_;
log::l("set_autologin $autologin->{user} $autologin->{desktop}");
my $do_autologin = bool2text($autologin->{user});
$autologin->{dm} ||= 'xdm';
- $do_pkgs->ensure_is_installed($autologin->{dm})
+ $do_pkgs->ensure_is_installed($autologin->{dm}, undef, $o_auto)
or return;
if ($autologin->{user} && is_standalone_autologin_needed($autologin->{dm})) {
- $do_pkgs->ensure_is_installed('autologin', '/usr/bin/startx.autologin')
+ $do_pkgs->ensure_is_installed('autologin', '/usr/bin/startx.autologin', $o_auto)
or return;
}
@@ -738,6 +675,13 @@ sub set_autologin {
AutomaticLogin => $autologin->{user},
)) } if -e $gdm_conffile;
+ #- Configure LIGHTDM
+ my $lightdm_conffile = "$::prefix/etc/lightdm/lightdm.conf.d/50-mageia-autologin.conf";
+ eval { update_gnomekderc($lightdm_conffile, SeatDefaults => (
+ '#dummy-autologin' => $do_autologin,
+ 'autologin-user' => $autologin->{user}
+ )) } if -e $lightdm_conffile;
+
my $xdm_autologin_cfg = "$::prefix/etc/sysconfig/autologin";
# TODO: configure lxdm in /etx/lxdm/lxdm.conf
if (is_standalone_autologin_needed($autologin->{dm})) {
@@ -892,7 +836,7 @@ sub ask_user_and_root {
my $id = $u->{$field} or return 'ok';
my $name = $field eq 'uid' ? N("User ID") : N("Group ID");
$id =~ /^\d+$/ or $in->ask_warn('', N("%s must be a number", $name)), return;
- $id >= 500 or $in->ask_yesorno('', N("%s should be above 500. Accept anyway?", $name)) or return;
+ $id >= 1000 or $in->ask_yesorno('', N("%s should be above 1000. Accept anyway?", $name)) or return;
'ok';
};
my $ret = $in->ask_from_(
@@ -901,7 +845,9 @@ sub ask_user_and_root {
if_($::isInstall && $superuser, cancel => ''),
}, [
$superuser ? (
+ if_(0,
{ text => N("Enable guest account"), val => \$xguest, type => 'bool', advanced => 1 },
+ ),
{ label => N("Set administrator (root) password"), title => 1 },
{ label => N("Password"), val => \$superuser->{password}, hidden => 1, alignment => 'right', weakness_check => 1,
focus => sub { 1 },
@@ -960,18 +906,25 @@ sub sessions_with_order() {
sub urpmi_add_all_media {
my ($in, $o_previous_release) = @_;
- my $binary = find { whereis_binary($_, $::prefix) } 'gurpmi.addmedia', 'urpmi.addmedia' or return;
+ my $binary = find { whereis_binary($_, $::prefix) } if_(check_for_xserver(), 'gurpmi.addmedia'), 'urpmi.addmedia';
+ if (!$binary) {
+ log::l("urpmi.addmedia not found!");
+ return;
+ }
#- configure urpmi media if network is up
require network::tools;
- return if !network::tools::has_network_connection();
+ if (!network::tools::has_network_connection()) {
+ log::l("no network connexion!");
+ return;
+ }
my $wait;
my @options = ('--distrib', '--mirrorlist', '$MIRRORLIST');
if ($binary eq 'urpmi.addmedia') {
$wait = $in->wait_message(N("Please wait"), N("Please wait, adding media..."));
} elsif ($in->isa('interactive::gtk')) {
push @options, '--silent-success';
- mygtk2::flush();
+ mygtk3::flush();
}
my $reason = join(',', $o_previous_release ?
@@ -982,6 +935,7 @@ sub urpmi_add_all_media {
my $log_file = '/root/drakx/updates.log';
my $val = run_program::rooted($::prefix, $binary, '>>', $log_file, '2>>', $log_file, @options);
+
undef $wait;
$val;
}
@@ -1021,33 +975,27 @@ sub display_release_notes {
return;
}
- # workaround too small fonts:
- $release_notes =~ s!(<head>)!$1 <style type="text/css">
- body { font-family: sans-serif; font-size: 13px }
- table { font-family: sans-serif; font-size: 13px }
- </style>!x;
-
- require Gtk2::WebKit;
- require ugtk2;
- ugtk2->import(':all');
- require mygtk2;
- mygtk2->import('gtknew');
+ require Gtk3::WebKit;
+ require ugtk3;
+ ugtk3->import(':all');
+ require mygtk3;
+ mygtk3->import('gtknew');
my $view = gtknew('WebKit_View', no_popup_menu => 1);
$view->load_html_string($release_notes, '/');
- my $w = ugtk2->new(N("Release Notes"), transient => $::main_window, modal => 1, pop_it => 1);
+ my $w = ugtk3->new(N("Release Notes"), transient => $::main_window, modal => 1, pop_it => 1);
gtkadd($w->{rwindow},
- gtkpack_(Gtk2::VBox->new,
- 1, create_scrolled_window(ugtk2::gtkset_border_width($view, 5),
+ gtkpack_(Gtk3::VBox->new,
+ 1, create_scrolled_window(ugtk3::gtkset_border_width($view, 5),
[ 'never', 'automatic' ],
),
0, gtkpack(create_hbox('end'),
gtknew('Button', text => N("Close"),
- clicked => sub { Gtk2->main_quit })
+ clicked => sub { Gtk3->main_quit })
),
),
);
- mygtk2::set_main_window_size($w->{rwindow});
+ mygtk3::set_main_window_size($w->{rwindow});
$w->{real_window}->grab_focus;
$w->{real_window}->show_all;
$w->main;
@@ -1068,7 +1016,7 @@ sub get_release_notes {
my $d = find { -e "$_/$file" } glob_("/usr/share/doc/*-release-*");
$d && cat_("$d/$file");
}
- } "release-notes$ext", 'release-notes.' . arch() . $ext);
+ } "release-notes$ext", 'release-notes.' . $ext);
# we do not handle links:
$release_notes =~ s!<a href=".*?">(.*?)</a>!$1!g;
@@ -1078,6 +1026,7 @@ sub get_release_notes {
sub run_display_release_notes {
my ($release_notes) = @_;
output('/tmp/release_notes.html', $release_notes);
+ local $ENV{LC_ALL} = $::o->{locale}{lang} || 'C';
run_program::raw({ detach => 1 }, '/usr/bin/display_release_notes.pl');
}
@@ -1157,6 +1106,7 @@ sub selectLanguage_install {
the languages you would like to install. They will be available
when your installation is complete and you restart your system.", N("Mageia"))),
advanced_label => N("Multiple languages"),
+ advanced_title => N("Select Additional Languages"),
});
$in->ask_from_($common, [
@@ -1200,7 +1150,7 @@ sub selectLanguage_standalone {
]);
$locale->{utf8} = !$non_utf8;
lang::set($locale);
- Gtk2->set_locale if $in->isa('interactive::gtk');
+ c::init_setlocale() if $in->isa('interactive::gtk');
lang::lang_changed($locale) if $old_lang ne $locale->{lang};
}
@@ -1244,7 +1194,7 @@ sub selectCountry {
$in->ask_from_(
{ title => N("Country / Region"),
messages => N("Please choose your country"),
- interactive_help_id => 'misc-params.html#drakxid-selectCountry',
+ interactive_help_id => 'selectCountry.html',
if_(@best, advanced_messages => N("Here is the full list of available countries")),
advanced_label => @best ? N("Other Countries") : N("Advanced"),
},
@@ -1270,20 +1220,20 @@ sub set_login_serial_console {
substInFile { s/^s$port:.*//; $_ = $line if eof } "$::prefix/etc/inittab";
}
-sub report_bug {
- my (@other) = @_;
-
- sub header { "
+sub header { "
********************************************************************************
* $_[0]
********************************************************************************";
- }
+}
+
+sub report_bug {
+ my (@other) = @_;
join '', map { chomp; "$_\n" }
header("lspci"), detect_devices::stringlist(),
header("pci_devices"), cat_("/proc/bus/pci/devices"),
header("dmidecode"), arch() =~ /86/ ? `dmidecode` : (),
- header("fdisk"), arch() =~ /ppc/ ? `pdisk -l` : `fdisk -l`,
+ header("fdisk"), `fdisk -l`,
header("scsi"), cat_("/proc/scsi/scsi"),
header("/sys/bus/scsi/devices"), -d '/sys/bus/scsi/devices' ? `ls -l /sys/bus/scsi/devices` : (),
header("lsmod"), cat_("/proc/modules"),
@@ -1432,7 +1382,7 @@ sub monitor_full_edid() {
# FIXME: is buggy regarding multiple sessions
sub running_window_manager() {
- my @window_managers = qw(ksmserver kwin gnome-session icewm wmaker afterstep fvwm fvwm2 fvwm95 mwm twm enlightenment xfce4-session blackbox sawfish olvwm fluxbox compiz drakx-matchbox-window-manager lxsession);
+ my @window_managers = qw(drakx-matchbox-window-manager ksmserver kwin gnome-session icewm wmaker afterstep fvwm fvwm2 fvwm95 mwm twm enlightenment xfce4-session blackbox sawfish olvwm fluxbox compiz lxsession);
foreach (@window_managers) {
my @pids = fuzzy_pidofs(qr/\b$_\b/) or next;
@@ -1561,7 +1511,7 @@ sub configure_time_more {
my $tz_prefix = timezone::get_timezone_prefix();
local $ENV{TZ} = ':' . $tz_prefix . '/' . $timezone->{timezone};
- $in->ask_from_({ interactive_help_id => 'misc-params#drakxid-configureTimezoneGMT',
+ $in->ask_from_({ interactive_help_id => 'configureTimezoneUTC',
title => N("Date, Clock & Time Zone Settings"),
}, [
{ label => N("Date, Clock & Time Zone Settings"), title => 1 },