profile/ivi/syslinux.git
14 years agodos: Work-in-progress
Shao Miller [Sat, 3 Jul 2010 23:06:10 +0000 (19:06 -0400)]
dos: Work-in-progress

14 years agowin32: Use libinstaller option parser
Shao Miller [Sat, 3 Jul 2010 20:23:44 +0000 (16:23 -0400)]
win32: Use libinstaller option parser

We will produce an error message if a user attempts
to use an option we don't implement.

Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
14 years agomtools: Use libinstaller option parser
Shao Miller [Sat, 3 Jul 2010 10:04:16 +0000 (06:04 -0400)]
mtools: Use libinstaller option parser

We will produce an error message if a user attempts
to use an option we don't implement.

Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
14 years agolibinstaller: Add --mbr, --active, and --force options
Shao Miller [Sat, 3 Jul 2010 07:47:25 +0000 (03:47 -0400)]
libinstaller: Add --mbr, --active, and --force options

In order to consolidate the installer option-parsing system,
we add the --mbr (-m), --active (-a), and --force (-f)
options from the DOS, Win32, and mtools installers to
libinstaller.

Since the -m and -a options are not currently valid for the
Linux 'syslinux' and 'extlinux' installers, we add error
messages to both of these.  The -f option is allowed but
does nothing for them.

Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
14 years agocom32: update getopt() to the current version from klibc
H. Peter Anvin [Sat, 3 Jul 2010 01:00:42 +0000 (18:00 -0700)]
com32: update getopt() to the current version from klibc

Update getopt() to the current klibc version.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agocom32: add getopt_long() to the library
H. Peter Anvin [Sat, 3 Jul 2010 00:57:17 +0000 (17:57 -0700)]
com32: add getopt_long() to the library

Add getopt_long() to the library.  This is code lifted straight out of
klibc.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoNEWS, version: now working on version 4.02
H. Peter Anvin [Fri, 2 Jul 2010 23:48:24 +0000 (16:48 -0700)]
NEWS, version: now working on version 4.02

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agocore: split loadconfig.c into two files
H. Peter Anvin [Fri, 2 Jul 2010 23:19:59 +0000 (16:19 -0700)]
core: split loadconfig.c into two files

Split loadconfig.c into two files.  In particular, isolinux needs
search_config() but not generic_load_config().

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agocore: merge the configfile-searching code, isolinux generic names
H. Peter Anvin [Fri, 2 Jul 2010 23:13:44 +0000 (16:13 -0700)]
core: merge the configfile-searching code, isolinux generic names

Merge the config file searching code between syslinux and isolinux,
and make isolinux also recognize the generic names "syslinux" and
"syslinux.cfg".  Thus, isolinux now searches for configuration files
in the following order:

/boot/isolinux/isolinux.cfg
/boot/isolinux/syslinux.cfg
/isolinux/isolinux.cfg
/isolinux/syslinux.cfg
/boot/syslinux/isolinux.cfg
/boot/syslinux/syslinux.cfg
/syslinux/isolinux.cfg
/syslinux/syslinux.cfg
/isolinux.cfg
/syslinux.cfg

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agocore: always canonicalize the configuration file name
H. Peter Anvin [Fri, 2 Jul 2010 23:01:19 +0000 (16:01 -0700)]
core: always canonicalize the configuration file name

The FAT installers may not produce a canonical pathname in the
CurrentDirName field on entry.  Make sure that the core doesn't croak
when that happens, and still produces an absolute pathname for the
configuration file.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agolua: quiet warnings about unused variables and functions syslinux-4.01
H. Peter Anvin [Fri, 2 Jul 2010 18:19:39 +0000 (11:19 -0700)]
lua: quiet warnings about unused variables and functions

Quiet gcc warnings about unused variables and functions -- things that
are not used in the Syslinux environment at this time.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agolua: add parents to luaconf.h to quiet a gcc warning
H. Peter Anvin [Fri, 2 Jul 2010 18:18:57 +0000 (11:18 -0700)]
lua: add parents to luaconf.h to quiet a gcc warning

