[coreboot] fix for cbfs error for longer file names

Myles Watson mylesgw at gmail.com
Tue May 12 15:05:49 CEST 2009


On Mon, May 11, 2009 at 10:32 AM, ron minnich <rminnich at gmail.com> wrote:
> attached.
>
> This came up when cbfs (correctly) diagnosed a rom as corrupt ... it
> was a bug in cbfs, but that's how it's supposed to work -- catch a bad
> rom at build time, not boot time.

+	csize = headersize(name);
+
+	strcpy(c->magic, COMPONENT_MAGIC);
+
+	c->offset = htonl(csize);

I think this code would be clearer without csize.

+	c->offset = htonl(headersize(name));

The only other comment I have is that rom_add is pretty trivial now.
It could disappear since it is only a wrapper for rom_alloc.  Is there
any time we want to do rom_alloc when we don't want to copy in the
data?

Acked-by: Myles Watson<mylesgw at gmail.com>

> BTW, you can simplify the existing coreboot code a bit if you add a
> "char filename[0];" entry to 'struct cbfs_file' - as SeaBIOS does.

I like that idea.

Thanks,
Myles




More information about the coreboot mailing list