extlinux: add code to automate extlinux.sys -> ldlinux.sys migration

- Be able to modify the ADV either in extlinux.sys or ldlinux.sys
- Be able to preserve the ADV from extlinux.sys
- Remove extlinux.sys when installing ldlinux.sys

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
ifcpu: printing usage if no parameter

If you just call the ifcpu.32 it display the usage.
advio: make read_adv() distinguish ENOENT from other errors

Make it possible to distinguish ENOENT from other "non-fatal" errors
in read_adv(), so we can try more than one filename.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
chain: A sprinkling of documentation

Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
disklib: Add WEE bootloader detection code

WEE, is a bootloader based on grub4dos. It fits in the first 63 sectors of
the drive.

The first 4 bytes are:
$ hexdump -n 4 /media/Data/ubcd-new/wee-2010-06-20/wee63.mbr
0000000 5eeb 0090
0000004

Or in the format get_mbr_string wants it:
$ hexdump -C -n 4 wee63.mbr
00000000  eb 5e 90 00

Patch tested in qemu:
  qemu -boot d -cdrom hdt.iso -hda wee-2010-06-20/wee63.mbr
extlinux: fix ADV handling, so extlinux.sys -> ldlinux.sys actually works

Do the appropriate thing for various error cases, so that the
migration code actually does the right thing.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Merge branch 'master' of ssh://terminus.zytor.com/pub/git/syslinux/syslinux
ifcpu: Adding PAE support
Merge remote branch 'erwan/master_new'
chain: Allow booting the Syslinux partition with "fs"

We will now accept an "fs" option which instructs us to
chain-load whatever partition we were booted from.  Not
useful for PXELINUX, for obvious reasons.  Can be used
in combination with a "file=" option, to boot something
other than Syslinux.

Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Rename dir.c32 -> ls.c32

Use the term "ls" for directory listing, like real operating systems
;)

	-hpa
Adding note about extlinux.conf in extlinux manpage.
Updating description in syslinux manpage wrt/ default entries as of syslinux >= 3.85.
doc/gpt.txt: this is now fully implemented

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
pxe: fix ip_ok()

Make it easier to read, but fix the address for the loopback network
(127, not 255).

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
pxe: fix the unload sequence

For somewhat unclear reasons, the PXE unload sequence took the old PXE
path (pre-2.00 API).  Take the new sequence if available.  Also
improve the error message.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
chain: Implement GPT hand-over protocol as documented

When a partition was yielded by a GPT partition iterator,
we follow the protocol documented in syslinux/doc/gpt.txt.

Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
pxe: don't corrupt the length of an RRQ packet on retry

Due to double use of the variable "buf", we would end up corrupting
the length, but not the contents, of an RRQ packet if we ended up
having to re-send.  Some TFTP servers ignored the extra garbage
(including tftp-hpa), others would refuse to accept the RRQ, causing
failures.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Merge remote branch 'sha0/chain_gpt'
chain.c32: correctly set the length of the GPT handover structure

We need to make sure the entire GPT handover structure is mapped
correctly by the shuffler.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>