On Wed, Jun 04, 2008 at 11:49:14AM +0800, Bean wrote: > On Wed, Jun 4, 2008 at 5:09 AM, Robert Millan <[EMAIL PROTECTED]> wrote: > > > > I've been thinking a bit more about this, and I think it should be > > possible to solve the problem at hand without extending the existing > > framework. I'm concerned about finding a solution that is as simple > > (and small) as possible. > > > > Do you mind waiting a few days? I'll send a proposal tomorrow or so. > > Ok, no hurry.
Sorry for the delay; it was quite a bit of work as I got hit by a number of bugs here and there :-) Considering that the problem was quite similar to the "boot from LVM" issue we already knew about, I thought it'd be a good idea to start with that. Although not directly related, the patch at in "boot from LVM / RAID" mail I just sent would allow to easily boot via UUID as well. If we add a UUID-based disk driver (see "disk/fs_uuid.c" mail), then it's just a matter of increasing the grub_prefix size so that an UUID can fit in it, and adjusting the install scripts to do it. Here's a sample (untested) patch to illustrate it. Then for the Vista use case, I suppose the remaining questions are if NTFS supports UUIDs (or otherwise we have to ressort to labels?), and if we can extract filesystem metadata from Windows (if possible without requiring that a Cygwin installation is present). -- Robert Millan <GPLv2> I know my rights; I want my phone call! <DRM> What good is a phone call… if you are unable to speak? (as seen on /.)
diff -x ChangeLog -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp ../tmp.old/include/grub/i386/pc/kernel.h ./include/grub/i386/pc/kernel.h --- ../tmp.old/include/grub/i386/pc/kernel.h 2008-06-06 18:29:28.000000000 +0200 +++ ./include/grub/i386/pc/kernel.h 2008-06-06 18:32:27.000000000 +0200 @@ -41,7 +41,7 @@ #define GRUB_KERNEL_MACHINE_PREFIX 0x20 /* End of the data section. */ -#define GRUB_KERNEL_MACHINE_DATA_END 0x50 +#define GRUB_KERNEL_MACHINE_DATA_END 0x60 /* The size of the first region which won't be compressed. */ #define GRUB_KERNEL_MACHINE_RAW_SIZE (GRUB_KERNEL_MACHINE_DATA_END + 0x450) diff -x ChangeLog -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp ../tmp.old/util/i386/pc/grub-install.in ./util/i386/pc/grub-install.in --- ../tmp.old/util/i386/pc/grub-install.in 2008-06-06 18:30:02.000000000 +0200 +++ ./util/i386/pc/grub-install.in 2008-06-06 18:33:26.000000000 +0200 @@ -232,13 +232,13 @@ partmap_module=`$grub_probe --target=par devabstraction_module=`$grub_probe --target=abstraction --device ${grub_device}` if [ "x${devabstraction_module}" = "x" ] ; then - prefix_drive= + prefix_drive=\(UUID=`$grub_probe --target=fs_uuid --device ${grub_device}`\) else prefix_drive=`$grub_probe --target=drive --device ${grub_device}` fi # _chain is often useful -modules="$modules $fs_module $partmap_module biosdisk $devabstraction_module _chain" +modules="$modules $fs_module $partmap_module biosdisk $devabstraction_module _chain fs_uuid" $grub_mkimage --output=${grubdir}/core.img \ --prefix=${prefix_drive}`make_system_path_relative_to_its_root ${grubdir}`/ \ diff -x ChangeLog -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp ../tmp.old/util/i386/pc/grub-setup.c ./util/i386/pc/grub-setup.c --- ../tmp.old/util/i386/pc/grub-setup.c 2008-06-06 18:30:02.000000000 +0200 +++ ./util/i386/pc/grub-setup.c 2008-06-06 18:32:27.000000000 +0200 @@ -300,7 +300,9 @@ setup (const char *prefix, const char *d block->segment = 0; /* Embed information about the installed location. */ - if (must_embed) + if (install_prefix[0] == '(') + /* If we included a drive explicitly in prefix, force GRUB to use that instead + of root_drive. */ *install_dos_part = *install_bsd_part = grub_cpu_to_le32 (-2); else if (root_dev->disk->partition) {
_______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel