profile/ivi/syslinux.git
13 years agocore/diskboot.inc: Update comments at top
Gene Cumm [Wed, 26 Jan 2011 02:41:27 +0000 (21:41 -0500)]
core/diskboot.inc: Update comments at top

There are more labels/constants needed plus I forgot some

13 years agoMerge remote branch 'hdt/master' syslinux-4.04-pre5
H. Peter Anvin [Wed, 26 Jan 2011 00:58:13 +0000 (16:58 -0800)]
Merge remote branch 'hdt/master'

13 years agoMerge remote branch 'sha0/memdskprobe'
H. Peter Anvin [Wed, 26 Jan 2011 00:56:20 +0000 (16:56 -0800)]
Merge remote branch 'sha0/memdskprobe'

13 years agodisk: put a magic at the end of the boot sector
H. Peter Anvin [Wed, 26 Jan 2011 00:53:42 +0000 (16:53 -0800)]
disk: put a magic at the end of the boot sector

Put a magic signature at the end of the boot sector, and a backpointer
to the code that contains the pointer to the main code extent.  This
is useful for integrity-checking tools, and could help the installer
in the future.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
13 years agomemdisk: Fix INT 0x13, AH==0x15 disk drive probe
Shao Miller [Tue, 25 Jan 2011 22:16:47 +0000 (17:16 -0500)]
memdisk: Fix INT 0x13, AH==0x15 disk drive probe

The function might return CF==0 ("success"), but could
include AH==0 ("no such drive").  This is the case on
at least a number of Dell models.  Now we check AH, too.

Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
13 years agodiskstart: move writestr_early out of boot sector
H. Peter Anvin [Tue, 25 Jan 2011 22:11:11 +0000 (14:11 -0800)]
diskstart: move writestr_early out of boot sector

We can save 8 bytes in the boot sector by moving writestr_early out
and putting the real routine in sector 1.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
13 years agomemdisk: Enhance disk-probe debugging output
Shao Miller [Tue, 25 Jan 2011 15:44:13 +0000 (10:44 -0500)]
memdisk: Enhance disk-probe debugging output

In an effort to trouble-shoot a problem report on some Dell
models (including an Optiplex GX260), we add further debugging
output to try to find out at which point things go wrong.  The
problem units are apparently probing as "drive present" for all
drives, which obviously isn't right.

Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
13 years agodisklib: Detect DiskCryptor MBR
Gert Hulselmans [Mon, 24 Jan 2011 22:53:34 +0000 (23:53 +0100)]
disklib: Detect DiskCryptor MBR

Add detection code for DiskCryptor MBR to disklib.

Signed-off-by: Gert Hulselmans <gerth@zytor.com>
13 years agodisklib: Detect "FreeDOS (eXtended FDisk)" MBR
Gert Hulselmans [Mon, 24 Jan 2011 23:17:57 +0000 (00:17 +0100)]
disklib: Detect "FreeDOS (eXtended FDisk)" MBR

Add detection code for "FreeDOS (eXtended FDisk)" MBR to disklib.

Signed-off-by: Gert Hulselmans <gerth@zytor.com>
13 years agodisklib: Detect "MS-DOS 3.30 through Windows 95 (A)" MBR
Gert Hulselmans [Mon, 24 Jan 2011 23:12:48 +0000 (00:12 +0100)]
disklib: Detect "MS-DOS 3.30 through Windows 95 (A)" MBR

Add detection code for "MS-DOS 3.30 through Windows 95 (A)" MBR to disklib.

Signed-off-by: Gert Hulselmans <gerth@zytor.com>
13 years agodisklib: Detect new Syslinux (normal + isohybrid) MBR
Gert Hulselmans [Mon, 24 Jan 2011 22:08:23 +0000 (23:08 +0100)]
disklib: Detect new Syslinux (normal + isohybrid) MBR

Add detection code for new Syslinux (normal + isohybrid) MBR to disklib.
Switch old Syslinux MBR and Master Boot LoaDeR detection code.

Signed-off-by: Gert Hulselmans <gerth@zytor.com>
13 years agodisklib: Detect Paragon MBR
Gert Hulselmans [Mon, 24 Jan 2011 22:58:35 +0000 (23:58 +0100)]
disklib: Detect Paragon MBR

