summaryrefslogtreecommitdiffstats
path: root/perl-install/fs.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-12-21 14:36:05 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-12-21 14:36:05 +0000
commitc0594dc68e91165a1c5357296a6a5bcda2bfe2b1 (patch)
tree8e06034828b73a2fa8e247e3ab457efab143ac54 /perl-install/fs.pm
parent859695925c701d7408c0f97825512e2260998fd2 (diff)
downloaddrakx-c0594dc68e91165a1c5357296a6a5bcda2bfe2b1.tar
drakx-c0594dc68e91165a1c5357296a6a5bcda2bfe2b1.tar.gz
drakx-c0594dc68e91165a1c5357296a6a5bcda2bfe2b1.tar.bz2
drakx-c0594dc68e91165a1c5357296a6a5bcda2bfe2b1.tar.xz
drakx-c0594dc68e91165a1c5357296a6a5bcda2bfe2b1.zip
- fs::mount() wants a real device or a faked one, but doesn't accept things like fd0 anymore (give it /dev/fd0)
- a little more robust analyze_wild_device_name() during install - handle bad things in subpart_from_wild_device_name()
Diffstat (limited to 'perl-install/fs.pm')
-rw-r--r--perl-install/fs.pm11
1 files changed, 6 insertions, 5 deletions
diff --git a/perl-install/fs.pm b/perl-install/fs.pm
index 542df8a3f..a797977d6 100644
--- a/perl-install/fs.pm
+++ b/perl-install/fs.pm
@@ -131,7 +131,7 @@ sub analyze_wild_device_name {
if ($dev =~ m!^/u?dev/(.*)!) {
'dev', $dev;
- } elsif ($dev !~ m!^/! && -e "$::prefix/dev/$dev") {
+ } elsif ($dev !~ m!^/! && (-e "/dev/$dev" || -e "$::prefix/dev/$dev")) {
'dev', "/dev/$dev";
} elsif ($dev =~ /^LABEL=(.*)/) {
'label', $1;
@@ -207,6 +207,9 @@ sub part2wild_device_name {
};
if ($faked_device) {
$part->{device};
+ } elsif ($part->{device} =~ m!^/dev/!) {
+ log::l("ERROR: i have a full device $part->{device}, this should not happen. use subpart_from_wild_device_name() instead of creating bad part data-structures!");
+ $part->{device};
} else {
my $dev = "/dev/$part->{device}";
eval { devices::make("$prefix$dev") };
@@ -478,8 +481,6 @@ sub mount {
-d $where or mkdir_p($where);
- $dev = part2wild_device_name('', { device => $dev });
-
$fs or log::l("not mounting $dev partition"), return;
my @fs_modules = qw(vfat hfs romfs ufs reiserfs xfs jfs ext3);
@@ -597,7 +598,7 @@ sub mount_part {
} elsif (loopback::carryRootLoopback($part)) {
$mntpoint = "/initrd/loopfs";
}
- my $dev = $part->{real_device} || $part->{device};
+ my $dev = devices::make($part->{real_device} || $part->{device});
mount($dev, $mntpoint, $part->{fs_type}, $b_rdonly, $part->{options}, $o_wait_message);
rmdir "$mntpoint/lost+found";
}
@@ -649,7 +650,7 @@ sub df {
return; #- will not even try!
} else {
mkdir_p($dir);
- eval { mount($part->{device}, $dir, $part->{fs_type}, 'readonly') };
+ eval { mount(devices::make($part->{device}), $dir, $part->{fs_type}, 'readonly') };
if ($@) {
set_isFormatted($part, 0);
unlink $dir;