On Sat, Jun 28, 2008 at 5:24 AM, Pavel Roskin <[EMAIL PROTECTED]> wrote:
> Hello!
>
> We have a serious problem with installing onto partitions (e.g.
> grub-install /dev/sda1) and drives with geometry that doesn't leave
> enough space for core.img to be embedded before the first partition.
> While it's not a desirable configuration, it should work, but it
> doesn't.
>
> Either we should write sector 2 before the core.img is checked for
> readability or we should delay patching sector 2 in memory until the
> verification is done.  Otherwise, the verification will fail.
>
> Delayed patching changes nothing in terms of I/O but needs a longer
> patch and won't scale well if we want to put more information into
> sector 2, as we'll need to cache more data.
>
> Writing sector 2 early is less intrusive in terms of code, but may be
> slower e.g. on floppies.  It's probably more reliable because we verify
> that the modified sector 2 made it to the filesystem.
>
> I tend to prefer the later ("write early") approach, but I'd like to see
> some feedback before I commit it.
>
> Both proposed patches are attached.

Hi,

Here are some thoughts:

1, We can store the original content before making change.

2, Or when we modify data, we change both of the buffer, so that the
comparison would not fail.

-- 
Bean


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to