gcc warns about suspicious-looking code with a comparison inside ==.
The code is correct, but add parens so that gcc know we know it is
correct.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agolua: add missing <syslinux/boot.h> to syslinux.c
H. Peter Anvin [Fri, 2 Jul 2010 18:18:24 +0000 (11:18 -0700)]
lua: add missing <syslinux/boot.h> to syslinux.c

Need header files for functions we invoke.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agolua: Modernize the Makefile
H. Peter Anvin [Fri, 2 Jul 2010 18:16:40 +0000 (11:16 -0700)]
lua: Modernize the Makefile

Modernize the Makefile for lua to match the current style, in
particular to have it pick up its configuration and rules from the
central MCONFIG file.

This also fixes the incorrect use of "clean" vs. "spotless" which was
picked up from the Makefile style in use at that time.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agoNEWS: explain the memory overwrite bug a bit better
H. Peter Anvin [Fri, 2 Jul 2010 18:00:51 +0000 (11:00 -0700)]
NEWS: explain the memory overwrite bug a bit better

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoFix nuisance _FORTIFY_SOURCE failures
H. Peter Anvin [Fri, 2 Jul 2010 16:49:45 +0000 (09:49 -0700)]
Fix nuisance _FORTIFY_SOURCE failures

Fix a couple of _FORTIFY_SOURCE failures which are nuisance warnings,
but fortunately not too hard to just plain avoid.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoinstallers: handle asprintf() correctly
H. Peter Anvin [Fri, 2 Jul 2010 16:39:18 +0000 (09:39 -0700)]
installers: handle asprintf() correctly

It appears that the glibc version of asprintf() is braindamaged, and
doesn't set the target pointer to NULL in the event of an error (only
returns -1).  Therefore we need to check the return value.  Just in
case someone else made the *opposite* error, also check the pointer.

Bleh.  The glibc documentation states that *BSD sets the pointer to
NULL, but instead of following that, the glibc people put
warn_unused_result on asprintf.  Sigh.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoDocument 'nopassany' in MEMDISK documentation.
Gert Hulselmans [Sat, 6 Mar 2010 21:56:41 +0000 (13:56 -0800)]
Document 'nopassany' in MEMDISK documentation.

'nopassany' is missing in the MEMDISK documentation:
http://www.zytor.com/pipermail/syslinux-commits/2010-February/000096.html

14 years agopxelinux: new IPAPPEND 4 to generate a SYSUUID= option. syslinux-4.01-pre3
H. Peter Anvin [Fri, 2 Jul 2010 02:44:53 +0000 (19:44 -0700)]
pxelinux: new IPAPPEND 4 to generate a SYSUUID= option.

Add a new IPAPPEND option to generate a SYSUUID= option with the
in-system UUID.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoMakefile: add lua.c32 to installables syslinux-4.01-pre2
H. Peter Anvin [Fri, 2 Jul 2010 01:12:41 +0000 (18:12 -0700)]
Makefile: add lua.c32 to installables

lua.c32 is an installable file.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agocore, diskio: reset controller between EDD retries
H. Peter Anvin [Fri, 2 Jul 2010 01:10:22 +0000 (18:10 -0700)]
core, diskio: reset controller between EDD retries

As documented in the old assembly code, reset the disk controller
between retries when using EDD.  We don't want to do that for CHS,
since a reset shuts down the floppy motor, and we might be suffering a
timeout.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agoMerge branch 'lua'
H. Peter Anvin [Fri, 2 Jul 2010 01:08:24 +0000 (18:08 -0700)]
Merge branch 'lua'

Resolved Conflicts:
NEWS

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agoNEWS: document memory overwrite fix
H. Peter Anvin [Fri, 2 Jul 2010 01:05:57 +0000 (18:05 -0700)]
NEWS: document memory overwrite fix

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agocom32: canonicalize DEBUG to mean <dprintf.h>
H. Peter Anvin [Fri, 2 Jul 2010 01:04:13 +0000 (18:04 -0700)]
com32: canonicalize DEBUG to mean <dprintf.h>

