From 2a364b3c3af7d045690f80031130ceffc0960698 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 27 Sep 2004 10:19:20 +0000 Subject: 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 --- perl-install/partition_table/lvm_PV.pm | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'perl-install/partition_table') 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}"; []; } -- cgit v1.2.1