Raphael S Carvalho
2014-May-27 01:57 UTC
[syslinux] [PATCH 1/1] core: Check if ldlinux.sys exceeds the limit at its building time.
> 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). > > --GeneHi 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? 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). 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. 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
H. Peter Anvin
2014-May-27 02:34 UTC
[syslinux] [PATCH 1/1] core: Check if ldlinux.sys exceeds the limit at its building time.
Yes, 1 is the common code for all filesystem. We only have to do special things for btrfs because of automatic storage rebalancing and and for XFS because of nonstandard VBR. On May 26, 2014 6:57:49 PM PDT, Raphael S Carvalho <raphael.scarv at gmail.com> wrote:>> 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? > >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). > >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. > >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-- Sent from my mobile phone. Please pardon brevity and lack of formatting.
Ady
2014-May-28 10:00 UTC
[syslinux] [PATCH 1/1] core: Check if ldlinux.sys exceeds the limit at its building time.
> > 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. CarvalhoRegards, Ady.
Seemingly Similar Threads
- [PATCH 1/1] core: Check if ldlinux.sys exceeds the limit at its building time.
- [PATCH v2] core: Check size of ldlinux.sys at building time.
- [PATCH 1/1] core: Check if ldlinux.sys exceeds the limit at its building time.
- [PATCH 1/1] core: Add a check at ldlinux.sys build time.
- [PATCH 001/001] Add UFS1/2 support to Extlinux installer.