From 15c56bea6f436c0bf48bcac64036cd5ab8c82f40 Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Thu, 5 Feb 2009 00:16:54 +0000 Subject: [PATCH] Allows to use disk (like CD-ROM) without partition map but with filesystem on the full disk. We accept partition number 0 (which identifies the full disk) and partition number 1 (we can see the disk as only one partition). This is needed to boot openSUSE install CD which uses "&device;:1,\suseboot\yaboot.ibm" as its boot path. There is a Mac partition map on the CD, but partition 1 is the partition map itself, and thus is not usable by a filesystem. So we can guess, openFirmware must use ISO9660 instead of HFS and thus to not use the Mac partition map, but the whole CD for the partition #1. Disk openSUSE-ppc.iso: 135 MB, 135593984 bytes 4 heads, 32 sectors/track, 2069 cylinders Units = cylinders of 128 * 512 = 65536 bytes Device Boot Start End Blocks Id System openSUSE-ppc.iso1 1 1 48 Apple_partition_map openSUSE-ppc.iso2 1 2066 132160 Apple_HFS git-svn-id: svn://coreboot.org/openbios/openbios-devel@443 f158a5a8-5612-0410-a976-696ce0be7e32 --- modules/disk-label.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modules/disk-label.c b/modules/disk-label.c index b4dad9f..4a487de 100644 --- a/modules/disk-label.c +++ b/modules/disk-label.c @@ -78,6 +78,21 @@ dlabel_open( dlabel_info_t *di ) } } + /* try to see if there is a filesystem without partition */ + + if (atol(parstr) == 0 || atol(parstr) == 1) { + PUSH_ih( my_self() ); + selfword("find-filesystem"); + ph = POP_ph(); + if( ph ) { + push_str( filename ); + PUSH_ph( ph ); + fword("interpose"); + success = 1; + goto out; + } + } + /* find partition handler */ seek_io( fd, 0 ); if( read_io(fd, block0, sizeof(block0)) != sizeof(block0) )