Remove historical uses of DEBUG/dprintf in favor of the centralized
<dprintf.h>.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agozlib: change DEBUG to DEBUG_ZLIB
H. Peter Anvin [Fri, 2 Jul 2010 01:03:01 +0000 (18:03 -0700)]
zlib: change DEBUG to DEBUG_ZLIB

zlib uses DEBUG for something slightly different than the Syslinux
main code, so change the name of the symbol.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agodprintf: allow overriding the serial port address
H. Peter Anvin [Fri, 2 Jul 2010 01:02:11 +0000 (18:02 -0700)]
dprintf: allow overriding the serial port address

Allow overriding the serial port address, e.g. for systems which only
have PCI serial ports.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agocomboot.inc: vk_append is a field in a struct, not an address
H. Peter Anvin [Fri, 2 Jul 2010 00:59:30 +0000 (17:59 -0700)]
comboot.inc: vk_append is a field in a struct, not an address

We want to use VKernelBuf as temporary storage, not vk_append.
vk_append is an offset into a larger buffer, and we ended up
corrupting low BIOS memory.

Reported-by: Joseph Cihula <joseph.cihula@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agoNEWS: add lua.c32
H. Peter Anvin [Thu, 1 Jul 2010 21:29:42 +0000 (14:29 -0700)]
NEWS: add lua.c32

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agolua: update for Syslinux 4
Geert Stappers [Thu, 1 Jul 2010 19:14:38 +0000 (21:14 +0200)]
lua: update for Syslinux 4

Update the lua code to work with Syslinux 4.

14 years agoMerge branch 'master' into lua
H. Peter Anvin [Thu, 1 Jul 2010 21:26:36 +0000 (14:26 -0700)]
Merge branch 'master' into lua

Resolved Conflicts:
com32/Makefile

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agoMCONFIG: add -Wno-error to .lnx files
H. Peter Anvin [Thu, 1 Jul 2010 21:21:14 +0000 (14:21 -0700)]
MCONFIG: add -Wno-error to .lnx files

Again, .lnx files are test vehicles... erroring out due to warnings
makes no sense.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agoMCONFIG: .lnx files are for testing, don't do _FORTIFY_SOURCE
H. Peter Anvin [Thu, 1 Jul 2010 21:15:38 +0000 (14:15 -0700)]
MCONFIG: .lnx files are for testing, don't do _FORTIFY_SOURCE

.lnx files are strictly a testing vehicle.  It makes absolutely no
sense to enforce the often rather arbitrary rules of _FORTIFY_SOURCE
on those, so override the default _FORTIFY_SOURCE setting.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agoifplop.c32: Detect if PLoP USB/CD INT13h hook is enabled/disabled
Gert Hulselmans [Thu, 1 Jul 2010 15:57:44 +0000 (17:57 +0200)]
ifplop.c32: Detect if PLoP USB/CD INT13h hook is enabled/disabled

New module which detects if the PLoP Boot Loader already has booted a
CDROM or USB drive by checking for the presence of the PLoP INT13h hook.

The following assembly code (NASM) can detect the PLoP INT13h hook:

  mov eax,'PoLP'  ; Reverse of 'PLoP'
  mov ebp,'DKHC'  ; Reverse of 'CHKD'
  int 13h
  cmp eax,' sey'  ; Reverse of 'yes '
  jz plop_INT13h_active

Signed-off-by: Gert Hulselmans <gerth@zytor.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agoMerge branch 'master' of ssh://terminus.zytor.com/pub/git/syslinux/syslinux
H. Peter Anvin [Thu, 1 Jul 2010 19:47:02 +0000 (12:47 -0700)]
Merge branch 'master' of ssh://terminus.zytor.com/pub/git/syslinux/syslinux

14 years agoNEWS: document changes to the CD-ROM initialization sequence syslinux-4.01-pre1
H. Peter Anvin [Thu, 1 Jul 2010 14:22:30 +0000 (07:22 -0700)]
NEWS: document changes to the CD-ROM initialization sequence

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agocore, diskio: skip EDD/CHS detect for CD-ROMs
H. Peter Anvin [Wed, 30 Jun 2010 21:02:56 +0000 (14:02 -0700)]
core, diskio: skip EDD/CHS detect for CD-ROMs

