summaryrefslogtreecommitdiffstats
path: root/perl-install/fs
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-09-06 06:53:57 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-09-06 06:53:57 +0000
commit86237df0ca5fbcb73bca789f876c9f72bfd49100 (patch)
tree43a1734f75f090ef980fc119fd6811b2018856d4 /perl-install/fs
parent27fb20414e9dc3261fdd57c74833e5075b31542f (diff)
downloaddrakx-86237df0ca5fbcb73bca789f876c9f72bfd49100.tar
drakx-86237df0ca5fbcb73bca789f876c9f72bfd49100.tar.gz
drakx-86237df0ca5fbcb73bca789f876c9f72bfd49100.tar.bz2
drakx-86237df0ca5fbcb73bca789f876c9f72bfd49100.tar.xz
drakx-86237df0ca5fbcb73bca789f876c9f72bfd49100.zip
detect linux software raid magic
Diffstat (limited to 'perl-install/fs')
-rw-r--r--perl-install/fs/type.pm17
1 files changed, 16 insertions, 1 deletions
diff --git a/perl-install/fs/type.pm b/perl-install/fs/type.pm
index 137731c4b..70ca967bf 100644
--- a/perl-install/fs/type.pm
+++ b/perl-install/fs/type.pm
@@ -278,7 +278,22 @@ sub fs_type_from_magic {
sub type_subpart_from_magic {
my ($part) = @_;
my $dev = devices::make($part->{device});
- my $t = typeFromMagic($dev, @partitions_signatures) or return;
+
+ my $check_md = sub {
+ my ($F) = @_;
+ my $MD_RESERVED_SECTORS = 128;
+ my $sector = round_down($part->{size}, $MD_RESERVED_SECTORS) - $MD_RESERVED_SECTORS; #- MD_NEW_SIZE_SECTORS($part->{size})
+ if (c::lseek_sector(fileno $F, $sector, 0)) {
+ my $tmp;
+ my $signature = "\xfc\x4e\x2b\xa9";
+ sysread($F, $tmp, length $signature);
+ $tmp eq $signature and return "Linux RAID";
+ }
+ '';
+ };
+ my $t = typeFromMagic($dev,
+ $check_md,
+ @partitions_signatures) or return;
my $p = type_name2subpart($t) || fs_type2subpart($t) || internal_error("unknown name/fs $t");
if ($p->{fs_type} eq 'ext2') {