[syslinux] [PATCH] git tree: libfat, chain, mtools/syslinux, menu.txt

Gene Cumm gene.cumm at gmail.com
Wed Aug 25 15:50:44 PDT 2010


On Wed, Aug 25, 2010 at 18:17, Gene Cumm <gene.cumm at gmail.com> wrote:
> Another approach to take is to open it with libfat_open() (original)
> back before ldlinux.sys is dropped in, close it if it opens
> successfully and announce the file system is corrupt, forcing the user
> to fix it first.

Come to think of it, I can name two reasons we should use
libfat_open() (whichever version is your preference) before we even
think about touching the disk/image.

1) If the file system is genuinely corrupt, copying in ldlinux.sys
will only make matters worse.

2) If we're successful in dropping in an ldlinux.sys, failing later
would only lead to end user confusion and frustration for why their
partition is not bootable.  grep'ing the code, libfat_open is in
mtools, dos, and win syslinux.c after ldlinux.sys is written.

> fsck.vfat (not sure on its original name; I'm accustomed to calling
> fsck and mkfs by the standardized name) currently can't deal with
> this.
>
> The fixfat utility I created checks/tweaks the one value.  If you call
> it without -f it checks and the return code says if it's needed.  With
> -f, it'll return an error if it really is a sane value.  This forces
> you to run it twice if you're paying attention to the returns to
> attempt to make a user use it correctly if it's in a script, just to
> be a little paranoid.

Adding to that, if the decision is for libfat_open() to fail based on
bsSectors/bsHugeSectors being larger than it should be, fixfat should
be compiled for all environments that use libfat_open() and should be
recompiled anytime these installers are recompiled (at least in the
case of the mtools as mtools/syslinux should be deleted with 'make
clean' and rebuilt with 'make installers'; it doesn't appear 'make
installers' rebuilds the dos or win* installers).

>From there, the only decision is should fixfat be scriptable as it is
or should it require user input (in which case echoing in the proper
key(s) could still make it scriptable)?

-- 
-Gene




More information about the Syslinux mailing list