Add detection code for Paragon MBR to disklib.

Signed-off-by: Gert Hulselmans <gerth@zytor.com>
13 years agomemdisk: Make debug-mode a tad prettier
Shao Miller [Tue, 25 Jan 2011 02:47:43 +0000 (21:47 -0500)]
memdisk: Make debug-mode a tad prettier

By removing the use of #ifdef-#endif blocks.

Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
13 years agodiskio: Support EDD 4 16-byte device paths
H. Peter Anvin [Mon, 17 Jan 2011 19:54:45 +0000 (11:54 -0800)]
diskio: Support EDD 4 16-byte device paths

EDD 4 has 16-byte device path information.  Make the EDD buffer big
enough to capture that.  Note that the location of the device path
checksum actually depends on the device path length information field!

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
13 years agodiskio: add reminder that we need clear in the future
H. Peter Anvin [Mon, 17 Jan 2011 19:48:55 +0000 (11:48 -0800)]
diskio: add reminder that we need clear in the future

Currently, disk_init() can only be called once, and edd_params get
statically initialized to zero.  This will change once this function
can be called more than once, and we depend on the pre-initialization
to zero to avoid known BIOS bugs.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
13 years agoNEWS: Document MBR fix. syslinux-4.04-pre4
H. Peter Anvin [Thu, 23 Dec 2010 20:04:48 +0000 (12:04 -0800)]
NEWS: Document MBR fix.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agombr: Make sure the MBR code starts with the byte 0x33
H. Peter Anvin [Thu, 23 Dec 2010 20:02:52 +0000 (12:02 -0800)]
mbr: Make sure the MBR code starts with the byte 0x33

Apparently some BIOSes (including some Acer Travelmate machines)
require an MBR to start with 0x33; apparently Micro$oft MBRs start
with 33 C0, an alternate coding of the "xorw %ax,%ax" instruction.  As
such, follow suit to work on these braindead BIOSes.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agocore/diskboot.inc: fix bug; Sect1Ptr1_VAL
Gene Cumm [Tue, 21 Dec 2010 12:23:06 +0000 (07:23 -0500)]
core/diskboot.inc: fix bug; Sect1Ptr1_VAL

13 years agocore/diskstart.inc: Remove code copied to diskboot.inc
Gene Cumm [Tue, 21 Dec 2010 02:05:51 +0000 (21:05 -0500)]
core/diskstart.inc: Remove code copied to diskboot.inc

13 years agocore/diskboot.inc: The boot sector code from diskstart.inc
Gene Cumm [Tue, 21 Dec 2010 02:02:52 +0000 (21:02 -0500)]
core/diskboot.inc: The boot sector code from diskstart.inc

Split to allow it to be used by debugging/diagnostic images

13 years agocore/diskstart.inc: Sect1Ptr values moved to constants
Gene Cumm [Tue, 21 Dec 2010 01:53:39 +0000 (20:53 -0500)]
core/diskstart.inc: Sect1Ptr values moved to constants

This allows another program to re-use the boot sector and define
different values, once split.

13 years agocore/diskstart.inc: Use xint13 when it saves space or protects
Gene Cumm [Tue, 21 Dec 2010 01:39:11 +0000 (20:39 -0500)]
core/diskstart.inc: Use xint13 when it saves space or protects

Additional note on where it will cost to possibly not protect anything

13 years agocore/diskstart.inc: Wrap INT13h in xint13 to preserve ES
Gene Cumm [Tue, 21 Dec 2010 01:24:29 +0000 (20:24 -0500)]
core/diskstart.inc: Wrap INT13h in xint13 to preserve ES

Sometimes INT13h AH08h kills ES to return info about a "floppy" (since
an unpartitioned HDD might look like a floppy).  Also, change to tabs
on previous line.

13 years agocore: Add workaround in the Makefile for GNU Make 3.82 bug
H. Peter Anvin [Fri, 17 Dec 2010 03:45:57 +0000 (19:45 -0800)]
core: Add workaround in the Makefile for GNU Make 3.82 bug

Apparently GNU Make 3.82 mishandles pattern rules with fixed
dependencies, sigh.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agocore: remove HAS_LOCALBOOT
Sebastian Herbszt [Tue, 27 Jul 2010 20:32:54 +0000 (22:32 +0200)]
core: remove HAS_LOCALBOOT

