diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2000-08-18 04:32:24 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2000-08-18 04:32:24 +0000 |
commit | 94f257d030c1fd411ec48e438db18c657cd97e40 (patch) | |
tree | a4537ad6b19dde305ee0422c7b6a8c4ce104dd9b /perl-install/any.pm | |
parent | 3441ffe13a56f8b565e950b1c8e40c70b2acd97a (diff) | |
download | drakx-94f257d030c1fd411ec48e438db18c657cd97e40.tar drakx-94f257d030c1fd411ec48e438db18c657cd97e40.tar.gz drakx-94f257d030c1fd411ec48e438db18c657cd97e40.tar.bz2 drakx-94f257d030c1fd411ec48e438db18c657cd97e40.tar.xz drakx-94f257d030c1fd411ec48e438db18c657cd97e40.zip |
no_comment
Diffstat (limited to 'perl-install/any.pm')
-rw-r--r-- | perl-install/any.pm | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm index 1c0d9c368..68f7ac515 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -10,7 +10,9 @@ use vars qw(@users); use common qw(:common :system :file :functional); use commands; use detect_devices; +use partition_table qw(:types); use fsedit; +use fs; use run_program; use log; @@ -253,6 +255,30 @@ sub shells { grep { -x "$prefix$_" } map { chomp; $_ } cat_("$prefix/etc/shells"); } +sub inspect { + my ($part, $prefix, $rw) = @_; + + isMountableRW($part) or return; + + my $dir = "/tmp/inspect_tmp_dir"; + + if ($part->{isMounted}) { + $dir = ($prefix || '') . $part->{mntpoint}; + } elsif ($part->{notFormatted} && !$part->{isFormatted}) { + $dir = ''; + } else { + mkdir $dir, 0700; + fs::mount($part->{device}, $dir, type2fs($part->{type}), !$rw); + } + my $h = before_leaving { + if (!$part->{isMounted} && $dir) { + fs::umount($dir); + unlink($dir) + } + }; + $h->{dir} = $dir; + $h; +} 1; |