Skip EDD and CHS detection if we know it is a CD-ROM, because some
CD-ROMs possibly report bad information, and/or screw up the stack,
possibly permanently.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agocore, diskio: move dprintfs to the intended location
H. Peter Anvin [Thu, 1 Jul 2010 14:19:23 +0000 (07:19 -0700)]
core, diskio: move dprintfs to the intended location

Move the dprintfs to the location that they were intended to use.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agocore, diskio: put the error code in dprintf and printable messages
H. Peter Anvin [Wed, 30 Jun 2010 16:53:46 +0000 (09:53 -0700)]
core, diskio: put the error code in dprintf and printable messages

When we print an error message to the screen, include the error
number.  Furthermore, dprintf it on retries.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agomboot.h: use <dprintf.h>
H. Peter Anvin [Wed, 30 Jun 2010 00:45:23 +0000 (17:45 -0700)]
mboot.h: use <dprintf.h>

Use <dprintf.h> like more and more of the system does...

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agoNEWS: beginning of a 4.01 NEWS file
H. Peter Anvin [Wed, 30 Jun 2010 00:21:43 +0000 (17:21 -0700)]
NEWS: beginning of a 4.01 NEWS file

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agodiskstart: don't let the function number clobber the LBA
H. Peter Anvin [Wed, 30 Jun 2010 00:17:58 +0000 (17:17 -0700)]
diskstart: don't let the function number clobber the LBA

The LBA for getonesec and getlinsec is in EDX:EAX, but both DL and AX
are function inputs to INT 13h (drive number and function number).  We
need to preserve the LBA across *both* those, otherwise retries will
not function.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agoisolinux: don't clobber DX (DL!) on startup
H. Peter Anvin [Tue, 29 Jun 2010 22:17:11 +0000 (15:17 -0700)]
isolinux: don't clobber DX (DL!) on startup

DL contains the initial drive number, don't clobber it!

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agoisolinux: make sure Hidden is zero in native El Torito mode
H. Peter Anvin [Tue, 29 Jun 2010 20:27:03 +0000 (13:27 -0700)]
isolinux: make sure Hidden is zero in native El Torito mode

In native El Torito mode, there is no such thing as a partition
offset.  Make sure that we set Hidden to zero -- we don't use Hidden
(yet, although the ebios and cdrom code should be merged!) but we pass
it to the PM code, which will produce *really* wrong results...

Reported-by: Helmut Hullen <Hullen@t-online.de>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agocore, diskio: add a few dprintf()'s
H. Peter Anvin [Tue, 29 Jun 2010 17:36:28 +0000 (10:36 -0700)]
core, diskio: add a few dprintf()'s

Add a handful of dprintf's to make it easier to debug disk I/O
failures.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agoversion: next version in 4.01
H. Peter Anvin [Mon, 28 Jun 2010 22:59:25 +0000 (15:59 -0700)]
version: next version in 4.01

4.00 is out, start work on 4.01...

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agoMerge remote branch 'debian/daniel'
H. Peter Anvin [Mon, 28 Jun 2010 22:56:43 +0000 (15:56 -0700)]
Merge remote branch 'debian/daniel'

14 years agoMerge remote branch 'sha0/newness' syslinux-4.00
H. Peter Anvin [Mon, 28 Jun 2010 21:42:11 +0000 (14:42 -0700)]
Merge remote branch 'sha0/newness'

14 years agoNEWS: Document mdiskchk.com and eltorito.sys changes
Shao Miller [Mon, 28 Jun 2010 21:41:21 +0000 (14:41 -0700)]
NEWS: Document mdiskchk.com and eltorito.sys changes

14 years agoconfig.c32: accept an optional new directory
H. Peter Anvin [Mon, 28 Jun 2010 21:37:45 +0000 (14:37 -0700)]
config.c32: accept an optional new directory

