summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-06-04 11:13:34 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-06-04 11:13:34 +0000
commitc9a35f48ca4ae3f503a2976b2e399eb814407f8f (patch)
tree84e4df966deae6a972b6f7cad29495e6766486c2
parent37d4047e44806051bf7721869791fce9917d04ee (diff)
downloaddrakx-backup-do-not-use-c9a35f48ca4ae3f503a2976b2e399eb814407f8f.tar
drakx-backup-do-not-use-c9a35f48ca4ae3f503a2976b2e399eb814407f8f.tar.gz
drakx-backup-do-not-use-c9a35f48ca4ae3f503a2976b2e399eb814407f8f.tar.bz2
drakx-backup-do-not-use-c9a35f48ca4ae3f503a2976b2e399eb814407f8f.tar.xz
drakx-backup-do-not-use-c9a35f48ca4ae3f503a2976b2e399eb814407f8f.zip
allow choosing lv name (thanks to Brian Murrell)
-rw-r--r--perl-install/diskdrake/interactive.pm4
-rw-r--r--perl-install/lvm.pm6
2 files changed, 7 insertions, 3 deletions
diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm
index 425ba1bb4..b279d96d2 100644
--- a/perl-install/diskdrake/interactive.pm
+++ b/perl-install/diskdrake/interactive.pm
@@ -81,6 +81,7 @@ struct part_loopback inherits part {
struct part_lvm inherits part {
# invalid: active, start, device_windobe, CHS
+ string lv_name
}
@@ -464,6 +465,9 @@ sub Create {
if_($::expert && $hd->hasExtended,
{ label => N("Preference: "), val => \$primaryOrExtended, list => [ '', "Extended", "Primary", if_($::expert, "Extended_0x85") ] },
),
+ if_($::expert && isLVM($hd),
+ { label => _("Logical volume name "), val => \$part->{lv_name}, list => [ qw(root swap usr home var), '' ], sort => 0, not_edit => 0 },
+ ),
], changed => sub {
if ($part->{start} + ($mb_size << 11) > $max) {
if ($_[0] == 0) {
diff --git a/perl-install/lvm.pm b/perl-install/lvm.pm
index 12c685e97..9b9ce8d58 100644
--- a/perl-install/lvm.pm
+++ b/perl-install/lvm.pm
@@ -128,9 +128,9 @@ sub lv_delete {
sub lv_create {
my ($lvm, $lv) = @_;
my $list = $lvm->{primary}{normal} ||= [];
- my $nb = 1 + max(map { basename($_->{device}) } @$list);
- $lv->{device} = "$lvm->{VG_name}/$nb";
- run_or_die('lvcreate', '--size', int($lv->{size} / 2) . 'k', '-n', $nb, $lvm->{VG_name});
+ $lv->{lv_name} ||= 1 + max(map { if_($_->{device} =~ /(\d+)$/, $1) } @$list);
+ $lv->{device} = "$lvm->{VG_name}/$lvm->{lv_name}";
+ run_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
$lv->{notFormatted} = 1;
$lv->{isFormatted} = 0;