On Sun, Jun 13, 2010 at 06:16:13PM +0200, Grégoire Sutre wrote: > On 06/12/2010 07:26 PM, Vladimir 'φ-coder/phcoder' Serbinenko wrote: >> And currently grub isn't changed to new partition notation >> completely. E.g. during startup prefix is calculated with old syntax >> and confusing A+B with either A or B is likely to make user drop into >> rescue shell > > Is someone working on making the startup prefix use the new notation?
I've only looked at the i386-pc startup sequence here, but the thing that jumps out at me is that grub_install_dos_part and grub_install_bsd_part are both longs. I doubt we really need to support 2 billion partitions. How about we split off, say, a byte of that to hold the partition map type, and then it would be easy enough for the startup code to turn that into appropriate prefixes? There are two downsides that I can see: * We would need to maintain an enum of partition map identifiers; but there's precedent for this approach already, such as grub_disk_dev_id. * The names of all the partition maps would have to live in the kernel somewhere; packed as sequential strings, this comes to 42 bytes plus the code to use it, which isn't a lot by most measures but I know we never have much slack in the kernel. I can think of an alternative. We do still need grub_install_dos_part and grub_install_bsd_part for the multiboot trampoline, which is in assembly, so it's difficult to abandon them altogether. However, there's no reason we need to use them in make_install_device. How about we invent a way to encode most of the information in string form in grub_prefix, while leaving a placeholder for make_install_device to fill in the disk? There are 64 bytes available for grub_prefix, which should be plenty. For example, how about the following (with \0 standing for ASCII NUL): (\0,msdos1,bsd1)/boot/grub It's then just a matter of spotting the "(\0," sequence and replacing the \0 with the drive name. I think this can probably be done using less code than the first option above, and all told it feels a bit less hacky to me. What do people prefer? -- Colin Watson [cjwat...@ubuntu.com] _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel