[syslinux] [PATCH 1/1] core: Check if ldlinux.sys exceeds the limit at its building time.

Ady ady-sf at hotmail.com
Wed May 28 03:00:48 PDT 2014


> > On May 25, 2014 3:39 AM, "Geert Stappers" <stappers at stappers.nl> wrote:
> > >
> > >
> > > While going throug old posts found:
> > >
> > > Op 2013-08-31 om 17:01 schreef Raphael S.Carvalho:
> > > > Calc the size of ldlinux.sys from ldlinux.bin, and check if it exceeds
> > the limit.
> > > > ldlinux.sys must fit between the bootsector and two copies of ADV whose
> > size may vary.
> > > > Thus, the size of ldlinux.sys (limit) can be at most: 65536 - 2 *
> > ADV_SIZE - 512.
> > > >
> > > > Certain file systems (such as BTRFS and UFS2) will rely on ldlinux.sys
> > being installed on the 0-64k range,
> > > > thus it can't exceed the limit, otherwise the superblock would be
> > corrupted.
> >
> > Raphael/Paulo: does UFS2 have a hard 64kiB limit?  I know it's not
> > installed to the first sector where the first superblock is located.
> >
> > > IMNSHO is including core/ldlinux_limit.pl better
> > > than waiting for a better core/ldlinux_limit.pl
> >
> > This should be rendered obsolete and unnecessary with the recent patch for
> > ldlinux.sys on btrfs (but might be relevant for UFS2).
> >
> > --Gene
> 
> Hi everyone, it's been a long time. Anyway, let's go to what really
> matters here.
> 
> 1) No, neither ufs1 nor ufs2 has support to the COW feature.
> That being said, ldlinux.sys can be installed as a regular file unlike
> BTRFS (should we fall back to this approach when ldlinux.sys size is
> greater than 64kb or make it a default decision for ufs1/2?). I don't
> know enough details of the installer, so here is my question: does it
> currently provide a way of patching the bootsector to point to a
> regular file rather than a fixed location?
> 
 
I would consider the ldlinux.sys file to be "almost regular" (except 
for Btrfs and perhaps for XFS as already commented in prior emails in 
this email thread). It is a regular file, but its precise sector's 
location is part of the Syslinux VBR (so it shouldn't be moved). This 
is one of the reasons for having a Syslinux "installer" dealing with 
ldlinux.sys (in addition to dealing with the VBR itself).

This is probably a known matter for most subscribers to this Syslinux 
Mailing List, but since the question is here...
 
> 2) Unfortunately, ufs2 superblock location could be either 64K or
> 256K, so we cannot assume the limit being higher than 64k.
> 
> 3) Regarding to the script, I think we actually need to shrink the
> core before applying it.
> With hpa's change (did it fix the btrfs problem at all?), the core is
> now theoretically allowed to grow further than the limit (e.g. for
> btrfs), right?!
> Also worth mentioning that there is a second version of this patch
> (reviewed by Matt, but wasn't applied due to the problems with the
> size of the core) that changes the script to dinamically gathers the
> ADV_SIZE from the respective header (as requested by Matt Fleming).
 
 
For Btrfs, the issue is being resolved by Peter. I think that the 
matter of changing the ADV_SIZE has not been completed yet, but I 
also think this is not a show-stopper for 6.03. I could be wrong.
 
> 
> 4) Suppose that by re-working on the installer changes from my UFS1/2
> patchset, i.e. installing ldlinux.sys as a regular file instead (when
> ldlinux.sys is higher than 64KB?), it could be put on the queue of
> patches to go upstream. Right? Matt Fleming was about to apply it in
> the past, but then the limit problem showed up.
 
If ldlinux.sys can be handled as regular file in UFS1/2 (with the 
caveat I mentioned before), then IMHO its size shouldn't be a 
consideration at this point. If, instead, under any potential 
circumstances the VBR can't find the ldlinux.sys file in UFS1/2, then 
some alternative solution would be needed.
 
> 
> Please tell me if I've missed some point here. Currently using digest
> mode, but I do really have to change it as replying each mail
> separately turns out to be very hard to accomplish.
> 
> Thanks in advance,
> Raphael S. Carvalho

Regards,
Ady.


More information about the Syslinux mailing list