diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-11-16 16:47:04 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-11-16 16:47:04 +0000 |
commit | 57cb518585e76d8ae16f0acd62b6ed13f17c5fed (patch) | |
tree | 297dfd2aada1fd0426b8a4ff034dab83b0c2a96a | |
parent | c61d24242661df10056834c624fdf355f790a2dc (diff) | |
download | drakx-backup-do-not-use-57cb518585e76d8ae16f0acd62b6ed13f17c5fed.tar drakx-backup-do-not-use-57cb518585e76d8ae16f0acd62b6ed13f17c5fed.tar.gz drakx-backup-do-not-use-57cb518585e76d8ae16f0acd62b6ed13f17c5fed.tar.bz2 drakx-backup-do-not-use-57cb518585e76d8ae16f0acd62b6ed13f17c5fed.tar.xz drakx-backup-do-not-use-57cb518585e76d8ae16f0acd62b6ed13f17c5fed.zip |
handle more nicely raw_lvm_PV (don't simply ignore them)
-rw-r--r-- | perl-install/fsedit.pm | 24 | ||||
-rw-r--r-- | perl-install/partition_table.pm | 2 | ||||
-rw-r--r-- | perl-install/partition_table/lvm_PV.pm | 39 |
3 files changed, 19 insertions, 46 deletions
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm index 42404bfe8..a57fd64e4 100644 --- a/perl-install/fsedit.pm +++ b/perl-install/fsedit.pm @@ -135,12 +135,24 @@ sub get_hds { log::l("using /proc/partitions since diskdrake failed :("); use_proc_partitions($hd); 1; - } elsif (exists $hd->{usb_description} && fs::type::fs_type_from_magic($hd)) { - #- non partitioned drive - $hd->{fs_type} = fs::type::fs_type_from_magic($hd); - push @raw_hds, $hd; - $hd = ''; - 1; + } elsif (my $type = fs::type::type_subpart_from_magic($hd)) { + #- non partitioned drive? + if (exists $hd->{usb_description} && $type->{fs_type}) { + #- USB keys + put_in_hash($hd, $type); + push @raw_hds, $hd; + $hd = ''; + 1; + } elsif ($type->{pt_type} == 0x8e) { + #- LVM on full disk + my $part = { size => $hd->{totalsectors}, device => $hd->{device}, %$type }; + bless $hd, 'partition_table::raw'; + $hd->{readonly} = $hd->{getting_rid_of_readonly_allowed} = 1; + $hd->{primary}{normal} = [ $part ]; + 1; + } else { + 0; + } } else { 0; } diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm index 624e3c111..462fac56f 100644 --- a/perl-install/partition_table.pm +++ b/perl-install/partition_table.pm @@ -241,7 +241,7 @@ sub read_one($$) { if_(arch() =~ /^ia64/, 'gpt'), arch() =~ /^sparc/ ? ('sun', 'bsd') : ('dos', 'bsd', 'sun', 'mac'), ); - foreach ('empty', @parttype, 'lvm_PV', 'unknown') { + foreach ('empty', @parttype, 'unknown') { /unknown/ and die "unknown partition table format on disk " . $hd->{file}; eval { # perl_checker: require partition_table::bsd diff --git a/perl-install/partition_table/lvm_PV.pm b/perl-install/partition_table/lvm_PV.pm deleted file mode 100644 index b53867d5f..000000000 --- a/perl-install/partition_table/lvm_PV.pm +++ /dev/null @@ -1,39 +0,0 @@ -package partition_table::lvm_PV; # $Id$ - -use diagnostics; -use strict; - -our @ISA = qw(partition_table::raw); - -use partition_table::raw; -use c; - - -#- 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) = @_; - - require fs::type; - my $t = fs::type::type_subpart_from_magic($hd); - - $t && $t->{pt_type} == 0x8e or die "bad magic number on disk $hd->{device}"; - - []; -} - -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; |