From 78a6a2c2496a9fb29d7af2d92b2d1a6254802e3a Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 6 Nov 2002 21:09:36 +0000 Subject: cleanup get_of_dev (aka ofpath) --- perl-install/bootloader.pm | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index 86d370856..6e4651058 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -585,21 +585,12 @@ sub set_profiles { } sub get_of_dev { - my ($unix_dev) = @_; - #- don't care much for this - need to run ofpath rooted, and I need the result - #- In test mode, just run on "/", otherwise you can't get to the /proc files - run_program::rooted_or_die($::prefix, "/usr/sbin/ofpath $unix_dev", ">", "/tmp/ofpath"); - open(FILE, "$::prefix/tmp/ofpath") || die "Can't open $::prefix/tmp/ofpath"; - my $of_dev = ""; - local $_; - while (){ - $of_dev = $_; - } - chop($of_dev); - my @del_file = ($::prefix . "/tmp/ofpath"); - unlink (@del_file); - log::l("OF Device: $of_dev"); - $of_dev; + my ($unix_dev) = @_; + my $of_dev; + run_program::rooted_or_die($::prefix, "/usr/sbin/ofpath", ">", \$of_dev, $unix_dev); + chomp($of_dev); + log::l("OF Device: $of_dev"); + $of_dev; } sub install_yaboot { -- cgit v1.2.1