summaryrefslogtreecommitdiffstats
path: root/perl-install/partition_table
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-09-27 10:19:20 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-09-27 10:19:20 +0000
commit2a364b3c3af7d045690f80031130ceffc0960698 (patch)
tree986231ec2eca5233a1443edef13603bd4f910b2c /perl-install/partition_table
parent91f721bd468886858275b26a2f44bc240ec0359b (diff)
downloaddrakx-2a364b3c3af7d045690f80031130ceffc0960698.tar
drakx-2a364b3c3af7d045690f80031130ceffc0960698.tar.gz
drakx-2a364b3c3af7d045690f80031130ceffc0960698.tar.bz2
drakx-2a364b3c3af7d045690f80031130ceffc0960698.tar.xz
drakx-2a364b3c3af7d045690f80031130ceffc0960698.zip
simplify and handle LVM2, *but* since creating a LVM2 PV on a non partitioned
drive doesn't modify the MBR, it won't help if the MBR is empty or a valid dos partition table, since those are checked first... but i won't change this so late in the release cycle
Diffstat (limited to 'perl-install/partition_table')
-rw-r--r--perl-install/partition_table/lvm_PV.pm9
1 files changed, 2 insertions, 7 deletions
diff --git a/perl-install/partition_table/lvm_PV.pm b/perl-install/partition_table/lvm_PV.pm
index 6311a7da5..d7cefc080 100644
--- a/perl-install/partition_table/lvm_PV.pm
+++ b/perl-install/partition_table/lvm_PV.pm
@@ -8,9 +8,6 @@ our @ISA = qw(partition_table::raw);
use partition_table::raw;
use c;
-my $magic = "HM\1\0";
-my $offset = 0;
-
#- Allows people having PVs on unpartitioned disks to install
#- (but no way to create such beasts)
@@ -23,11 +20,9 @@ my $offset = 0;
sub read {
my ($hd, $sector) = @_;
- my $F = partition_table::raw::openit($hd) or die "failed to open device";
- c::lseek_sector(fileno($F), $sector, $offset) or die "reading of partition in sector $sector failed";
+ my $t = fs::type::type_subpart_from_magic($hd);
- sysread $F, my $tmp, length $magic or die "error reading magic number on disk $hd->{file}";
- $tmp eq $magic or die "bad magic number on disk $hd->{file}";
+ $t && $t->{pt_type} eq 0x8e or die "bad magic number on disk $hd->{device}";
[];
}