Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JY1dr-0000t1-Oi for mharc-grub-devel@gnu.org; Sat, 08 Mar 2008 11:11:23 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JY1dp-0000pb-Bb for grub-devel@gnu.org; Sat, 08 Mar 2008 11:11:21 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JY1dn-0000m3-Ic for grub-devel@gnu.org; Sat, 08 Mar 2008 11:11:20 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JY1dn-0000lY-8n for grub-devel@gnu.org; Sat, 08 Mar 2008 11:11:19 -0500 Received: from va27-cr1.mx.dnspark.net ([216.22.50.27]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JY1dm-00011y-KT for grub-devel@gnu.org; Sat, 08 Mar 2008 11:11:18 -0500 Received: by va27-cr1.mx.dnspark.net (Postfix, from userid 45) id CE5A7F7503; Sat, 8 Mar 2008 10:11:17 -0600 (CST) Received: from msi.lan.chilibi.org (84-74-219-33.dclient.hispeed.ch [84.74.219.33]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by va27-cr1.mx.dnspark.net (Postfix) with ESMTP id 40D2FF74FF for ; Sat, 8 Mar 2008 10:11:17 -0600 (CST) Received: from localhost ([127.0.0.1] ident=eFBuzhL4) by msi.lan.chilibi.org with esmtp (Exim 4.69) (envelope-from ) id 1JY1dj-0006xa-Hm for grub-devel@gnu.org; Sat, 08 Mar 2008 17:11:15 +0100 From: Alain Greppin To: The development of GRUB 2 In-Reply-To: <873ar1tjd6.fsf@xs4all.nl> References: <1204977538.598.43.camel@msi.lan.chilibi.org> <873ar1tjd6.fsf@xs4all.nl> Content-Type: text/plain Date: Sat, 08 Mar 2008 17:11:13 +0100 Message-Id: <1204992673.9855.18.camel@msi.lan.chilibi.org> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 Content-Transfer-Encoding: 7bit X-Sanitizer: DNS Park mail filtering. For more information see X-Sanitizer: http://www.dnspark.com/services/mailProtection.php X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) Subject: Re: RDB partition tables in AROS X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Mar 2008 16:11:22 -0000 Hello, Here is a diff againt our svn repository. We have grub2 version 1.96 here. The changes log: - recognize RDB partion tables inside MBR, this is needed for AROS to boot on a PC - fix AFFS filesystem for AROS - minor bug fix in SFS: count of nodes in extent-btree is written as big endian on disk - fixed gensymlist.sh to let us build with a compiler command having arguments Regards, Alain Greppin Index: fs/affs.c =================================================================== --- fs/affs.c (revision 27991) +++ fs/affs.c (working copy) @@ -25,6 +25,9 @@ #include #include #include +#ifdef __AROS__ +#include +#endif /* The affs bootblock. */ struct grub_affs_bblock @@ -209,8 +212,22 @@ rblock = (struct grub_affs_rblock *) rootblock; /* Read the rootblock. */ +#ifdef __AROS__ + grub_uint64_t reservedblocks = 2; + grub_uint64_t countblocks; + if (disk->partition) + countblocks = disk->partition->len; + else + countblocks = disk->total_sectors; + + grub_disk_addr_t rblknum = (countblocks - 1 + reservedblocks) / 2; + + grub_disk_read (disk, rblknum, 0, + GRUB_DISK_SECTOR_SIZE * 16, (char *) rootblock); +#else grub_disk_read (disk, (disk->total_sectors >> 1) + blocksize, 0, GRUB_DISK_SECTOR_SIZE * 16, (char *) rootblock); +#endif if (grub_errno) goto fail; @@ -241,7 +258,11 @@ data->disk = disk; data->htsize = grub_be_to_cpu32 (rblock->htsize); data->diropen.data = data; +#ifdef __AROS__ + data->diropen.block = rblknum; +#else data->diropen.block = (disk->total_sectors >> 1); +#endif grub_free (rootblock); Index: fs/sfs.c =================================================================== --- fs/sfs.c (revision 27991) +++ fs/sfs.c (working copy) @@ -172,7 +172,8 @@ return grub_errno; } - for (i = 0; i < tree->nodes; i++) + grub_uint16_t nodescount = grub_be_to_cpu16(tree->nodes); + for (i = 0; i < nodescount; i++) { #define EXTNODE(tree, index) \ @@ -189,7 +190,7 @@ /* In case the last node is reached just use that one, it is the right match. */ - if (i + 1 == tree->nodes && !tree->leaf) + if (i + 1 == nodescount && !tree->leaf) { next = grub_be_to_cpu32 (EXTNODE (tree, i)->data); break; Index: gensymlist.sh.in =================================================================== --- gensymlist.sh.in (revision 27991) +++ gensymlist.sh.in (working copy) @@ -14,7 +14,7 @@ ### The configure script will replace these variables. srcdir=@srcdir@ -CC=@CC@ +CC="@CC@" cat < #include +/* RDB partition tables for AROS */ +struct grub_partition_map *grub_rdb_partition_map = NULL; + static struct grub_partition_map grub_pc_partition_map; #ifndef GRUB_UTIL @@ -149,8 +152,42 @@ && ! grub_pc_partition_is_extended (e->type)) { pcdata.dos_part++; - - if (hook (disk, &p)) + + /* Check if this is a RDB partition table. */ + if (grub_rdb_partition_map && grub_pc_partition_is_rdb(e->type)) + { + struct grub_partition p2; + struct grub_disk raw2; + int ok = 0; + + auto int rdb_hook(grub_disk_t disk, const grub_partition_t p); + + int rdb_hook(grub_disk_t disk __attribute__((unused)), + const grub_partition_t part) + { + p2 = *part; + pcdata.bsd_part = part->index; + + p2.start += p.start; + p2.offset += p.offset; + p2.data = &pcdata; + p2.partmap = &grub_pc_partition_map; + + grub_dprintf("partition", "RDB part %c start=%ld\n", + (char)('a' + part->index), (long)p2.start); + + ok = hook(disk, &p2); + return ok; + } + + raw2 = raw; + raw2.partition = &p; + + grub_rdb_partition_map->iterate(&raw2, rdb_hook); + if (ok) + goto finish; + } + else if (hook (disk, &p)) goto finish; /* Check if this is a BSD partition. */