[LinuxBIOS] [PATCH] LAR: linearly count segment numbers

Alex Beregszaszi alex at rtfs.hu
Thu Sep 6 04:30:28 CEST 2007


Hi,

when outputting ELF segments in LAR, the utility will use the segment
number from ELF as segment number in the file. This works nicely when
there are no skips (e.g. not PT_LOAD segments, which are discarded).

If one segment is skipped, we get a bump:

  normal/payload0/segment0 (27288 bytes, lzma compressed to 14506 bytes
@0x64c0)
  normal/payload0/segment2 (211136 bytes, lzma compressed to 70905 bytes
@0x9dc0)

The LAR loader wont load segment2, and in this particular case, grub2-lb
will only boot into rescue mode (segment0 contains it).

Attached patch adds a counter for segment number in the LAR utility to
solve this bug:

  normal/payload0/segment0 (27288 bytes, lzma compressed to 14506 bytes
@0x64c0)
  normal/payload0/segment1 (211136 bytes, lzma compressed to 70905 bytes
@0x9dc0)

Also the eagle eyed can see that I merged in Uwe's multiple-payload
patch into current stage1, which includes the segment support. And this
means that grub2-lb without any hacks works when loaded from LAR
segments.

--
Alex

-------------- next part --------------
A non-text attachment was scrubbed...
Name: lar-linear-segments.diff
Type: text/x-patch
Size: 691 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20070906/3a14e4c7/attachment.diff>


More information about the coreboot mailing list