summaryrefslogtreecommitdiffstats
path: root/perl-install/diskdrake/interactive.pm
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mandriva.org>2009-01-09 15:03:02 +0000
committerPascal Terjan <pterjan@mandriva.org>2009-01-09 15:03:02 +0000
commit402a88020dc9a05fdd50ede1fd78a44354246af3 (patch)
tree27f7dfcbbf9ef06c8c5bc589b8a0efe3f0c5b0cf /perl-install/diskdrake/interactive.pm
parent51c2a71b9400577ef5da45437c52da9a5a59036b (diff)
downloaddrakx-backup-do-not-use-402a88020dc9a05fdd50ede1fd78a44354246af3.tar
drakx-backup-do-not-use-402a88020dc9a05fdd50ede1fd78a44354246af3.tar.gz
drakx-backup-do-not-use-402a88020dc9a05fdd50ede1fd78a44354246af3.tar.bz2
drakx-backup-do-not-use-402a88020dc9a05fdd50ede1fd78a44354246af3.tar.xz
drakx-backup-do-not-use-402a88020dc9a05fdd50ede1fd78a44354246af3.zip
Add support for editing partition labels without formatting
Diffstat (limited to 'perl-install/diskdrake/interactive.pm')
-rw-r--r--perl-install/diskdrake/interactive.pm16
1 files changed, 12 insertions, 4 deletions
diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm
index 6d40c2f0d..b23f9ff9d 100644
--- a/perl-install/diskdrake/interactive.pm
+++ b/perl-install/diskdrake/interactive.pm
@@ -397,7 +397,7 @@ sub part_possible_actions {
N_("Mount point") => '$part->{real_mntpoint} || (!isBusy && !isSwap && !isNonMountable)',
N_("Type") => '!isBusy && $::expert && (!readonly || $part->{pt_type} == 0x83)',
N_("Options") => '!isSwap($part) && !isNonMountable && $::expert',
- N_("Label") => '!isNonMountable && $::expert',
+ N_("Label") => '!isNonMountable && $::expert && fs::format::canEditLabel($part)',
N_("Resize") => '!isBusy && !readonly && !isSpecial || isLVM($hd) && LVM_resizable',
N_("Format") => '!isBusy && (!readonly && ($::expert || $::isStandalone) || fs::type::isRawLUKS($part))',
N_("Mount") => '!isBusy && (hasMntpoint || isSwap) && maybeFormatted && ($::expert || $::isStandalone)',
@@ -603,12 +603,20 @@ sub Type {
sub Label {
my ($in, $_hd, $part) = @_;
- $in->ask_from(N("Which volume label?"), '',
+ my $old_label = $part->{device_LABEL};
+ $in->ask_from(N("Set volume label"), N("Beware, this will be written to disk as soon as you validate!"),
[
{ label => N("Which volume label?"), title => 1 },
{ label => N("Label:"), val => \$part->{device_LABEL} } ]) or return;
+
+ if (!fs::format::check_package_is_installed_label($in->do_pkgs, $part->{fs_type})) {
+ $part->{device_LABEL} = $old_label;
+ return;
+ }
$part->{prefer_device_LABEL} = to_bool($part->{device_LABEL});
+ fs::format::clean_label($part);
+ fs::format::write_label($part);
}
sub Mount_point {
@@ -1092,7 +1100,7 @@ sub check_type {
return;
}
if ($::isStandalone && $type->{fs_type} && fs::format::known_type($type)) {
- fs::format::check_package_is_installed($in->do_pkgs, $type->{fs_type}) or return;
+ fs::format::check_package_is_installed_format($in->do_pkgs, $type->{fs_type}) or return;
}
1;
}
@@ -1167,7 +1175,7 @@ sub format_ {
return &dmcrypt_format;
}
if ($::isStandalone) {
- fs::format::check_package_is_installed($in->do_pkgs, $part->{fs_type}) or return;
+ fs::format::check_package_is_installed_format($in->do_pkgs, $part->{fs_type}) or return;
}
if ($::expert && !member($part->{fs_type}, 'reiserfs', 'xfs')) {
$part->{toFormatCheck} = $in->ask_yesorno(N("Confirmation"), N("Check bad blocks?"));