HAS_LOCALBOOT is set unconditionally in config.inc.

Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agoNEWS: document fix for non-partitioned devices. syslinux-4.04-pre3
H. Peter Anvin [Tue, 14 Dec 2010 17:55:12 +0000 (09:55 -0800)]
NEWS: document fix for non-partitioned devices.

13 years agocore, diskstart: add more sanity checks for handover info
H. Peter Anvin [Tue, 14 Dec 2010 17:53:42 +0000 (09:53 -0800)]
core, diskstart: add more sanity checks for handover info

In particular, somehow we failed to actually test for DS:SI = 0:0!
This tests both for SI < 16 and DS:SI < 1024.  The former of those
tests is a bit iffy and probably should be removed.

This should also be promoted into isohdpfx.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agosyslinux.ld: ld 2.20.51 seems to want .bss16 explicitly (NOLOAD)
H. Peter Anvin [Tue, 14 Dec 2010 17:51:33 +0000 (09:51 -0800)]
syslinux.ld: ld 2.20.51 seems to want .bss16 explicitly (NOLOAD)

ld 2.20.51 seems to want the .bss16 explicitly marked (NOLOAD).  We do
that for most of the other bss sections, so we might as well.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agomemdiskfind: abstract get page size so we can compile against klibc
H. Peter Anvin [Wed, 8 Dec 2010 00:35:01 +0000 (16:35 -0800)]
memdiskfind: abstract get page size so we can compile against klibc

klibc doesn't have sysconf(), because it involves a hideously
inefficient multiplex.  Thus, if _SC_PAGESIZE is not defined, invoke
getpagesize().  Call the routine get_page_size() so it doesn't
conflict on a platform which has both sysconf(_SC_PAGESIZE) and
getpagesize().

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
13 years agoNEWS: further updates syslinux-4.04-pre2
H. Peter Anvin [Tue, 7 Dec 2010 00:02:12 +0000 (16:02 -0800)]
NEWS: further updates

13 years agoMerge remote branch 'genec/news-for-hpa'
H. Peter Anvin [Tue, 7 Dec 2010 00:00:58 +0000 (16:00 -0800)]
Merge remote branch 'genec/news-for-hpa'

13 years agocom32: fix a ffile descriptor leak on open() of a nonexistent file
H. Peter Anvin [Mon, 6 Dec 2010 23:54:24 +0000 (15:54 -0800)]
com32: fix a ffile descriptor leak on open() of a nonexistent file

If we try to open a nonexistent file, free the resulting file
descriptor.

Reported-by: Antonio Carlini <arcarlini@iee.org>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
13 years agogfxboot: require LABEL keywords
Sebastian Herbszt [Sun, 5 Dec 2010 20:43:45 +0000 (21:43 +0100)]
gfxboot: require LABEL keywords

Require LABEL keywords in config file.

Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
13 years agogfxboot: support TEXT and ENDTEXT keywords
Sebastian Herbszt [Sun, 5 Dec 2010 20:34:42 +0000 (21:34 +0100)]
gfxboot: support TEXT and ENDTEXT keywords

Support TEXT and ENDTEXT keywords; ignore the help text.

Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
13 years agoNEWS: Update for 4.04 as of 4.04-pre1
Gene Cumm [Sat, 4 Dec 2010 02:18:08 +0000 (21:18 -0500)]
NEWS: Update for 4.04 as of 4.04-pre1

13 years agoBump version to 4.04 syslinux-4.04-pre1
H. Peter Anvin [Fri, 3 Dec 2010 00:04:35 +0000 (16:04 -0800)]
Bump version to 4.04

13 years agoman: remove long-since-obsolete note about name mangling
H. Peter Anvin [Thu, 18 Nov 2010 20:08:47 +0000 (12:08 -0800)]
man: remove long-since-obsolete note about name mangling

We haven't mangled label names for a very long time...

13 years agocore, pxe: Fix handling of unqualified DNS names
H. Peter Anvin [Sun, 14 Nov 2010 21:14:49 +0000 (13:14 -0800)]
core, pxe: Fix handling of unqualified DNS names

Actually append the domain name to the end of an unqualified DNS name
like we should have done all along.

