From 7f5508ce30ddb89239136c5d81c4b3e8368351c0 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 25 Nov 2004 12:14:11 +0000 Subject: we don't use /tmp for devices anymore (this comes from long ago when redhat code was using a ro /dev and creating other devices in /tmp) --- perl-install/devices.pm | 3 +-- perl-install/fs.pm | 4 ++-- perl-install/install_any.pm | 6 +++--- perl-install/pkgs.pm | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/perl-install/devices.pm b/perl-install/devices.pm index 23e45c43f..5ebb848ba 100644 --- a/perl-install/devices.pm +++ b/perl-install/devices.pm @@ -161,10 +161,9 @@ sub entry { sub make($) { local $_ = my $file = $_[0]; - if (m,^(.*/(?:dev|tmp))/(.*),) { + if (m!^(.*/dev)/(.*)!) { $_ = $2; } else { - $file =~ m|^/| && -e $file or $file = "/tmp/$_"; $file =~ m|^/| && -e $file or $file = "/dev/$_"; } -e $file and return $file; #- assume nobody takes fun at creating files named as device diff --git a/perl-install/fs.pm b/perl-install/fs.pm index 2839489ba..a8c479989 100644 --- a/perl-install/fs.pm +++ b/perl-install/fs.pm @@ -129,7 +129,7 @@ sub merge_fstabs { sub analyze_wild_device_name { my ($dev) = @_; - if ($dev =~ m!^/(tmp|u?dev)/(.*)!) { + if ($dev =~ m!^/u?dev/(.*)!) { 'dev', $dev; } elsif ($dev !~ m!^/! && -e "$::prefix/dev/$dev") { 'dev', "/dev/$dev"; @@ -161,7 +161,7 @@ sub subpart_from_wild_device_name { } my $symlink = readlink("$::prefix$dev"); - $dev =~ s!/(tmp|u?dev)/!!; + $dev =~ s!/u?dev/!!; if ($symlink && $symlink =~ m|^[^/]+$|) { $part{device_alias} = $dev; diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index bc198bacf..b4ee7c6e2 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -151,7 +151,7 @@ sub errorOpeningFile($) { my $max = 32; #- always refuse after $max tries. if ($current_method eq "cdrom") { - cat_("/proc/mounts") =~ m,(/(?:dev|tmp)/\S+)\s+(/mnt/cdrom|/tmp/image), + cat_("/proc/mounts") =~ m,(/dev/\S+)\s+(/mnt/cdrom|/tmp/image), and ($cdrom, my $mountpoint) = ($1, $2); return unless $cdrom; ejectCdrom($cdrom, $mountpoint); @@ -779,14 +779,14 @@ sub killCardServices() { } sub unlockCdrom() { - my $cdrom = cat_("/proc/mounts") =~ m!(/(?:dev|tmp)/\S+)\s+(?:/mnt/cdrom|/tmp/image)! && $1 or return; + my $cdrom = cat_("/proc/mounts") =~ m!(/dev/\S+)\s+(?:/mnt/cdrom|/tmp/image)! && $1 or return; eval { ioctl(detect_devices::tryOpen($cdrom), c::CDROM_LOCKDOOR(), 0) }; } sub ejectCdrom { my ($o_cdrom, $o_mountpoint) = @_; getFile("XXX"); #- close still opened filehandle - my $cdrom = $o_cdrom || cat_("/proc/mounts") =~ m!(/(?:dev|tmp)/\S+)\s+(/mnt/cdrom|/tmp/image)! && $1 or return; + my $cdrom = $o_cdrom || cat_("/proc/mounts") =~ m!(/dev/\S+)\s+(/mnt/cdrom|/tmp/image)! && $1 or return; $o_mountpoint ||= $2 || '/tmp/image'; #- umount BEFORE opening the cdrom device otherwise the umount will diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 90affb556..446a1f479 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -972,7 +972,7 @@ sub installTransactionClosure { $::o->{mainmethod} = $::o->{method}; local $::o->{method} = do { my $cdrom; - cat_("/proc/mounts") =~ m,(/(?:dev|tmp)/\S+)\s+(?:/mnt/cdrom|/tmp/image), and $cdrom = $1; + cat_("/proc/mounts") =~ m,(/dev/\S+)\s+(?:/mnt/cdrom|/tmp/image), and $cdrom = $1; if (!defined $cdrom) { (my $cdromdev) = detect_devices::cdroms(); $cdrom = $cdromdev->{device}; -- cgit v1.2.1