From f6e56241761735ab6129bcd2ace8496250266c60 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 21 Mar 2005 15:44:10 +0000 Subject: enhance yaboot macos entry handling (mostly written by cjw) (bugzilla #14642) --- perl-install/bootloader.pm | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'perl-install/bootloader.pm') diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index 6049b7ee0..b1f2ef632 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -254,13 +254,22 @@ sub read_grub { \%b; } +sub yaboot2dev { + my ($of_path) = @_; + find { dev2yaboot($_) eq $of_path } map { "/dev/$_->{dev}" } devices::read_proc_partitions_raw(); +} + # assumes file is in /boot +# to do: use yaboot2dev for files as well +#- example of of_path: /pci@f4000000/ata-6@d/disk@0:3,/initrd-2.6.8.1-8mdk.img sub yaboot2file { my ($of_path) = @_; - - #- example of of_path: /pci@f4000000/ata-6@d/disk@0:3,/initrd-2.6.8.1-8mdk.img - - "$::prefix/boot/" . basename($of_path); + + if ($of_path =~ /,/) { + "$::prefix/boot/" . basename($of_path); + } else { + yaboot2dev($of_path); + } } sub read_cromwell() { @@ -784,7 +793,7 @@ wait for default boot. if (defined $partition_table::mac::macos_part) { add_entry($bootloader, { - label => "macos", + type => "macos", kernel_or_dev => $partition_table::mac::macos_part }); } @@ -959,7 +968,7 @@ sub write_yaboot { push @conf, map { "\t$_" } @entry_conf; } else { my $of_dev = dev2yaboot($entry->{kernel_or_dev}); - push @conf, "$entry->{label}=$of_dev"; + push @conf, "$entry->{type}=$of_dev"; } } my $f = "$::prefix/etc/yaboot.conf"; -- cgit v1.2.1