Reported-by: Gene Cumm <gene.cumm@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agomemdisk: use char array for external symbols
H. Peter Anvin [Sun, 14 Nov 2010 21:13:25 +0000 (13:13 -0800)]
memdisk: use char array for external symbols

Use "extern const char foo[];" for an external symbol rather than
"extern void" (gcc 4.5 fix.)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agogfxboot: use a character array for an absolute symbol
H. Peter Anvin [Sun, 14 Nov 2010 21:12:28 +0000 (13:12 -0800)]
gfxboot: use a character array for an absolute symbol

The best way to access an absolute symbol is "extern const char
foo[];" -- older gccs let you get away with "extern void" but gcc 4.5
chokes on it.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agodisklib: remove improper "inline"
H. Peter Anvin [Sun, 14 Nov 2010 21:11:30 +0000 (13:11 -0800)]
disklib: remove improper "inline"

Remove improper inlines from static functions which cause gcc 4.5 to
abort due to inlining failure.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agocom32: add a centralized bitops header
H. Peter Anvin [Sun, 14 Nov 2010 21:09:48 +0000 (13:09 -0800)]
com32: add a centralized bitops header

Add a centralized bitops header <sys/bitops.h> which uses x86 bitops
instructions.  This is necessary to keep gcc 4.5 from aborting
compilation due to the inlined code being larger than the non-inlined
version, and well, we should really use the bitops.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
13 years agoMerge branch 'genec-rosh-for-hpa', remote branches 'genec/sample-make-for-hpa', ...
H. Peter Anvin [Sun, 14 Nov 2010 20:51:07 +0000 (12:51 -0800)]
Merge branch 'genec-rosh-for-hpa', remote branches 'genec/sample-make-for-hpa', 'genec/drmk-ver-for-hpa' and 'genec/pxechain-for-hpa'

13 years agoPXELINUX: shorten code in pxenv call
Gene Cumm [Sat, 13 Nov 2010 16:29:08 +0000 (11:29 -0500)]
PXELINUX: shorten code in pxenv call

Now that both scenarios are clear (do/do not call timer_cleanup/
timer_init), shorten it to eliminate a needless jmp.

13 years agoPXELINUX: add gPXE PXENV_FILE_EXEC in addition to PXENV_RESTART_TFTP; comments
Gene Cumm [Sat, 13 Nov 2010 16:22:54 +0000 (11:22 -0500)]
PXELINUX: add gPXE PXENV_FILE_EXEC in addition to PXENV_RESTART_TFTP; comments

Both of these calls will not return if successful

14 years agover.com: Update some of how DRMK is handled
Gene Cumm [Sat, 6 Nov 2010 12:09:15 +0000 (08:09 -0400)]
ver.com: Update some of how DRMK is handled

14 years agoPXELINUX: Fix timer bug
Gene Cumm [Fri, 5 Nov 2010 17:32:52 +0000 (13:32 -0400)]
PXELINUX: Fix timer bug

Certain calls to the PXE stack could potentially remove us from
memory.  Revert the INT 1Ch timer to its previous state.

14 years agover.com: Fix month calculation for DRMK Build Date
Gene Cumm [Wed, 3 Nov 2010 02:52:09 +0000 (22:52 -0400)]
ver.com: Fix month calculation for DRMK Build Date

14 years agosample/Makefile: re-add the include
Gene Cumm [Mon, 25 Oct 2010 17:01:24 +0000 (13:01 -0400)]
sample/Makefile: re-add the include

Without the include, .ppm.gz to .lss messes up as $(GZIPPROG) is
not expanded properly

14 years agomodules/Makefile: add ver.com
Gene Cumm [Mon, 25 Oct 2010 16:59:47 +0000 (12:59 -0400)]
modules/Makefile: add ver.com

14 years agover.com: Fixed width number output; Conditional skip DOS serial
Gene Cumm [Mon, 25 Oct 2010 16:56:36 +0000 (12:56 -0400)]
ver.com: Fixed width number output; Conditional skip DOS serial

Create two functions, writedecb[23], to output a byte AL as fixed with of
2 or 3 characters wide, 0 prepend

If all of the DOS Serialnumber is 0, don't bother with printing anything.

14 years agover.com: Compact file by reuse of string
Gene Cumm [Mon, 25 Oct 2010 00:03:23 +0000 (20:03 -0400)]
ver.com: Compact file by reuse of string

