diff options
Diffstat (limited to 'perl-install/any.pm')
-rw-r--r-- | perl-install/any.pm | 48 |
1 files changed, 34 insertions, 14 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm index 9737b264f..23313c5f6 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -60,17 +60,24 @@ sub setupBootloader { my @l = (__("First sector of drive (MBR)"), __("First sector of boot partition")); $in->set_help('setupBootloaderBeginner') unless $::isStandalone; - my $boot = $hds->[0]{device}; - my $onmbr = "/dev/$boot" eq $b->{boot}; - $b->{boot} = "/dev/" . ($in->ask_from_list_(_("LILO/grub Installation"), - _("Where do you want to install the bootloader?"), - \@l, $l[!$onmbr]) eq $l[0] - ? $boot : fsedit::get_root($fstab, 'boot')->{device}); + if (arch() =~ /sparc/) { + $b->{use_partition} = $in->ask_from_list_(_("SILO Installation"), + _("Where do you want to install the bootloader?"), + \@l, $l[$b->{use_partition}]); + } else { + my $boot = $hds->[0]{device}; + my $onmbr = "/dev/$boot" eq $b->{boot}; + $b->{boot} = "/dev/" . ($in->ask_from_list_(_("LILO/grub Installation"), + _("Where do you want to install the bootloader?"), + \@l, $l[!$onmbr]) eq $l[0] + ? $boot : fsedit::get_root($fstab, 'boot')->{device}); + } } elsif ($more || !$::beginner) { - $in->set_help("setupBootloaderGeneral") unless $::isStandalone; + $in->set_help(arch() =~ /sparc/ ? "setupSILOGeneral" : "setupBootloaderGeneral") unless $::isStandalone; #- TO MERGE ? if ($::expert) { - my $m = $in->ask_from_list_('', _("Which bootloader(s) do you want to use?"), [ keys(%{$b->{methods}}), __("None") ], 'grub') or return; + my $default = arch() =~ /sparc/ ? 'silo' : 'grub'; + my $m = $in->ask_from_list_('', _("Which bootloader(s) do you want to use?"), [ keys(%{$b->{methods}}), __("None") ], $default) or return; $b->{methods}{$_} = 0 foreach keys %{$b->{methods}}; $b->{methods}{$m} = 1 if $m ne "None"; } @@ -80,19 +87,25 @@ sub setupBootloader { #- put lilo if grub is chosen, so that /etc/lilo.conf is generated exists $b->{methods}{lilo} and $b->{methods}{lilo} = 1 if $b->{methods}{grub}; + my @silo_install_lang = (_("First sector of drive (MBR)"), _("First sector of boot partition")); + my $silo_install_lang = $silo_install_lang[$b->{use_partition}]; my @l = ( +arch() =~ /sparc/ ? ( +_("Bootloader installation") => { val => \$silo_install_lang, list => \@silo_install_lang, not_edit => 1 }, +) : ( _("Boot device") => { val => \$b->{boot}, list => [ map { "/dev/$_" } (map { $_->{device} } @$hds, @$fstab), detect_devices::floppies() ], not_edit => !$::expert }, _("LBA (doesn't work on old BIOSes)") => { val => \$b->{lba32}, type => "bool", text => "lba" }, _("Compact") => { val => \$b->{compact}, type => "bool", text => _("compact") }, +_("Video mode") => { val => \$b->{vga}, list => [ keys %bootloader::vga_modes ], not_edit => $::beginner }, +), _("Delay before booting default image") => \$b->{timeout}, -_("Video mode") => { val => \$b->{vga}, list => [ keys %lilo::vga_modes ], not_edit => $::beginner }, $security < 4 ? () : ( _("Password") => { val => \$b->{password}, hidden => 1 }, _("Password (again)") => { val => \$b->{password2}, hidden => 1 }, _("Restrict command line options") => { val => \$b->{restricted}, type => "bool", text => _("restrict") }, ) ); - @l = @l[0..3] unless $::expert; + @l = @l[0..3] unless $::expert; #- take "bootloader installation" and "delay before ..." on SPARC. $b->{vga} ||= 'Normal'; $in->ask_from_entries_refH('', _("Bootloader main options"), \@l, @@ -103,11 +116,12 @@ _("Restrict command line options") => { val => \$b->{restricted}, type => "bool" 0; } ) or return 0; - $b->{vga} = $lilo::vga_modes{$b->{vga}} || $b->{vga}; + $b->{use_partition} = $silo_install_lang eq _("First sector of drive (MBR)") ? 0 : 1; + $b->{vga} = $bootloader::vga_modes{$b->{vga}} || $b->{vga}; } until ($::beginner && $more <= 1) { - $in->set_help('setupBootloaderAddEntry') unless $::isStandalone; + $in->set_help(arch() =~ /sparc/ ? 'setupSILOAddEntry' : 'setupBootloaderAddEntry') unless $::isStandalone; my $c = $in->ask_from_list_([''], _("Here are the different entries. You can add some more or change the existing ones."), @@ -120,12 +134,14 @@ You can add some more or change the existing ones."), if ($c eq "Add") { my @labels = map { $_->{label} } @{$b->{entries}}; my $prefix; - if ($in->ask_from_list_('', _("Which type of entry do you want to add?"), [ __("Linux"), __("Other OS (windows...)") ]) eq "Linux") { + if ($in->ask_from_list_('', _("Which type of entry do you want to add?"), + [ __("Linux"), arch() =~ /sparc/ ? __("Other OS (SunOS...)") : __("Other OS (windows...)") ] + ) eq "Linux") { $e = { type => 'image' }; $prefix = "linux"; } else { $e = { type => 'other' }; - $prefix = "windows"; + $prefix = arch() =~ /sparc/ ? "sunos" : "windows"; } $e->{label} = $prefix; for (my $nb = 0; member($e->{label}, @labels); $nb++) { $e->{label} = "$prefix-$nb" } @@ -149,8 +165,10 @@ _("Read-write") => { val => \$e->{'read-write'}, type => 'bool' } } else { @l = ( _("Root") => { val => \$e->{kernel_or_dev}, list => [ map { "/dev/$_->{device}" } @$fstab ], not_edit => !$::expert }, +arch() !~ /sparc/ ? ( _("Table") => { val => \$e->{table}, list => [ '', map { "/dev/$_->{device}" } @$hds ], not_edit => !$::expert }, _("Unsafe") => { val => \$e->{unsafe}, type => 'bool' } +) : (), ); @l = @l[0..1] unless $::expert; } @@ -168,6 +186,8 @@ _("Default") => { val => \$default, type => 'bool' }, 0; })) { $b->{default} = $old_default || $default ? $default && $e->{label} : $b->{default}; + require bootloader; + bootloader::configure_entry($prefix, $e); #- hack to make sure initrd file are built. push @{$b->{entries}}, $e if $c eq "Add"; } else { |