[syslinux] [PATCH 00/05] Mending for mkdiskimage

Thomas Schmitt scdbackup at gmx.net
Sat Jul 12 02:38:06 PDT 2014


Hi,

me:
> > It turned out that the lseek(2) function of NetBSD does not work
> > with SEEK_END as expected from the manual. 
hpa:
> Perl sysseek() is just a wrapper around lseek(2).

In this case the patch 3/5 will not help for NetBSD.

The remedy would be somewhat lengthy. Like in libburn:
http://libburnia-project.org/browser/libburn/trunk/libburn/sg-netbsd.c#L267

(Probably one can find more concise binary search implementations,
 and maybe perl even offers some generic search function which
 one could use ...)


me:
> > It might be desirable to have an option for explicitely setting
> > a device size.

hpa:
> However, there is such an option already... if you specify cylinder
> count or, with the -M option, megabyte count.

Both are restricted to coarse granularity. Especially prime numbers
are a problem. Cylinder size also may already be determined by
bootability constraints.

SanDisk "cruzer micro 4 GB" has 7864319 blocks of 512 bytes
according to Linux ioctl(BLKGETSIZE). Factorization is 17 * 462607.


> >   Unclaimed space may remain after the end of the partition if the
> >   partition size stems from option -M, or is computed from arguments
> >   h and s because argument c is 0.
> >   Especially on device files, such space might contain a backup GPT
> >   which would be invalid after mkdiskimage but could lure partition
> >   editors into restoring the outdated main GPT.

hpa:
> I have concerns about this, especially in the light of the above.  I
> wouldn't want it to be the default at least.

It will happen only if less than one cylinder remains between
partition end and the detected or alleged end of the device or image.

Consider the problem of a backup GPT at the end of above USB stick.
An MBR partitioned disk is not really healthy with such an end.

One could make this feature depend on a new option. But documenting
it and its use cases would require a lengthy piece of text.
So i rather propose to decide whether it shall be in or not.


Have a nice day :)

Thomas



More information about the Syslinux mailing list