Accept an optional new directory to config.c32, just as we permit for
the CONFIG statement.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agodiskio: hard-code CD-ROM sectors to 2048 bytes
H. Peter Anvin [Mon, 28 Jun 2010 21:34:08 +0000 (14:34 -0700)]
diskio: hard-code CD-ROM sectors to 2048 bytes

At least the ThinkPad T22 and T23 will incorrectly report a sector
size of 512 bytes for El Torito CD-ROMs.  Ignore the reported sector
size for El Torito boots.

Reported-by: Helmut Hullen <hullen@t-online.de>
Tested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agoNEWS: document MENU IMMEDIATE
H. Peter Anvin [Mon, 28 Jun 2010 20:51:15 +0000 (13:51 -0700)]
NEWS: document MENU IMMEDIATE

14 years agoNEWS: document isohybrid.c
H. Peter Anvin [Mon, 28 Jun 2010 20:48:21 +0000 (13:48 -0700)]
NEWS: document isohybrid.c

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agoNEWS: document ifcpu*.c32 fix
H. Peter Anvin [Mon, 28 Jun 2010 20:47:37 +0000 (13:47 -0700)]
NEWS: document ifcpu*.c32 fix

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agoNEWS: Fixing HDT, adding ifcpu changes
Erwan Velu [Mon, 28 Jun 2010 19:39:04 +0000 (21:39 +0200)]
NEWS: Fixing HDT, adding ifcpu changes

14 years agoNEWS: first cut of a NEWS file for 4.00
H. Peter Anvin [Mon, 28 Jun 2010 19:24:28 +0000 (12:24 -0700)]
NEWS: first cut of a NEWS file for 4.00

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agocore, chdir: collapse slashes, avoid copy-to-self syslinux-4.00-pre64
H. Peter Anvin [Mon, 28 Jun 2010 01:46:36 +0000 (18:46 -0700)]
core, chdir: collapse slashes, avoid copy-to-self

Collapse multiple slashes into one (this still doesn't resolve . and
.. in the path, since that requires awareness of symlinks.)

This code also avoids a copy-over-self bug by introducing a temporary
buffer.

Reported-by: Gene Cumm <gene.cumm@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoMerge remote branch 'sha0/gert_chain'
H. Peter Anvin [Mon, 28 Jun 2010 01:29:02 +0000 (18:29 -0700)]
Merge remote branch 'sha0/gert_chain'

14 years agochain.c32: pass partition number to stage2 of Grub Legacy
Gert Hulselmans [Mon, 28 Jun 2010 01:11:48 +0000 (03:11 +0200)]
chain.c32: pass partition number to stage2 of Grub Legacy

Grub Legacy stage2 will read the install_partition variable from
memory address 0x8208.
We only need to change the value at 0x820a to the correct partition
number:
  -1:   whole drive (default)
  0-3:  primary partitions
  4-*:  logical partitions

Signed-off-by: Gert Hulselmans <gerth@zytor.com>
14 years agorosh: update for Syslinux 4 and make it more usable
Gene Cumm [Mon, 28 Jun 2010 01:09:23 +0000 (18:09 -0700)]
rosh: update for Syslinux 4 and make it more usable

Without further adieu, I would like to announce that I've finally
pushed ROSH, the Read-Only SHell, finally to the point of being
reasonably usable.

Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agochain.c32: only pass partition number in DH, when grldr= is used
Gert Hulselmans [Mon, 28 Jun 2010 00:42:58 +0000 (02:42 +0200)]
chain.c32: only pass partition number in DH, when grldr= is used

Add grldr= as boot parameter, so the partition number is only passed to
grub4dos grldr, when grldr= is used.

Currently the partition number is passed in DH unconditionally.
As consequence, grldr will set its root partition on which is searches its
menu.lst to (hd0), because -1 (whole drive) is passed in DH as root partition:
  chain.c32 file=/grldr

When the conditional check, this problem is solved:
  chain.c32 file=/grldr
Grub4dos will search all partitions for its menu.lst

