From c0594dc68e91165a1c5357296a6a5bcda2bfe2b1 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 21 Dec 2004 14:36:05 +0000 Subject: - 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() --- perl-install/fs.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'perl-install/fs.pm') 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; -- cgit v1.2.1