diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-03-22 10:17:25 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-03-22 10:17:25 +0000 |
commit | 7e252c87d61d61ee1fadf9ce6a494fe444f8c45c (patch) | |
tree | 991bb2081e0b4cec6534318e96166069aee0731d | |
parent | 87b0f66028e8e20eb09b56ab40fa29ae1c05e96e (diff) | |
download | drakx-7e252c87d61d61ee1fadf9ce6a494fe444f8c45c.tar drakx-7e252c87d61d61ee1fadf9ce6a494fe444f8c45c.tar.gz drakx-7e252c87d61d61ee1fadf9ce6a494fe444f8c45c.tar.bz2 drakx-7e252c87d61d61ee1fadf9ce6a494fe444f8c45c.tar.xz drakx-7e252c87d61d61ee1fadf9ce6a494fe444f8c45c.zip |
ensure {lv_name} is set when calling check_mntpoint() from Create() (via check()) (bugzilla #14253)
-rw-r--r-- | perl-install/diskdrake/interactive.pm | 3 | ||||
-rw-r--r-- | perl-install/lvm.pm | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm index e4b01a88f..a22d54e6b 100644 --- a/perl-install/diskdrake/interactive.pm +++ b/perl-install/diskdrake/interactive.pm @@ -488,6 +488,9 @@ sub Create { $part->{size} = $part->{maxsize}; fs::type::suggest_fs_type($part, 'ext3'); } + if (isLVM($hd)) { + lvm::suggest_lv_name($hd, $part); + } #- update adjustment for start and size, take into account the minimum partition size #- including one less sector for start due to a capacity to increase the adjustement by diff --git a/perl-install/lvm.pm b/perl-install/lvm.pm index 93c174daa..4499b9a1f 100644 --- a/perl-install/lvm.pm +++ b/perl-install/lvm.pm @@ -128,14 +128,19 @@ sub lv_delete { @$list = grep { $_ != $lv } @$list; } -sub lv_create { +sub suggest_lv_name { my ($lvm, $lv) = @_; my $list = $lvm->{primary}{normal} ||= []; $lv->{lv_name} ||= 1 + max(map { if_($_->{device} =~ /(\d+)$/, $1) } @$list); +} + +sub lv_create { + my ($lvm, $lv) = @_; $lv->{device} = "$lvm->{VG_name}/$lv->{lv_name}"; lvm_cmd_or_die('lvcreate', '--size', int($lv->{size} / 2) . 'k', '-n', $lv->{lv_name}, $lvm->{VG_name}); $lv->{size} = get_lv_size($lv->{device}); #- the created size is smaller than asked size set_isFormatted($lv, 0); + my $list = $lvm->{primary}{normal} ||= []; push @$list, $lv; } |