When you want to set the root partition, use something like the following:
  chain.c32 hd0,2 grldr=/grldr
  chain.c32 fs grldr=/grldr

Signed-off-by: Gert Hulselmans <gerth@zytor.com>
14 years agoMerge remote branch 'sha0/gert_chain'
H. Peter Anvin [Mon, 28 Jun 2010 00:48:58 +0000 (17:48 -0700)]
Merge remote branch 'sha0/gert_chain'

14 years agochain.c32: add keeppxe to usage output and cleanup comments
Gert Hulselmans [Mon, 28 Jun 2010 00:13:39 +0000 (02:13 +0200)]
chain.c32: add keeppxe to usage output and cleanup comments

Add keeppxe to usage output.
Cleanup some comments.

14 years ago<linux/loop.h>: deal with really ancient Linux kernel headers
H. Peter Anvin [Mon, 28 Jun 2010 00:09:18 +0000 (17:09 -0700)]
<linux/loop.h>: deal with really ancient Linux kernel headers

RHEL4 had a 2.6.9 kernel, but 2.4.20 Linux kernel headers, so put in a
workaround for 2.4 kernel headers.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agolibinstaller: include <linux/loop.h>
H. Peter Anvin [Sun, 27 Jun 2010 23:38:25 +0000 (16:38 -0700)]
libinstaller: include <linux/loop.h>

Some versions of glibc have broken versions of <linux/loop.h>, so
include our own canned version.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoExport the 64-bit partition offset and use it in chain.c
H. Peter Anvin [Sun, 27 Jun 2010 19:02:48 +0000 (12:02 -0700)]
Export the 64-bit partition offset and use it in chain.c

When used with the "fs" option to chain.c32, we need to know our own
filesystem offset.  That means knowing if we used the MBR vs GPT
partition information, as well as if we ended up using the passed-in
information or not.

Resolve this by providing an explicit pointer to the current partition
offset.  Eventually this should be replaced by some kind of statfs()
call.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoisohdpfx: update to the new !GPT protocol
H. Peter Anvin [Sun, 27 Jun 2010 18:43:49 +0000 (11:43 -0700)]
isohdpfx: update to the new !GPT protocol

Update the check for !GPT to match the updated protocol (with length).

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agodiskstart: if no partition info is available, use bsHidden syslinux-4.00-pre63
H. Peter Anvin [Sun, 27 Jun 2010 04:31:08 +0000 (21:31 -0700)]
diskstart: if no partition info is available, use bsHidden

If we have no partition information available, use the bsHidden field
(which is set by the extlinux installer in the case of non-FAT).  This
gives at least a hope of working correctly (for < 2 TiB disks, at
least) with the stock Vista/Win7 MBR.

Also, add a check for partition type != 0.  This helps catch the case
when DS:SI points into all-zero memory.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoUpdate .gitignore
H. Peter Anvin [Sun, 27 Jun 2010 04:24:02 +0000 (21:24 -0700)]
Update .gitignore

14 years agoextlinux: set bsHidden for loop devices
H. Peter Anvin [Sun, 27 Jun 2010 04:22:48 +0000 (21:22 -0700)]
extlinux: set bsHidden for loop devices

If we are on a loop device, set bsHidden based on the loopback device
offset.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoPM getcwd(); Fix COM32 getcwd
Gene Cumm [Sun, 27 Jun 2010 02:51:39 +0000 (22:51 -0400)]
PM getcwd(); Fix COM32 getcwd

Implement getcwd() in the core; Fix COM32 getcwd() to use the new function.

This resolves the previous comment about COM32 getcwd() not working by
not using INT 22h AX=001Fh.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agocore: move PartInfo back to the top of stack
H. Peter Anvin [Sun, 27 Jun 2010 03:38:04 +0000 (20:38 -0700)]
core: move PartInfo back to the top of stack

Move PartInfo back to near the top of the stack.  This makes it less
likely that it ends up getting overwritten during the act of copying
itself.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agosyslinux.ld: remove redundant definition of STACK32_LEN
H. Peter Anvin [Sun, 27 Jun 2010 03:37:37 +0000 (20:37 -0700)]
syslinux.ld: remove redundant definition of STACK32_LEN