14 years agover.com: Update to pull info from DRMK
Gene Cumm [Sun, 24 Oct 2010 21:30:30 +0000 (17:30 -0400)]
ver.com: Update to pull info from DRMK

14 years agocore/writedec: Remove writechr; fix overflow in .cloop
Gene Cumm [Sun, 24 Oct 2010 21:15:41 +0000 (17:15 -0400)]
core/writedec: Remove writechr; fix overflow in .cloop

writechr is found in other files and this prevents a compile error.

14 years agover.com: Import from previously private branch as new file
Gene Cumm [Sun, 24 Oct 2010 14:14:53 +0000 (10:14 -0400)]
ver.com: Import from previously private branch as new file

14 years agogfxboot: fix buffer overrun when loading kernel/initramfs syslinux-4.03
Colin Watson [Wed, 20 Oct 2010 19:23:02 +0000 (21:23 +0200)]
gfxboot: fix buffer overrun when loading kernel/initramfs

If the file size wasn't a multiple of 64KB, we could overwrite the next
entry in the malloc arena so reading the initramfs would fail.

Signed-off-by: Colin Watson <cjwatson@ubuntu.com>
Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
14 years agorosh: rosh_argcat now has length. if DO_DEBUG, show startup command
Gene Cumm [Sat, 16 Oct 2010 12:07:02 +0000 (08:07 -0400)]
rosh: rosh_argcat now has length.  if DO_DEBUG, show startup command

14 years agorosh: display command entered and a command unknown message when not known
Gene Cumm [Sat, 16 Oct 2010 11:58:31 +0000 (07:58 -0400)]
rosh: display command entered and a command unknown message when not known

14 years agoMerge remote branch 'liu/master' syslinux-4.03-pre6
H. Peter Anvin [Fri, 15 Oct 2010 23:41:02 +0000 (16:41 -0700)]
Merge remote branch 'liu/master'

14 years agochain.c32: DRMK: Fix comment at top of source
Gene Cumm [Fri, 15 Oct 2010 03:50:58 +0000 (23:50 -0400)]
chain.c32: DRMK: Fix comment at top of source

14 years agochain.c32: DRMK: Add comment about only using a DWORD for partition offset
Gene Cumm [Wed, 13 Oct 2010 23:51:06 +0000 (19:51 -0400)]
chain.c32: DRMK: Add comment about only using a DWORD for partition offset

14 years agochain.c32: DRMK: clean up output; clean up and correct comments
Gene Cumm [Wed, 13 Oct 2010 23:39:19 +0000 (19:39 -0400)]
chain.c32: DRMK: clean up output; clean up and correct comments

14 years agochain.c: Progress on DRMK and notes that it's not perfect yet.
Gene Cumm [Mon, 9 Aug 2010 16:34:32 +0000 (12:34 -0400)]
chain.c: Progress on DRMK and notes that it's not perfect yet.

14 years agoMerge branch 'master' into rosh_for_hpa
Gene Cumm [Wed, 13 Oct 2010 20:32:13 +0000 (16:32 -0400)]
Merge branch 'master' into rosh_for_hpa

14 years agorosh: add another item in the ToDos comment
Gene Cumm [Wed, 13 Oct 2010 20:28:53 +0000 (16:28 -0400)]
rosh: add another item in the ToDos comment

14 years agogfxboot: add include and menu include support syslinux-4.03-pre5
Colin Watson [Wed, 14 Jul 2010 13:11:14 +0000 (14:11 +0100)]
gfxboot: add include and menu include support

Ubuntu CDs use multiple configuration files and the include directive as
well as gfxboot, so it's useful for gfxboot to support these.

Signed-off-by: Colin Watson <cjwatson@ubuntu.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agodoc: extlinux falls back to syslinux.cfg
Ferenc Wagner [Mon, 11 Oct 2010 15:55:52 +0000 (17:55 +0200)]
doc: extlinux falls back to syslinux.cfg

Signed-off-by: Ferenc Wagner <wferi@niif.hu>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agodoc: reorganize config file intro
Ferenc Wagner [Mon, 11 Oct 2010 15:55:51 +0000 (17:55 +0200)]
doc: reorganize config file intro

