summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-01-28 13:04:34 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-01-28 13:04:34 +0000
commitc7c6053d6513768bc52100dae3e8a8b7ee035f8c (patch)
treea99c6fecfe4a36edced8f8ac8ea6e19af983361f
parent779783e6de065e9c6b8757e88ac681a0445d1eca (diff)
downloaddrakx-backup-do-not-use-c7c6053d6513768bc52100dae3e8a8b7ee035f8c.tar
drakx-backup-do-not-use-c7c6053d6513768bc52100dae3e8a8b7ee035f8c.tar.gz
drakx-backup-do-not-use-c7c6053d6513768bc52100dae3e8a8b7ee035f8c.tar.bz2
drakx-backup-do-not-use-c7c6053d6513768bc52100dae3e8a8b7ee035f8c.tar.xz
drakx-backup-do-not-use-c7c6053d6513768bc52100dae3e8a8b7ee035f8c.zip
- detect raid partitions based on either type 0xfd or vol_id detecting
linux_raid_member (#35684) for this, introduce field {type_name}
-rw-r--r--perl-install/NEWS2
-rw-r--r--perl-install/diskdrake/interactive.pm1
-rw-r--r--perl-install/fs/type.pm7
-rw-r--r--perl-install/partition_table/lvm.pm3
4 files changed, 8 insertions, 5 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS
index d62b3269f..5ab999d93 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -1,3 +1,5 @@
+- detect raid partitions based on either type 0xfd or vol_id detecting
+ linux_raid_member (#35684)
- bootloader-config:
o do not drop "lock" in chainload entries from grub's menu.lst (#36398)
diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm
index 62e872519..d3251e8b1 100644
--- a/perl-install/diskdrake/interactive.pm
+++ b/perl-install/diskdrake/interactive.pm
@@ -31,6 +31,7 @@ struct part {
int size # in sectors
int pt_type # 0x82, 0x83, 0x6 ...
string fs_type # 'ext2', 'nfs', ...
+ string type_name # 'Linux RAID', 'Linux Logical Volume Manager', ...
int part_number # 1 for hda1...
string device # 'hda5', 'sdc1' ...
diff --git a/perl-install/fs/type.pm b/perl-install/fs/type.pm
index 3d4bb6ffa..b7fef0771 100644
--- a/perl-install/fs/type.pm
+++ b/perl-install/fs/type.pm
@@ -196,7 +196,8 @@ sub type_names {
sub type_name2subpart {
my ($name) = @_;
exists $type_name2fs_type{$name} &&
- { fs_type => $type_name2fs_type{$name}, pt_type => $type_name2pt_type{$name} };
+ { type_name => $name,
+ fs_type => $type_name2fs_type{$name}, pt_type => $type_name2pt_type{$name} };
}
sub part2type_name {
@@ -308,8 +309,8 @@ sub isEmpty { !$_[0]{fs_type} && $_[0]{pt_type} == 0 }
sub isEfi { arch() =~ /ia64/ && $_[0]{pt_type} == 0xef }
sub isWholedisk { arch() =~ /^sparc/ && $_[0]{pt_type} == 5 }
sub isExtended { arch() !~ /^sparc/ && ($_[0]{pt_type} == 5 || $_[0]{pt_type} == 0xf || $_[0]{pt_type} == 0x85) }
-sub isRawLVM { $_[0]{pt_type} == 0x8e }
-sub isRawRAID { $_[0]{pt_type} == 0xfd }
+sub isRawLVM { $_[0]{pt_type} == 0x8e || $_[0]{type_name} eq 'Linux Logical Volume Manager' }
+sub isRawRAID { $_[0]{pt_type} == 0xfd || $_[0]{type_name} eq 'Linux RAID' }
sub isSwap { $_[0]{fs_type} eq 'swap' }
sub isDos { arch() !~ /^sparc/ && ${{ 1 => 1, 4 => 1, 6 => 1 }}{$_[0]{pt_type}} }
sub isFat_or_NTFS { member($_[0]{fs_type}, 'vfat', 'ntfs', 'ntfs-3g') }
diff --git a/perl-install/partition_table/lvm.pm b/perl-install/partition_table/lvm.pm
index 5378d0bb2..57dab0bfc 100644
--- a/perl-install/partition_table/lvm.pm
+++ b/perl-install/partition_table/lvm.pm
@@ -24,10 +24,9 @@ sub _parts {
sub read_primary {
my ($hd) = @_;
- my $wanted = fs::type::type_name2subpart('Linux Logical Volume Manager');
my $type = fs::type::type_subpart_from_magic($hd);
- $type && $type->{pt_type} == $wanted->{pt_type} or return;
+ $type && $type->{type_name} eq 'Linux Logical Volume Manager' or return;
partition_table::lvm->initialize($hd);
1;