STACK32_LEN is already defined in layout.inc.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agomenu: add MENU HELP
H. Peter Anvin [Sun, 27 Jun 2010 03:28:45 +0000 (20:28 -0700)]
menu: add MENU HELP

Add a feature to display fullscreen help via menu selection entry
(inspired by the Debian install disc menus.)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agocore, fs: eliminate recursion in put_inode()
H. Peter Anvin [Sun, 27 Jun 2010 01:46:33 +0000 (18:46 -0700)]
core, fs: eliminate recursion in put_inode()

We don't actually need recursion in put_inode(), so replace recursion
with a loop.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agochain.c32: fix handover to a logical partition
H. Peter Anvin [Sun, 27 Jun 2010 01:07:59 +0000 (18:07 -0700)]
chain.c32: fix handover to a logical partition

Make sure the handover information to a logical partition is adjusted
correctly -- we can't just hand over the partition entry, but we have
to adjust start_lba to match the real start LBA.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agogptmbr: skip partitions with all-zero PartitionTypeGUID
H. Peter Anvin [Sun, 27 Jun 2010 00:49:01 +0000 (17:49 -0700)]
gptmbr: skip partitions with all-zero PartitionTypeGUID

PartitionTypeGUID being zero means an empty slot, and so we should not
count that partition type.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agopwd.c32: add to Makefile
H. Peter Anvin [Sat, 26 Jun 2010 22:03:02 +0000 (15:03 -0700)]
pwd.c32: add to Makefile

Actually *build* pwd.c32...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agochain.c32: "fs" is a singular token, only match if complete
H. Peter Anvin [Sat, 26 Jun 2010 21:57:14 +0000 (14:57 -0700)]
chain.c32: "fs" is a singular token, only match if complete

fs is a full token, not a prefix.

Reported-by: Gert Hulselmans <gerth@zytor.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agocom32 pwd module
Gene Cumm [Sat, 26 Jun 2010 14:59:46 +0000 (10:59 -0400)]
com32 pwd module

[MODULE] pwd to list present (current) working directory.  If the
returned string is empty, display ".".  If the return value is NULL,
display an error message.

Unfortunately, it appears that COM32 getcwd is not working properly at
this moment, it calling the COMBOOT call and getting an empty string.

Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoFix COM32 chdir()
Gene Cumm [Sat, 26 Jun 2010 15:18:59 +0000 (11:18 -0400)]
Fix COM32 chdir()

Fix COM32 chdir() since it's implemented in the core.
Forgot the core changes needed for this before.

Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agopmapi: make the pmapi vector include its own size
H. Peter Anvin [Sat, 26 Jun 2010 19:30:13 +0000 (12:30 -0700)]
pmapi: make the pmapi vector include its own size

Future-proof the pmapi vector by making it include its own size.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agochain: Support booting GPT partition by label
Shao Miller [Sat, 26 Jun 2010 06:19:04 +0000 (02:19 -0400)]
chain: Support booting GPT partition by label

Use the "label:" specifier followed by the label for
one of a GPT disk's partitions.

Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
14 years agochain: Support booting GPT disk/partition by GUID
Shao Miller [Sat, 26 Jun 2010 04:29:39 +0000 (00:29 -0400)]
chain: Support booting GPT disk/partition by GUID

Use the "guid:" specifier followed by the GUID for
a GPT disk or one of its partitions.

Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
14 years agocore, fs: handle .. resolution in the filesystem core
H. Peter Anvin [Sat, 26 Jun 2010 03:36:59 +0000 (20:36 -0700)]
core, fs: handle .. resolution in the filesystem core

Some filesystems, including btrfs, don't have .. directory entries.
We already handle . in the filesystem core, handle .. as well.

This means keeping chains of parent inodes for all open inodes, at
least for the duration of a path search; we might as well hang onto
them.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agobtrfs: initialize the block cache early
H. Peter Anvin [Sat, 26 Jun 2010 03:34:26 +0000 (20:34 -0700)]
btrfs: initialize the block cache early