Signed-off-by: Ferenc Wagner <wferi@niif.hu>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agodoc: comments don't need a leading space
Ferenc Wagner [Mon, 11 Oct 2010 15:55:50 +0000 (17:55 +0200)]
doc: comments don't need a leading space

Signed-off-by: Ferenc Wagner <wferi@niif.hu>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agochain.c32: make CHS calculation match core/fs/diskio.c
H. Peter Anvin [Wed, 13 Oct 2010 05:46:15 +0000 (22:46 -0700)]
chain.c32: make CHS calculation match core/fs/diskio.c

Use the same format for the CHS calculation as in core/fs/diskio.c;
also, apply the correct limits, and propagate the fix to the write
routine.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agostrspn.c: drop "inline"
H. Peter Anvin [Wed, 13 Oct 2010 05:42:27 +0000 (22:42 -0700)]
strspn.c: drop "inline"

Drop "inline" from bit operations.  These should be recoded to use x86
bts/bt instructions, but for now just drop the "inline" which causes
failures on gcc 4.5 due to inlining failures.

Reported-by: Sebastian Herbszt <herbszt@gmx.de>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoNEWS: Update for 4.03
H. Peter Anvin [Wed, 13 Oct 2010 05:40:46 +0000 (22:40 -0700)]
NEWS: Update for 4.03

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoisohybrid: Use ftruncate instead of seek for final padding
P J P [Tue, 14 Sep 2010 06:38:37 +0000 (12:08 +0530)]
isohybrid: Use ftruncate instead of seek for final padding

Pad the image via ftruncate instead of seeking to the end (which was
done incorrectly).

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agochain.c32: fix conversion from LBA to CHS
H. Peter Anvin [Wed, 13 Oct 2010 05:31:09 +0000 (22:31 -0700)]
chain.c32: fix conversion from LBA to CHS

Bits [9:8] of the cylinder goes into the top bits of the sector
register, not the bottom (and the math for that was wrong, anyway.)

Reported-by: Michal Soltys <soltys@ziu.info>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agorosh: Fix rosh_ls(); fix FTBFS on rosh_more(); add ROSH_DEBUG2_ARGV_V macro
Gene Cumm [Sat, 9 Oct 2010 15:28:48 +0000 (11:28 -0400)]
rosh: Fix rosh_ls(); fix FTBFS on rosh_more(); add ROSH_DEBUG2_ARGV_V macro

14 years agolib: Update memmem function
Liu Aleaxander [Sat, 9 Oct 2010 15:10:14 +0000 (23:10 +0800)]
lib: Update memmem function

The current memem implementation can not handle the case that the length
of the third parameter(needle) is equal *ONE*. So that the current
strstr implemention doesn't work when the lenght of substring is ONE.

For example, strstr("linux", "l") it will return NULL instead of
"linux", which is not right.

This code is stolen from klibc ;)

Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
14 years agounistd.h: Add missing getopt declarations
Gene Cumm [Sat, 9 Oct 2010 12:32:46 +0000 (08:32 -0400)]
unistd.h: Add missing getopt declarations

14 years agoMerge branch 'master' into rosh_for_hpa
Gene Cumm [Sat, 9 Oct 2010 11:41:12 +0000 (07:41 -0400)]
Merge branch 'master' into rosh_for_hpa

14 years agorosh: Remove unneeded cases in rosh_command() switch statements
Gene Cumm [Sun, 3 Oct 2010 22:28:02 +0000 (18:28 -0400)]
rosh: Remove unneeded cases in rosh_command() switch statements

14 years agorosh: Clean up rosh_command to remove old stuff
Gene Cumm [Sun, 3 Oct 2010 16:05:45 +0000 (12:05 -0400)]
rosh: Clean up rosh_command to remove old stuff

14 years agorosh: code cleanup
Gene Cumm [Sun, 3 Oct 2010 14:02:11 +0000 (10:02 -0400)]
rosh: code cleanup

14 years agorosh: Change rosh_ls()/rosh_dir() to use argc/argv; use getopt()
Gene Cumm [Sun, 3 Oct 2010 13:24:38 +0000 (09:24 -0400)]
rosh: Change rosh_ls()/rosh_dir() to use argc/argv; use getopt()

