summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-01-29 17:03:03 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-01-29 17:03:03 +0000
commitb500d1944b7da62c8a0e423962b69b6b29c17cd9 (patch)
tree4d7a780ca3c16eef70739d7248094d2220bef32b
parentc435a9746d42aca721ffa48d3e5c403b126afa9e (diff)
downloaddrakx-backup-do-not-use-b500d1944b7da62c8a0e423962b69b6b29c17cd9.tar
drakx-backup-do-not-use-b500d1944b7da62c8a0e423962b69b6b29c17cd9.tar.gz
drakx-backup-do-not-use-b500d1944b7da62c8a0e423962b69b6b29c17cd9.tar.bz2
drakx-backup-do-not-use-b500d1944b7da62c8a0e423962b69b6b29c17cd9.tar.xz
drakx-backup-do-not-use-b500d1944b7da62c8a0e423962b69b6b29c17cd9.zip
use the new format for combo's to clean code handling {vga} field
-rw-r--r--perl-install/any.pm8
-rw-r--r--perl-install/bootloader.pm33
2 files changed, 16 insertions, 25 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index b27c9df3d..36d6fc954 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -155,7 +155,7 @@ sub setupBootloader {
my $memsize = bootloader::get_append($b, 'mem');
my $prev_clean_tmp = my $clean_tmp = grep { $_->{mntpoint} eq '/tmp' } @{$all_hds->{special} ||= []};
- $b->{vga} ||= 'Normal';
+ $b->{vga} ||= 'normal';
if (arch !~ /ppc/) {
$in->ask_from('', _("Bootloader main options"), [
{ label => _("Bootloader to use"), val => \$bootloader, list => [ keys(%bootloaders) ], format => \&translate },
@@ -165,7 +165,7 @@ sub setupBootloader {
{ label => _("Boot device"), val => \$b->{boot}, list => [ map { "/dev/$_" } (map { $_->{device} } (@$hds, grep { !isFat($_) } @$fstab)), detect_devices::floppies_dev() ], not_edit => !$::expert },
{ label => _("LBA (doesn't work on old BIOSes)"), val => \$b->{lba32}, type => "bool", text => "lba", advanced => 1 },
{ label => _("Compact"), val => \$b->{compact}, type => "bool", text => _("compact"), advanced => 1 },
-{ label => _("Video mode"), val => \$b->{vga}, list => [ keys %bootloader::vga_modes ], not_edit => !$::expert, advanced => 1 },
+{ label => _("Video mode"), val => \$b->{vga}, list => [ keys %bootloader::vga_modes ], not_edit => !$::expert, format => sub { $bootloader::vga_modes{$_[0]} }, advanced => 1 },
),
{ label => _("Delay before booting default image"), val => \$b->{timeout} },
if_($security >= 4,
@@ -210,7 +210,6 @@ sub setupBootloader {
grep_each { $::b } %{$b->{methods}} or return 0;
$b->{use_partition} = $silo_install_lang eq _("First sector of drive (MBR)") ? 0 : 1;
- $b->{vga} = $bootloader::vga_modes{$b->{vga}} || $b->{vga};
bootloader::set_profiles($b, $profiles);
bootloader::add_append($b, "mem", $memsize);
@@ -275,7 +274,7 @@ You can add some more or change the existing ones."),
{ label => _("Root"), val => \$e->{root}, list => [ map { "/dev/$_->{device}" } @$fstab ], not_edit => !$::expert },
{ label => _("Append"), val => \$e->{append} },
if_(arch !~ /ppc|ia64/,
-{ label => _("Video mode"), val => \$e->{vga}, list => [ keys %bootloader::vga_modes ], not_edit => !$::expert },
+{ label => _("Video mode"), val => \$e->{vga}, list => [ keys %bootloader::vga_modes ], format => sub { $bootloader::vga_modes{$_[0]} }, not_edit => !$::expert },
),
{ label => _("Initrd"), val => \$e->{initrd}, list => [ map { s/$prefix//; $_ } glob_("$prefix/boot/initrd*") ] },
{ label => _("Read-write"), val => \$e->{'read-write'}, type => 'bool' }
@@ -322,7 +321,6 @@ if (arch() !~ /ppc/) {
0;
} } }, \@l)) {
$b->{default} = $old_default || $default ? $default && $e->{label} : $b->{default};
- $e->{vga} = $bootloader::vga_modes{$e->{vga}} || $e->{vga};
require bootloader;
bootloader::configure_entry($prefix, $e); #- hack to make sure initrd file are built.
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index 3cbc431a8..a688cd545 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -21,28 +21,21 @@ use modules;
%vga_modes = (
- "Ask at boot" => 'ask',
- "Normal" => 'normal',
- "80x50" => '0x0f01',
- "80x43" => '0x0f02',
- "80x28" => '0x0f03',
- "80x30" => '0x0f04',
- "80x34" => '0x0f05',
- "80x60" => '0x0f06',
- "100x30" => '0x0122',
- "640x480 in 16 bits (FrameBuffer only)" => 785,
- "800x600 in 16 bits (FrameBuffer only)" => 788,
- "1024x768 in 16 bits (FrameBuffer only)" => 791,
- "1280x1024 in 16 bits (FrameBuffer only)" => 794,
+'ask' => "Ask at boot",
+'normal' => "Normal",
+'0x0f01' => "80x50",
+'0x0f02' => "80x43",
+'0x0f03' => "80x28",
+'0x0f04' => "80x30",
+'0x0f05' => "80x34",
+'0x0f06' => "80x60",
+'0x0122' => "100x30",
+ 785 => "640x480 in 16 bits (FrameBuffer only)",
+ 788 => "800x600 in 16 bits (FrameBuffer only)",
+ 791 => "1024x768 in 16 bits (FrameBuffer only)",
+ 794 => "1280x1024 in 16 bits (FrameBuffer only)",
);
-my %vga_modes2nb = (
- 'ask' => -3,
- 'normal' => -1,
-#- other entries are identity
-);
-
-
#-#####################################################################################
#- Functions
#-#####################################################################################