summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-07-06 10:07:16 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-07-06 10:07:16 +0000
commit1b1cd598699675752d01b161433dfe65b11e2eae (patch)
treefafa9896138221228ceb723775fde2e9a991ac6d
parent591209495676d2ece3bd593f8ecd8ecaea8cb9c2 (diff)
downloaddrakx-backup-do-not-use-1b1cd598699675752d01b161433dfe65b11e2eae.tar
drakx-backup-do-not-use-1b1cd598699675752d01b161433dfe65b11e2eae.tar.gz
drakx-backup-do-not-use-1b1cd598699675752d01b161433dfe65b11e2eae.tar.bz2
drakx-backup-do-not-use-1b1cd598699675752d01b161433dfe65b11e2eae.tar.xz
drakx-backup-do-not-use-1b1cd598699675752d01b161433dfe65b11e2eae.zip
Allows people having PVs on unpartitioned disks to install
(but no way to create such beasts)
-rw-r--r--perl-install/partition_table.pm2
-rw-r--r--perl-install/partition_table_lvm_PV.pm43
2 files changed, 44 insertions, 1 deletions
diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm
index c0446ee66..d89269b93 100644
--- a/perl-install/partition_table.pm
+++ b/perl-install/partition_table.pm
@@ -455,7 +455,7 @@ sub read_one($$) {
if_(arch() =~ /^ia64/, 'gpt'),
arch() =~ /^sparc/ ? ('sun', 'bsd') : ('dos', 'bsd', 'sun', 'mac'),
);
- foreach ('empty', @parttype, 'unknown') {
+ foreach ('empty', @parttype, 'lvm_PV', 'unknown') {
/unknown/ and die "unknown partition table format on disk " . $hd->{file};
eval {
require("partition_table_$_.pm");
diff --git a/perl-install/partition_table_lvm_PV.pm b/perl-install/partition_table_lvm_PV.pm
new file mode 100644
index 000000000..f9362a9e5
--- /dev/null
+++ b/perl-install/partition_table_lvm_PV.pm
@@ -0,0 +1,43 @@
+package partition_table_lvm; # $Id$
+
+use diagnostics;
+use strict;
+
+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)
+#-
+#- another way to handle them would be to ignore those disks,
+#- but this would make those hds unshown in diskdrake,
+#- disallowing to zero_MBR, clearing this PV
+
+
+sub read {
+ my ($hd, $sector) = @_;
+
+ local *F; partition_table_raw::openit($hd, *F) or die "failed to open device";
+ c::lseek_sector(fileno(F), $sector, $offset) or die "reading of partition in sector $sector failed";
+
+ 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}";
+
+ [ ];
+}
+
+sub write {
+ die "ERROR: should not be writing raw disk lvm PV!!";
+}
+
+sub clear_raw {
+ die "ERROR: should not be creating new raw disk lvm PV!!";
+}
+
+1;