Initialize the block cache at the very start.  The block size for
btrfs is fixed, and so we can start by initializing the cache.  That
eliminates a whole bunch of unnecessary I/O as well as extra code.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agobtrfs: do not read past the end of the disk
H. Peter Anvin [Sat, 26 Jun 2010 03:10:09 +0000 (20:10 -0700)]
btrfs: do not read past the end of the disk

When looking for the current superblock, don't read past the end of
the disk.  This more or less assumes that the superblocks are
reasonably consistent with regards to the total filesystem size.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agocore, diskio: make error messages a little more useful
H. Peter Anvin [Sat, 26 Jun 2010 02:51:14 +0000 (19:51 -0700)]
core, diskio: make error messages a little more useful

Be a bit more explicit about the particular errors we see.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoextlinux: modify the layout for btrfs
H. Peter Anvin [Sat, 26 Jun 2010 02:49:20 +0000 (19:49 -0700)]
extlinux: modify the layout for btrfs

Put the btrfs boot code right after the boot sector (they are really
one image anyway).  Align the ADV with the end of the boot region, so
we can locate it for modification as necessary, and the offset don't
end up shifting with different boot image sizes.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agodos: include the ADV in the file size to be sector mapped syslinux-4.00-pre62
H. Peter Anvin [Fri, 25 Jun 2010 22:25:22 +0000 (15:25 -0700)]
dos: include the ADV in the file size to be sector mapped

We need to include the ADV in the size of the file that must be sector
mapped.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agomtools: include the size of the ADV in the mappable range
H. Peter Anvin [Fri, 25 Jun 2010 22:23:42 +0000 (15:23 -0700)]
mtools: include the size of the ADV in the mappable range

We need to include the size of the ADV in the range of data that needs
to be mapped.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14 years agochain.c32: correctly set the length of the GPT handover structure syslinux-4.00-pre61
H. Peter Anvin [Fri, 25 Jun 2010 20:56:19 +0000 (13:56 -0700)]
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>
14 years agoMerge remote branch 'sha0/chain_gpt'
H. Peter Anvin [Fri, 25 Jun 2010 20:48:49 +0000 (13:48 -0700)]
Merge remote branch 'sha0/chain_gpt'

14 years agopxe: don't corrupt the length of an RRQ packet on retry
H. Peter Anvin [Fri, 25 Jun 2010 20:13:11 +0000 (13:13 -0700)]
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>
14 years agochain: Implement GPT hand-over protocol as documented
Shao Miller [Fri, 25 Jun 2010 10:45:07 +0000 (06:45 -0400)]
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>
14 years agopxe: fix the unload sequence
H. Peter Anvin [Fri, 25 Jun 2010 04:35:44 +0000 (21:35 -0700)]
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>
14 years agopxe: fix ip_ok()
H. Peter Anvin [Fri, 25 Jun 2010 03:55:43 +0000 (20:55 -0700)]
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>
14 years agodoc/gpt.txt: this is now fully implemented
H. Peter Anvin [Fri, 25 Jun 2010 03:40:29 +0000 (20:40 -0700)]
doc/gpt.txt: this is now fully implemented

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoUpdating description in syslinux manpage wrt/ default entries as of syslinux >= 3.85.
Daniel Baumann [Thu, 24 Jun 2010 22:15:54 +0000 (00:15 +0200)]
Updating description in syslinux manpage wrt/ default entries as of syslinux >= 3.85.

14 years agoAdding note about extlinux.conf in extlinux manpage.
Daniel Baumann [Thu, 24 Jun 2010 22:15:43 +0000 (00:15 +0200)]
Adding note about extlinux.conf in extlinux manpage.

14 years agoRename dir.c32 -> ls.c32 syslinux-4.00-pre60
H. Peter Anvin [Thu, 24 Jun 2010 22:02:29 +0000 (15:02 -0700)]
Rename dir.c32 -> ls.c32

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

-hpa