summaryrefslogtreecommitdiffstats
path: root/perl-install/bootloader.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-07-27 10:31:34 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-07-27 10:31:34 +0000
commit0306ad0100b9d40606d723706f909438a27dfac1 (patch)
tree232eab774506632a3796a5a36cf09771aa614e64 /perl-install/bootloader.pm
parent54a662b712a584c66a9f5762d264cce50acbb6ab (diff)
downloaddrakx-0306ad0100b9d40606d723706f909438a27dfac1.tar
drakx-0306ad0100b9d40606d723706f909438a27dfac1.tar.gz
drakx-0306ad0100b9d40606d723706f909438a27dfac1.tar.bz2
drakx-0306ad0100b9d40606d723706f909438a27dfac1.tar.xz
drakx-0306ad0100b9d40606d723706f909438a27dfac1.zip
- add field {fs_type} partially replacing {pt_type}
{pt_type} is always a number, {fs_type} is always a string - introduce set_isFormatted() (to ensure {notFormatted} but also {fs_type_from_magic} and {bad_fs_type_magic} are updated) - don't use 0x483 for ext3 anymore (same for reiserfs...), the type_name gives both a pt_type and a fs_type - many accessors from partition_table removed (type2fs(), fs2pt_type()) - remove isThisFs() (not useful anymore since we can use directly {fs_type}) - remove isFat() (inline the function) - other isXXX() from partition_table are moved to fs::type - part2name() is now fs::type::part2type_name - name2pt_type() is now fs::type::type_name2subpart() - partition_table::important_types() is now fs::type::type_names() - fsedit::typeOfPart() is now fs::type::fs_type_from_magic() - no need to truncate type_name since they are shorter
Diffstat (limited to 'perl-install/bootloader.pm')
-rw-r--r--perl-install/bootloader.pm16
1 files changed, 10 insertions, 6 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index 62ae0e16e..8481d0445 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -8,7 +8,8 @@ use vars qw(%vga_modes);
#- misc imports
#-######################################################################################
use common;
-use partition_table qw(:types);
+use partition_table;
+use fs::type;
use log;
use any;
use fsedit;
@@ -583,7 +584,7 @@ sub suggest {
my $root = '/dev/' . (isLoopback($root_part) ? 'loop7' : $root_part->{device});
my $boot = fsedit::get_root($fstab, 'boot')->{device};
#- PPC xfs module requires enlarged initrd
- my $xfsroot = isThisFs("xfs", $root_part);
+ my $xfsroot = $root_part->{fs_type} eq 'xfs';
my ($onmbr, $unsafe) = $bootloader->{crushMbr} ? (1, 0) : suggest_onmbr($hds->[0]);
add2hash_($bootloader, arch() =~ /ppc/ ?
@@ -692,7 +693,7 @@ wait for default boot.
} elsif (arch() !~ /ia64/) {
#- search for dos (or windows) boot partition. Don't look in extended partitions!
my @windows_boot_parts =
- grep { isFat_or_NTFS($_) && isFat_or_NTFS({ pt_type => fsedit::typeOfPart($_->{device}) }) }
+ grep { isFat_or_NTFS($_) && member(fs::type::fs_type_from_magic($_), 'vfat', 'ntfs') }
map { @{$_->{primary}{normal}} } @$hds;
each_index {
add_entry($bootloader,
@@ -910,7 +911,10 @@ sub write_lilo {
my $fstab = [ fsedit::get_fstab(@$hds) ];
(my $part, $file) = fsedit::file2part($fstab, $file);
my %hds = map_index { $_ => "hd$::i" } map { $_->{device} }
- sort { isFat($b) <=> isFat($a) || $a->{device} cmp $b->{device} } @$fstab;
+ sort {
+ my ($a_is_fat, $b_is_fat) = ($a->{fs_type} eq 'vfat', $b->{fs_type} eq 'vfat');
+ $a_is_fat <=> $b_is_fat || $a->{device} cmp $b->{device};
+ } @$fstab;
$hds{$part->{device}} . ":" . $file;
} else {
$file
@@ -1208,8 +1212,8 @@ sub install {
my ($bootloader, $hds) = @_;
if (my $part = fs::device2part($bootloader->{boot}, [ fsedit::get_fstab(@$hds) ])) {
- die N("You can't install the bootloader on a %s partition\n", partition_table::type2fs($part))
- if isThisFs('xfs', $part);
+ die N("You can't install the bootloader on a %s partition\n", $part->{fs_type})
+ if $part->{fs_type} eq 'xfs';
}
$bootloader->{keytable} = keytable($bootloader->{keytable});
action($bootloader, 'install', $hds);