[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH] Sector 2 of non-embedded core.img: write early or patch

From: Bean
Subject: Re: [RFC PATCH] Sector 2 of non-embedded core.img: write early or patch later?
Date: Sat, 28 Jun 2008 12:46:39 +0800

On Sat, Jun 28, 2008 at 5:24 AM, Pavel Roskin <address@hidden> 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.


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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]