diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-02-13 15:42:53 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-02-13 15:42:53 +0000 |
commit | 67daf811e1f9a77affe5531c5dc2f0f08d3695c9 (patch) | |
tree | dd4ffff91a7de48973130fa37652283a68c426b5 /perl-install | |
parent | 195c6659105c86fd51969377d607e76b4e0b0423 (diff) | |
download | drakx-backup-do-not-use-67daf811e1f9a77affe5531c5dc2f0f08d3695c9.tar drakx-backup-do-not-use-67daf811e1f9a77affe5531c5dc2f0f08d3695c9.tar.gz drakx-backup-do-not-use-67daf811e1f9a77affe5531c5dc2f0f08d3695c9.tar.bz2 drakx-backup-do-not-use-67daf811e1f9a77affe5531c5dc2f0f08d3695c9.tar.xz drakx-backup-do-not-use-67daf811e1f9a77affe5531c5dc2f0f08d3695c9.zip |
create read_grub_device_map()
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/bootloader.pm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index 5d5356a96..3b741825f 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -1045,13 +1045,18 @@ sub dev2grub { "($grub" . ($3 && "," . ($3 - 1)) . ")"; } +sub read_grub_device_map() { + my %grub2dev = map { m!\((.*)\) /dev/(.*)$! } cat_("$::prefix/boot/grub/device.map"); + \%grub2dev; +} + sub grub2dev { my ($device, $o_block_device) = @_; my ($dev, $part) = ($1 . ")", $2) if $device =~ s/(\([^,]*?)(?:,(.*))?\)//; undef $part if $o_block_device; $part++ if defined $part; # grub wants "(hdX,Y)" where lilo just want "hdY+1" $dev =~ s/,[^)]*//; - my $new_dev = +{ map { chomp; s/()//g; split(/\s+/, $_, 2) } cat_("$::prefix/boot/grub/device.map") }->{$dev} . $part; + my $new_dev = '/dev/' . read_grub_device_map()->{$dev} . $part; wantarray() ? ($device, $new_dev) : $new_dev; } |