summaryrefslogtreecommitdiffstats
path: root/perl-install/diskdrake/interactive.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/diskdrake/interactive.pm')
-rw-r--r--perl-install/diskdrake/interactive.pm31
1 files changed, 30 insertions, 1 deletions
diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm
index eaf2c8db4..8c5445f83 100644
--- a/perl-install/diskdrake/interactive.pm
+++ b/perl-install/diskdrake/interactive.pm
@@ -395,6 +395,7 @@ sub part_possible_actions {
$part or return;
my %actions = my @l = (
+ N_("View") => '!isSwap && !isNonMountable && maybeFormatted',
N_("Mount point") => '$part->{real_mntpoint} || (!isBusy && !isSwap && !isNonMountable)',
N_("Type") => '!isBusy && $::expert && (!readonly || $part->{pt_type} == 0x83)',
N_("Options") => '!isSwap($part) && !isNonMountable && $::expert',
@@ -438,6 +439,34 @@ sub part_possible_actions {
}
}
+sub View {
+ my ($in, $hd, $part, $all_hds) = @_;
+ my $old_mountpoint = $part->{mntpoint};
+ my $old_real_mountpoint = $part->{real_mntpoint};
+ my $was_mounted = $part->{isMounted};
+ my $mountpoint;
+ if(!$was_mounted) {
+ $part->{mntpoint} = '/tmp/mnt_browse';
+ $mountpoint = $part->{mntpoint};
+ mkdir_p($part->{mntpoint});
+ my $w;
+ fs::mount::part($part, 0, sub {
+ my ($msg) = @_;
+ $w ||= $in->wait_message(N("Please wait"), $msg);
+ $w->set($msg);
+ });
+ } else {
+ $mountpoint = $part->{real_mntpoint} || $part->{mntpoint};
+ }
+ $in->ask_directory({'directory'=>$part->{mntpoint}});
+ if(!$was_mounted) {
+ fs::mount::umount($part);
+ $part->{mntpoint} = $old_mountpoint;
+ $part->{real_mntpoint} = $old_real_mountpoint;
+ unlink($mountpoint);
+ }
+}
+
#- in case someone use diskdrake only to create partitions,
#- ie without assigning a mount point,
#- do not suggest mount points anymore
@@ -698,7 +727,7 @@ sub Resize {
$nice_resize{fat} = resize_fat::main->new($part->{device}, devices::make($part->{device}));
$min = max($min, $nice_resize{fat}->min_size);
$max = min($max, $nice_resize{fat}->max_size);
- } elsif (member($part->{fs_type}, qw(ext2 ext3))) { # resize2fs is known to be broken regarding extents with ext4
+ } elsif (member($part->{fs_type}, qw(ext2 ext3))) { # resize2fs is known to be broken regarding extents with ext4
write_partitions($in, $hd) or return;
require diskdrake::resize_ext2;
if ($nice_resize{ext2} = diskdrake::resize_ext2->new($part->{device}, devices::make($part->{device}))) {