diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-03-03 21:32:25 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-03-03 21:32:25 +0000 |
commit | 167fc711a1c9190ba6deb54dd1d7d9fdf84122c3 (patch) | |
tree | d327fea0e08a9dd2408c5f3b558157d32863913c | |
parent | edbb716165d7a2aacd508b0f44cf775ef606d033 (diff) | |
download | drakx-167fc711a1c9190ba6deb54dd1d7d9fdf84122c3.tar drakx-167fc711a1c9190ba6deb54dd1d7d9fdf84122c3.tar.gz drakx-167fc711a1c9190ba6deb54dd1d7d9fdf84122c3.tar.bz2 drakx-167fc711a1c9190ba6deb54dd1d7d9fdf84122c3.tar.xz drakx-167fc711a1c9190ba6deb54dd1d7d9fdf84122c3.zip |
small fixes for LVM
-rw-r--r-- | perl-install/fsedit.pm | 33 | ||||
-rw-r--r-- | perl-install/install2.pm | 3 | ||||
-rw-r--r-- | perl-install/install_interactive.pm | 4 | ||||
-rw-r--r-- | perl-install/install_steps.pm | 3 | ||||
-rw-r--r-- | perl-install/lvm.pm | 3 | ||||
-rwxr-xr-x | perl-install/standalone/diskdrake | 5 |
6 files changed, 25 insertions, 26 deletions
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm index 99db9f20f..03328f9e7 100644 --- a/perl-install/fsedit.pm +++ b/perl-install/fsedit.pm @@ -84,25 +84,24 @@ sub hds { my $type = typeOfPart($_->{device}); $_->{type} = $type if $type > 0x100; } - - if (my @lvms = grep { isLVM($_) } partition_table::get_normal_parts($hd)) { - require lvm; - foreach (@lvms) { - my $name = lvm::get_vg($_) or next; - my ($lvm) = grep { $_->{LVMname} eq $name } @hds; - if (!$lvm) { - $lvm = bless { disks => [], LVMname => $name, level => 'linear' }, 'lvm'; - lvm::update_size($lvm); - lvm::get_lvs($lvm); - push @lvms, $lvm; - } - $_->{lvm} = $name; - push @{$lvm->{disks}}, $_; + push @hds, $hd; + } + if (my @pvs = grep { isLVM($_) } map { partition_table::get_normal_parts($_) } @hds) { + #- otherwise vgscan won't find them + devices::make($_->{device}) foreach @pvs; + require lvm; + foreach (@pvs) { + my $name = lvm::get_vg($_) or next; + my ($lvm) = grep { $_->{LVMname} eq $name } @hds; + if (!$lvm) { + $lvm = bless { disks => [], LVMname => $name, level => 'linear' }, 'lvm'; + lvm::update_size($lvm); + lvm::get_lvs($lvm); + push @lvms, $lvm; } + $_->{lvm} = $name; + push @{$lvm->{disks}}, $_; } - - - push @hds, $hd; } \@hds, \@lvms; } diff --git a/perl-install/install2.pm b/perl-install/install2.pm index d7cd43206..0379648ae 100644 --- a/perl-install/install2.pm +++ b/perl-install/install2.pm @@ -219,9 +219,6 @@ sub formatPartitions { require raid; raid::prepare_prefixed($o->{raid}, $o->{prefix}); - #- generate /etc/lvmtab need for rc.sysinit - run_program::rooted($o->{prefix}, 'vgscan') if -e '/etc/lvmtab'; - my $d = "/initrd/loopfs/lnx4win"; if (-d $d) { #- install_any::useMedium(0); diff --git a/perl-install/install_interactive.pm b/perl-install/install_interactive.pm index 789e557d1..a486a13ec 100644 --- a/perl-install/install_interactive.pm +++ b/perl-install/install_interactive.pm @@ -32,9 +32,9 @@ sub partition_with_diskdrake { do { $ok = 1; require diskdrake; - diskdrake::main($hds, $o->{raid}, interactive_gtk->new, $nowizard); + diskdrake::main($hds, $o->{lvms}, $o->{raid}, interactive_gtk->new, $nowizard); delete $o->{wizard} and return partitionWizard($o, 'nodiskdrake'); - my @fstab = fsedit::get_fstab(@$hds, $o->{raid}); + my @fstab = fsedit::get_fstab(@$hds, @{$o->{lvms}}, $o->{raid}); unless (fsedit::get_root_(\@fstab)) { $ok = 0; diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index 53a5a357e..c6c26b9b3 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -401,6 +401,9 @@ Consoles 1,3,4,7 may also contain interesting information"; #- why not? cuz weather is nice today :-) [pixel] sync(); sync(); + #- generate /etc/lvmtab needed for rc.sysinit + run_program::rooted($o->{prefix}, 'vgscan') if -e '/etc/lvmtab'; + #- configure PCMCIA services if needed. modules::write_pcmcia($o->{prefix}, $o->{pcmcia}); diff --git a/perl-install/lvm.pm b/perl-install/lvm.pm index 5ce2b3c03..c2b15e613 100644 --- a/perl-install/lvm.pm +++ b/perl-install/lvm.pm @@ -25,6 +25,7 @@ sub cylinder_size { modules::load('lvm-mod'); run_program::run('vgscan') if !-e '/etc/lvmtab'; +run_program::run('vgchange', '-a', 'y'); sub get_vg { my ($part) = @_; @@ -47,7 +48,7 @@ sub get_lvs { { device => $_, type => $type || 0x83, isFormatted => $type, - size => (split(':', `lvdisplay -c $_`))[6] } + size => (split(':', `lvdisplay -D -c $_`))[6] } } map { /^LV Name\s+(\S+)/ ? $1 : () } `vgdisplay -v -D $lvm->{LVMname}` ]; } diff --git a/perl-install/standalone/diskdrake b/perl-install/standalone/diskdrake index f61a91abf..8183c976d 100755 --- a/perl-install/standalone/diskdrake +++ b/perl-install/standalone/diskdrake @@ -67,13 +67,12 @@ my ($hds, $lvms) = [_("I can't read your partition table, it's too corrupted for me :( I'll try to go on blanking bad partitions"), $err]); }; -push @$hds, @$lvms; $SIG{__DIE__} = sub { chomp (my $m = $_[0]); log::l("ERROR: $m") }; -my $fstab = [ fsedit::get_fstab(@$hds) ]; +my $fstab = [ fsedit::get_fstab(@$hds, @$lvms) ]; fs::get_mntpoints_from_fstab($fstab); fs::check_mounted($fstab); -diskdrake::main($hds, {}, $in); +diskdrake::main($hds, $lvms, {}, $in); $in->exit(0); |