summaryrefslogtreecommitdiffstats
path: root/perl-install/lvm.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-09-16 15:22:36 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-09-16 15:22:36 +0000
commite7e246812e4426f71985770abb50356dfdd7ac0a (patch)
tree67725014e2b4605711df35b483b204bb299f0153 /perl-install/lvm.pm
parenta82b2e32ac2f198f7176c33ac14383192c5ab37a (diff)
downloaddrakx-backup-do-not-use-e7e246812e4426f71985770abb50356dfdd7ac0a.tar
drakx-backup-do-not-use-e7e246812e4426f71985770abb50356dfdd7ac0a.tar.gz
drakx-backup-do-not-use-e7e246812e4426f71985770abb50356dfdd7ac0a.tar.bz2
drakx-backup-do-not-use-e7e246812e4426f71985770abb50356dfdd7ac0a.tar.xz
drakx-backup-do-not-use-e7e246812e4426f71985770abb50356dfdd7ac0a.zip
enhance lvm handling (mostly standalone)
Diffstat (limited to 'perl-install/lvm.pm')
-rw-r--r--perl-install/lvm.pm23
1 files changed, 18 insertions, 5 deletions
diff --git a/perl-install/lvm.pm b/perl-install/lvm.pm
index 72e1b4bb2..3ff0b4612 100644
--- a/perl-install/lvm.pm
+++ b/perl-install/lvm.pm
@@ -22,14 +22,27 @@ sub cylinder_size {
$hd->{PE_size};
}
+init();
-eval { modules::load('lvm-mod') };
-run_program::run('vgscan') if !-e '/etc/lvmtab';
-run_program::run('vgchange', '-a', 'y');
+sub init {
+ eval { modules::load('lvm-mod') };
+ run_program::run('vgscan') if !-e '/etc/lvmtab';
+ run_program::run('vgchange', '-a', 'y');
+}
+
+sub check {
+ my ($in) = @_;
+
+ my $f = '/sbin/pvcreate';
+ -e $f or $in->do_pkgs->install('lvm');
+ -e $f or $in->ask_warn('', "Mandatory package lvm is missing"), return;
+ init();
+ 1;
+}
sub get_vg {
my ($part) = @_;
- my $dev = devices::make($part->{device});
+ my $dev = expand_symlinks(devices::make($part->{device}));
(split(':', `pvdisplay -c $dev`))[1];
}
@@ -58,7 +71,7 @@ sub vg_add {
run_program::run('vgchange', '-a', 'n', $old_name);
run_program::run('vgremove', $old_name);
}
- my $dev = devices::make($part->{device});
+ my $dev = expand_symlinks(devices::make($part->{device}));
run_program::run_or_die('pvcreate', $dev);
my $prog = run_program::run('vgdisplay', $part->{lvm}) ? 'vgextend' : 'vgcreate';
run_program::run_or_die($prog, $part->{lvm}, $dev);