14 years agorosh: Change rosh_more()/rosh_less() to use argc/argv
Gene Cumm [Sun, 3 Oct 2010 13:15:52 +0000 (09:15 -0400)]
rosh: Change rosh_more()/rosh_less() to use argc/argv

14 years agorosh: remove cmdstr from rosh_pwd()
Gene Cumm [Sun, 3 Oct 2010 11:22:59 +0000 (07:22 -0400)]
rosh: remove cmdstr from rosh_pwd()

14 years agorosh: clear errno before possibly using it. might be set by a previous call
Gene Cumm [Sun, 3 Oct 2010 11:17:54 +0000 (07:17 -0400)]
rosh: clear errno before possibly using it.  might be set by a previous call

14 years agorosh: Add argc/argv rosh_reboot(); Allow warm reboots
Gene Cumm [Sun, 3 Oct 2010 11:12:06 +0000 (07:12 -0400)]
rosh: Add argc/argv rosh_reboot(); Allow warm reboots

14 years agorosh: In main, use string macro directly
Gene Cumm [Sun, 3 Oct 2010 11:00:25 +0000 (07:00 -0400)]
rosh: In main, use string macro directly

14 years agorosh: Change rosh_run() to use argc/argv
Gene Cumm [Sun, 3 Oct 2010 10:59:44 +0000 (06:59 -0400)]
rosh: Change rosh_run() to use argc/argv

14 years agorosh: Change rosh_help() to use the string passed to it directly
Gene Cumm [Sat, 2 Oct 2010 17:20:07 +0000 (13:20 -0400)]
rosh: Change rosh_help() to use the string passed to it directly

14 years agorosh: ROSH_DEBUG_ARGV_V in header
Gene Cumm [Sat, 2 Oct 2010 05:11:23 +0000 (01:11 -0400)]
rosh: ROSH_DEBUG_ARGV_V in header

14 years agorosh: convert rosh_cat() to argc/argv
Gene Cumm [Sat, 2 Oct 2010 05:10:49 +0000 (01:10 -0400)]
rosh: convert rosh_cat() to argc/argv

14 years agorosh: Add function header comments that were missing
Gene Cumm [Sat, 2 Oct 2010 05:05:03 +0000 (01:05 -0400)]
rosh: Add function header comments that were missing

14 years agorosh: Fix warning on rosh_ls_arg(); remove rosh_echo() for rosh_pr_argv()
Gene Cumm [Sat, 2 Oct 2010 04:55:02 +0000 (00:55 -0400)]
rosh: Fix warning on rosh_ls_arg(); remove rosh_echo() for rosh_pr_argv()

14 years agorosh: Rename function as it's verbose
Gene Cumm [Sat, 2 Oct 2010 04:43:24 +0000 (00:43 -0400)]
rosh: Rename function as it's verbose

rosh_pr_argv and ROSH_DEBUG_ARGV are verbose, printing the
argument number and single-quoted string out.

14 years agorosh: closedir() only if actually opened
Gene Cumm [Sat, 2 Oct 2010 04:18:27 +0000 (00:18 -0400)]
rosh: closedir() only if actually opened

14 years agorosh: compact previous commit
Gene Cumm [Sat, 2 Oct 2010 04:16:54 +0000 (00:16 -0400)]
rosh: compact previous commit

14 years agorosh: Fix rosh_ls_arg() to prevent segfault on access denied
Gene Cumm [Sat, 2 Oct 2010 04:13:38 +0000 (00:13 -0400)]
rosh: Fix rosh_ls_arg() to prevent segfault on access denied

14 years agorosh: main, prompt and command try to use argc/argv mostly
Gene Cumm [Sat, 2 Oct 2010 04:03:29 +0000 (00:03 -0400)]
rosh: main, prompt and command try to use argc/argv mostly

prompt still uses a string but parses it and passes the parsed
argc/argv pair to command.  main doesn't need a string anymore

14 years agorosh: rosh_cd fix DEBUG
Gene Cumm [Fri, 1 Oct 2010 03:11:10 +0000 (23:11 -0400)]
rosh: rosh_cd fix DEBUG

14 years agorosh: fix errors in previous commit
Gene Cumm [Fri, 1 Oct 2010 03:08:24 +0000 (23:08 -0400)]
rosh: fix errors in previous commit