Index: .gdbinit
===================================================================
RCS file: .gdbinit
diff -N .gdbinit
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ .gdbinit	16 May 2004 08:15:19 -0000
@@ -0,0 +1,417 @@
+#
+# from http://mailman.uclinux.org/pipermail/uclinux-dev/2003-September/021123.html
+# written by Phil Wilshire <philwil@earthlink.net>
+#     http://www.sysdcs.com
+#
+target bdm /dev/bdmcf0
+
+define addresses
+
+set $myipsbar = 0x40000001
+set $myrambar = $myipsbar -1 + 0x008    
+
+
+# Pll
+set $myclocksyncr = $myipsbar -1 + 0x120000    
+set $myclocksynsr = $myipsbar -1 + 0x120002    
+
+# Uart
+set $mygpio_puapar = $myipsbar -1 + 0x10005C    
+
+# CS0-6
+set $myuart0_umr   = $myipsbar -1 + 0x200    
+set $myuart0_ucsr  = $myipsbar -1 + 0x204    
+set $myuart0_ucr   = $myipsbar -1 + 0x208    
+set $myuart0_utb   = $myipsbar -1 + 0x20c    
+set $myuart0_urb   = $myipsbar -1 + 0x20c    
+set $myuart0_uimr  = $myipsbar -1 + 0x214    
+set $myuart0_ubg1  = $myipsbar -1 + 0x218    
+set $myuart0_ubg2  = $myipsbar -1 + 0x21c    
+
+set $mycs0_csar   = $myipsbar -1 + 0x80    
+set $mycs0_csmr   = $myipsbar -1 + 0x84    
+set $mycs0_cscr   = $myipsbar -1 + 0x8A    
+
+set $mycs1_csar   = $myipsbar -1 + 0x8C    
+set $mycs1_csmr   = $myipsbar -1 + 0x90    
+set $mycs1_cscr   = $myipsbar -1 + 0x96    
+
+set $mycs2_csar   = $myipsbar -1 + 0x98    
+set $mycs2_csmr   = $myipsbar -1 + 0x9C    
+set $mycs2_cscr   = $myipsbar -1 + 0xA2    
+
+set $mycs3_csar   = $myipsbar -1 + 0xA4    
+set $mycs3_csmr   = $myipsbar -1 + 0xA8    
+set $mycs3_cscr   = $myipsbar -1 + 0xAE    
+
+set $mycs4_csar   = $myipsbar -1 + 0xB0    
+set $mycs4_csmr   = $myipsbar -1 + 0xB4    
+set $mycs4_cscr   = $myipsbar -1 + 0xBA    
+
+set $mycs5_csar   = $myipsbar -1 + 0xBC    
+set $mycs5_csmr   = $myipsbar -1 + 0xC0    
+set $mycs5_cscr   = $myipsbar -1 + 0xC6    
+
+set $mycs6_csar   = $myipsbar -1 + 0xC8    
+set $mycs6_csmr   = $myipsbar -1 + 0xCC    
+set $mycs6_cscr   = $myipsbar -1 + 0xD2   
+
+
+#sdram
+set $mysdramc_dcr     = $myipsbar -1 + 0x40    
+set $mysdramc_dacr0   = $myipsbar -1 + 0x48
+set $mysdramc_dmr0    = $myipsbar -1 + 0x4C
+set $mysdramc_dacr1   = $myipsbar -1 + 0x50
+set $mysdramc_dmr1    = $myipsbar -1 + 0x54
+
+# GPIO
+set $mypbcdpar = $myipsbar -1 + 0x100050    
+set $mypjpar  = $myipsbar -1 + 0x100054 
+set $mypuapar  = $myipsbar -1 + 0x10005C   
+
+#CAN
+
+set $mycanmcr     = $myipsbar -1 + 0x1C0000   
+set $mycanctrl0   = $myipsbar -1 + 0x1C0006   
+set $mycanctrl1   = $myipsbar -1 + 0x1C0007   
+set $mycanpresdiv = $myipsbar -1 + 0x1C0008
+set $mycanctrl2   = $myipsbar -1 + 0x1C0009   
+
+set $mycanmb0ctrl = $myipsbar -1 + 0x1C0080
+set $mycanmb0idh  = $myipsbar -1 + 0x1C0082
+set $mycanmb0idl  = $myipsbar -1 + 0x1C0084
+
+set $mycanmb1ctrl = $myipsbar -1 + 0x1C0090
+set $mycanmb1idh  = $myipsbar -1 + 0x1C0092
+set $mycanmb1idl  = $myipsbar -1 + 0x1C0094
+   
+set $mycanmb2ctrl = $myipsbar -1 + 0x1C00A0
+set $mycanmb2idh  = $myipsbar -1 + 0x1C00A2
+set $mycanmb2idl  = $myipsbar -1 + 0x1C00A4
+   
+set $mycanmb3ctrl = $myipsbar -1 + 0x1C00B0
+set $mycanmb3idh  = $myipsbar -1 + 0x1C00B2
+set $mycanmb3idl  = $myipsbar -1 + 0x1C00B4
+   
+set $mycanmb4ctrl = $myipsbar -1 + 0x1C00C0
+set $mycanmb4idh  = $myipsbar -1 + 0x1C00C2
+set $mycanmb4idl  = $myipsbar -1 + 0x1C00C4
+   
+set $mycanmb5ctrl = $myipsbar -1 + 0x1C00D0
+set $mycanmb5idh  = $myipsbar -1 + 0x1C00D2
+set $mycanmb5idl  = $myipsbar -1 + 0x1C00D4
+   
+set $mycanmb6ctrl = $myipsbar -1 + 0x1C00E0
+set $mycanmb6idh  = $myipsbar -1 + 0x1C00E2
+set $mycanmb6idl  = $myipsbar -1 + 0x1C00E4
+   
+set $mycanmb7ctrl = $myipsbar -1 + 0x1C00F0
+set $mycanmb7idh  = $myipsbar -1 + 0x1C00F2
+set $mycanmb7idl  = $myipsbar -1 + 0x1C00F4
+   
+set $mycanmb8ctrl = $myipsbar -1 + 0x1C0100
+set $mycanmb8idh  = $myipsbar -1 + 0x1C0102
+set $mycanmb8idl  = $myipsbar -1 + 0x1C0104
+   
+set $mycanmb9ctrl = $myipsbar -1 + 0x1C0110
+set $mycanmb9idh  = $myipsbar -1 + 0x1C0112
+set $mycanmb9idl  = $myipsbar -1 + 0x1C0114
+
+set $mycanmb10ctrl = $myipsbar -1 + 0x1C0120
+set $mycanmb10idh  = $myipsbar -1 + 0x1C0122
+set $mycanmb10idl  = $myipsbar -1 + 0x1C0124
+
+set $mycanmb11ctrl = $myipsbar -1 + 0x1C0130
+set $mycanmb11idh  = $myipsbar -1 + 0x1C0132
+set $mycanmb11idl  = $myipsbar -1 + 0x1C0134
+   
+set $mycanmb12ctrl = $myipsbar -1 + 0x1C0140
+set $mycanmb12idh  = $myipsbar -1 + 0x1C0142
+set $mycanmb12idl  = $myipsbar -1 + 0x1C0144
+
+set $mycanmb13ctrl = $myipsbar -1 + 0x1C0150
+set $mycanmb13idh  = $myipsbar -1 + 0x1C0152
+set $mycanmb13idl  = $myipsbar -1 + 0x1C0154
+
+set $mycanmb14ctrl = $myipsbar -1 + 0x1C0160
+set $mycanmb14idh  = $myipsbar -1 + 0x1C0162
+set $mycanmb14idl  = $myipsbar -1 + 0x1C0164
+
+set $mycanmb15ctrl = $myipsbar -1 + 0x1C0170
+set $mycanmb15idh  = $myipsbar -1 + 0x1C0172
+set $mycanmb15idl  = $myipsbar -1 + 0x1C0174
+
+set $mycanrxgmask  = $myipsbar -1 + 0x1C0010
+
+
+# arrow system latch
+
+set $arrow_latch  = 0x3200f000
+
+# setup for SDRAM access
+#( ((!FPGA_SDRAM_NOT_5382_ACCESS)  0x1000
+# & (! SDRAM_BUS_DIR_IN))          0x0800
+#  | RUN_MODE_BASE_MASK ); 
+
+# end addresses
+end
+
+
+define setup_can
+
+# FRZ 0x4000 HALT 0x1000 SELFWAKE  0x40
+set *(unsigned short *)$mycanmcr = 0x5040
+
+#RXMODE =0x04
+set *(unsigned char *)$mycanctrl0 = 0x04
+
+#LOM 0x08
+set *(unsigned char *)$mycanctrl1 = 0x08
+
+set *(unsigned char *)$mycanpresdiv = 0x83
+
+set *(unsigned short *)$mycanmb0ctrl = 0x0088
+set *(unsigned short *)$mycanmb1ctrl = 0x0000
+set *(unsigned short *)$mycanmb2ctrl = 0x0088
+set *(unsigned short *)$mycanmb3ctrl = 0x0088
+set *(unsigned short *)$mycanmb4ctrl = 0x0088
+set *(unsigned short *)$mycanmb5ctrl = 0x0088
+set *(unsigned short *)$mycanmb6ctrl = 0x0088
+set *(unsigned short *)$mycanmb7ctrl = 0x0088
+set *(unsigned short *)$mycanmb8ctrl = 0x0088
+set *(unsigned short *)$mycanmb9ctrl = 0x0000
+set *(unsigned short *)$mycanmb10ctrl = 0x0000
+set *(unsigned short *)$mycanmb11ctrl = 0x0000
+set *(unsigned short *)$mycanmb12ctrl = 0x0000
+set *(unsigned short *)$mycanmb13ctrl = 0x0000
+set *(unsigned short *)$mycanmb14ctrl = 0x0000
+set *(unsigned short *)$mycanmb15ctrl = 0x0000
+
+
+# FRZ 0x4000 HALT 0x1000 SELFWAKE  0x40
+set *(unsigned long *)$mycanrxgmask = 0xFFE00000
+
+# FRZ 0x4000 HALT SELFWAKE  0x40
+set *(unsigned short *)$mycanmcr = 0x4040
+
+
+end
+
+define setup_gpio
+
+set *(unsigned char *)$mypbcdpar=0xC0
+set *(unsigned char *)$mypuapar=0x0F
+set *(unsigned char *)$mypjpar=0xFF
+
+end
+
+define setup_iram
+####### set up internal sram ####################
+set *$myrambar = 0x20000200
+
+if 0
+set *0x20000000=0x12345678
+set *0x20000000=0x55aa55aa
+set *0x20000004=0xaa55aa55
+x 0x20000000
+x 0x20000004
+end
+# end setup_iram
+end
+
+
+####### set up pll ####################
+define setup_pll
+#set $myclocksyncr = $myipsbar -1 + 0x120000    
+#set $myclocksynsr = $myipsbar -1 + 0x120002    
+
+set *(unsigned short *)$myclocksyncr =  (((2)&0x0007)<<12)  
+   
+while ((*$myclocksynsr &  0x08000000) == 0 )
+	set $foo = 0
+end
+
+# end setup_pll
+end
+
+######### set up uart 0 ###########################
+
+define setup_uart0
+
+#set $mygpio_puapar = $myipsbar -1 + 0x10005C    
+#set $myuart0_umr   = $myipsbar -1 + 0x200    
+#set $myuart0_ucsr  = $myipsbar -1 + 0x204    
+#set $myuart0_ucr   = $myipsbar -1 + 0x208    
+#set $myuart0_utb   = $myipsbar -1 + 0x20c    
+#set $myuart0_urb   = $myipsbar -1 + 0x20c    
+#set $myuart0_uimr  = $myipsbar -1 + 0x214    
+#set $myuart0_ubg1  = $myipsbar -1 + 0x218    
+#set $myuart0_ubg2  = $myipsbar -1 + 0x21c    
+
+set *(unsigned char *)$mygpio_puapar=0x0f
+#reset tx
+set *(unsigned char *)$myuart0_ucr=0x30
+#reset rx
+set *(unsigned char *)$myuart0_ucr=0x20
+#reset mr
+set *(unsigned char *)$myuart0_ucr=0x10
+
+# no parity 8 bits per char
+set *(unsigned char *)$myuart0_umr=0x13
+
+# no echo or loopback 1 stop
+set *(unsigned char *)$myuart0_umr=0x07
+ 
+# rx tx baud by timer
+set *(unsigned char *)$myuart0_ucsr=0xdd
+
+# mask all interrupts
+set *(unsigned char *)$myuart0_uimr=0x0
+
+set $uast_brg = (64000000/(19200 * 32))
+
+# set up baud rates
+set *(unsigned char *)$myuart0_ubg1=($uast_brg & 0xFF00) >> 8
+set *(unsigned char *)$myuart0_ubg2=($uast_brg & 0x00FF)
+
+# enable tx rx
+set *(unsigned char *)$myuart0_ucr=0x5
+
+#end uart0
+end
+
+define send_chars
+# send chars
+set *(unsigned char *)$myuart0_utb=0x41
+set *(unsigned char *)$myuart0_utb=0x42
+set *(unsigned char *)$myuart0_utb=0x43
+set *(unsigned char *)$myuart0_utb=0x44
+#end send_chars
+end
+
+
+####################################################
+define setup_cs
+######### set up CS ################################
+
+# Flash
+set *(unsigned short *)$mycs0_csar=0xFFE0
+set *(unsigned short *)$mycs0_cscr=0x1580
+set *(unsigned long *) $mycs0_csmr=0x001f0001
+
+# 512K 32 bit fsram  starting at 0x3000_0000 1 WS ??
+set *(unsigned short *)$mycs1_csar=0x3000
+set *(unsigned short *)$mycs1_cscr=0x0100
+set *(unsigned long *) $mycs1_csmr=0x00070001
+
+# ide from 3200_0000 6 ws
+set *(unsigned short *)$mycs2_csar=0x3200
+set *(unsigned short *)$mycs2_cscr=0x1980
+set *(unsigned long *) $mycs2_csmr=0x00070000
+
+# ? from dBUG
+set *(unsigned short *)$mycs3_csar=0xC28F
+set *(unsigned short *)$mycs3_cscr=0x2D60
+set *(unsigned long *) $mycs3_csmr=0x58960002
+
+# ? from dBUG
+set *(unsigned short *)$mycs4_csar=0x9C40
+set *(unsigned short *)$mycs4_cscr=0x09B8
+set *(unsigned long *) $mycs4_csmr=0x1580014E
+
+# ? from dBUG
+set *(unsigned short *)$mycs5_csar=0xC073
+set *(unsigned short *)$mycs5_cscr=0x1130
+set *(unsigned long *) $mycs5_csmr=0x00AC0116
+
+# ? from dBUG
+set *(unsigned short *)$mycs6_csar=0x840F
+set *(unsigned short *)$mycs6_cscr=0x30F8
+set *(unsigned long *) $mycs6_csmr=0x988E003A
+
+#end setup_cs
+end
+
+
+##################################################
+define setup_sdram
+######### set up SDRAM ###########################
+
+#
+# some delay
+#
+set $foo = 0
+# in c use 20000
+  while ($foo < 20000)
+	set $foo += 1
+  end
+
+if 1
+# if ( !($mysdramc_dacr0 & 0x00008000))
+   #
+   # init dram cr get it into the high short
+   set *(unsigned short *)$mysdramc_dcr   = \
+	(0x0200 | (((15 * 64)>>4)& 0x01ff)) << 16
+
+   # init dacr0
+   #	
+   set * $mysdramc_dacr0 = \
+	(0x00000000 & 0xfffc0000) | (((2)&0x03)<<12) |(((3)&0x07)<<8) | 0x0
+ 
+
+   #
+   # init dmr0
+   set * $mysdramc_dmr0 = \
+ 	0 | (0x00FC0000) |  (0x00000001)
+
+   #
+   # set ip ( bit 3 ) in dacr
+   set * $mysdramc_dacr0 |= (0x00000008)  
+
+   #
+   # init precharge
+   set *(0x00000000) = 0xA5A59696
+
+   #
+   # wait
+   while ($foo < 20000)
+	set $foo += 1
+   end
+
+   #
+   # set RE  in dacr
+   set * $mysdramc_dacr0 |= \
+	(0x00008000)  
+   #
+   # issue IMRS
+   set * $mysdramc_dacr0 |= \
+	(0x00000040)  
+
+   #
+   # wait for 8 auto refresh
+   while ($foo < 20000)
+	set $foo += 1
+   end
+   #
+   # set mode
+   set *(0x00000000 + 0x400 ) = 0xA5A59696
+
+  # end if 1
+  end
+#end setup_sdram
+end
+
+
+addresses
+#setup_gpio
+setup_iram
+#setup_pll
+#setup_uart0
+#send_chars
+setup_cs
+setup_sdram
+#setup_can
+
+#bdm_no_wait
+bdm_reset
+#continue
Index: Makefile
===================================================================
RCS file: /cvs/uclinux/uclinux/Makefile,v
retrieving revision 1.1.1.9
retrieving revision 1.15
diff -u -p -r1.1.1.9 -r1.15
--- Makefile	21 Mar 2004 02:50:51 -0000	1.1.1.9
+++ Makefile	5 Dec 2004 03:34:16 -0000	1.15
@@ -18,7 +18,7 @@ VERSIONSTR = $(CONFIG_VENDOR)/$(CONFIG_P
 ifeq (.config,$(wildcard .config))
 include .config
 
-all: subdirs romfs modules modules_install image
+all: subdirs colilo romfs modules modules_install image
 else
 all: config_error
 endif
@@ -39,6 +39,7 @@ ROMFSDIR = $(ROOTDIR)/romfs
 ROMFSINST= romfs-inst.sh
 SCRIPTSDIR = $(ROOTDIR)/config/scripts
 TFTPDIR    = /tftpboot
+COLILODIR = colilo
 
 
 LINUX_CONFIG  = $(ROOTDIR)/$(LINUXDIR)/.config
@@ -227,6 +228,7 @@ romfs:
 image:
 	[ -d $(IMAGEDIR) ] || mkdir $(IMAGEDIR)
 	$(MAKEARCH) -C $(VENDDIR) image
+	$(MAKE) -C $(COLILODIR) BOARD=$(CONFIG_PRODUCT) image
 
 .PHONY: netflash
 netflash netflash_only:
@@ -249,10 +251,10 @@ vendor_%:
 
 .PHONY: linux
 linux linux%_only:
-	@if [ $(LINUXDIR) != linux-2.5.x -a $(LINUXDIR) != linux-2.6.x -a ! -f $(LINUXDIR)/.depend ] ; then \
-		echo "ERROR: you need to do a 'make dep' first" ; \
-		exit 1 ; \
-	fi
+	@case "$(LINUXDIR)" in \
+		linux-2.5.*|linux-2.6.*) ;; \
+		*) if [ ! -f .depend ] ; then echo "ERROR: you need to do a 'make dep' first"; exit 1; fi ;; \
+	esac
 	$(MAKEARCH_KERNEL) -C $(LINUXDIR) $(LINUXTARGET) || exit 1
 	if [ -f $(LINUXDIR)/vmlinux ]; then \
 		ln -f $(LINUXDIR)/vmlinux $(LINUXDIR)/linux ; \
@@ -279,10 +281,11 @@ relink:
 clean: modules_clean
 	for dir in $(LINUXDIR) $(DIRS); do [ ! -d $$dir ] || $(MAKEARCH) -C $$dir clean ; done
 	rm -rf $(ROMFSDIR)/*
-	rm -f $(IMAGEDIR)/*
+	-rm -f $(IMAGEDIR)/*
 	rm -f config.tk
 	rm -f $(LINUXDIR)/linux
 	rm -rf $(LINUXDIR)/net/ipsec/alg/libaes $(LINUXDIR)/net/ipsec/alg/perlasm
+	$(MAKEARCH) -C $(COLILODIR) clean BOARD=$(CONFIG_PRODUCT)
 
 real_clean mrproper: clean
 	-$(MAKEARCH_KERNEL) -C $(LINUXDIR) mrproper
@@ -321,4 +324,8 @@ dist-prep:
 		$(MAKEARCH) -C `dirname $$t` -f `basename $$t` $@; \
 	 done
 
+.PHONY: colilo
+colilo:
+	$(MAKE) -C $(COLILODIR) BOARD=$(CONFIG_PRODUCT)
+	
 ############################################################################
Index: cvsimport.sh
===================================================================
RCS file: cvsimport.sh
diff -N cvsimport.sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ cvsimport.sh	12 Jun 2004 18:27:33 -0000
@@ -0,0 +1,58 @@
+#!/bin/sh
+#
+# $Id: cvsimport.sh,v 1.2 2004/06/03 06:23:59 bernie Exp $
+# Author: Bernardo Innocenti <bernie@develer.com>
+#
+# $Log: cvsimport.sh,v $
+# Revision 1.2  2004/06/03 06:23:59  bernie
+# Kill even more rubbish.
+#
+# Revision 1.1  2003/06/19 15:46:19  bernie
+# New CVS import procedure
+#
+
+# Path to local CVS repository
+CVSROOT=:pserver:bernie@cvs:/cvs/uclinux
+# Date of distribution to import
+DATE=YYYYMMDD
+# Date of previous import for the merge
+PREVDATE=YYYYMMDD
+
+tar xvzf uClinux-dist-${DATE}.tar.gz
+cd uClinux-dist
+
+# get rid of useless stuff
+rm -rf \
+	linux-2.0.x \
+	glibc \
+	freeswan \
+	user/mysql \
+	user/perl \
+	user/python \
+	user/nessus \
+	user/net-snmp \
+	user/samba \
+	user/squid \
+	user/zebra 
+
+# beware of binary files: extensions must be listed in CVSROOT/cvswrappers
+echo "Importing..."
+cvs -d ${CVSROOT} import -I \! -ko -m "Import uClinux-dist-${DATE}" \
+  uclinux UCLINUX UCLINUX_${DATE} \
+  2>&1 | tee ../import-${DATE}.log
+
+echo "Merging..."
+cd ..
+mkdir uclinux-merge-${DATE} && cd uclinux-merge-${DATE}
+cvs -d ${CVSROOT} checkout \
+  -j UCLINUX_${PREVDATE} -j UCLINUX_${DATE} uclinux \
+  2>&1 | tee ../merge-${DATE}.log
+
+
+echo "Please handle conflicts manually"
+exit 0 
+
+# Commit all merged changes
+cvs commit -m "Import uCLinux-${DATE}"
+
+
Index: flash.sh
===================================================================
RCS file: flash.sh
diff -N flash.sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ flash.sh	5 Dec 2004 03:34:31 -0000	1.7
@@ -0,0 +1,127 @@
+#!/bin/sh
+#
+# $Id: flash.sh,v 1.7 2004/12/05 03:34:31 bernie Exp $
+# Author: Bernardo Innocenti <bernie@develer.com>
+
+set -x
+
+# General config
+bdmflash=bdmflash
+dev=/dev/bdmcf3
+base=0xffe00000
+chips=1
+buswidth=2
+
+
+usage() {
+	echo "Usage: $0 {all|boot|kernel|root}"
+	exit 1
+}
+
+# program <image> <address>
+program() {
+	printf "$0: programming '%s' at 0x%08X + 0x%08X...\n" $1 $base $2
+	$bdmflash $dev $base $chips $buswidth write $1 $2
+}
+
+# erase <from> <to>
+erase() {
+	for sector in `seq -f '%1.0f' $1 $sector_size $2 | xargs printf '%x '` ; do
+		echo "$0: erasing $base + 0x$sector..."
+		$bdmflash $dev $base $chips $buswidth $erase_cmd 0x$sector
+	done 
+}
+
+
+if $bdmflash $dev $base $chips $buswidth detect | grep "SST" ; then
+
+	sector_size=65536
+	erase_cmd=BlockErase
+
+	boot_start=`printf '%d'   0x000000`
+	boot_end=`printf '%d'     0x00FFFF`
+	kernel_start=`printf '%d' 0x010000`
+	kernel_end=`printf '%d'   0x07FFFF`
+	root_start=`printf '%d'   0x080000`
+	root_end=`printf '%d'     0x1FFFFF`
+
+	boot_image="images/colilo.bin"
+	kernel_image="images/imagez.bin"
+	root_image="images/rootfs-64k.bin"
+
+elif $bdmflash $dev $base $chips $buswidth detect | grep "Am29PL160" ; then
+
+	sector_size=262144
+	erase_cmd=SectorErase
+
+	boot_start=`printf '%d'   0x000000`
+	boot_end=`printf '%d'     0x007FFF`
+	kernel_start=`printf '%d' 0x008000`
+	kernel_end=`printf '%d'   0x07FFFF`
+	root_start=`printf '%d'   0x080000`
+	root_end=`printf '%d'     0x1FFFFF`
+
+	boot_image="images/colilo.bin"
+	kernel_image="images/imagez.bin"
+	root_image="images/rootfs-256k.bin"
+
+else
+	echo "$0: unknown flash type"
+	exit 1
+fi
+
+case "$1" in
+	all)
+		echo "Erasing..."
+		$bdmflash $dev $base $chips $buswidth erase
+		program $root_image $root_start
+		program $kernel_image $kernel_start
+		program $boot_image $boot_start
+		;;
+	boot)
+		if [ $sector_size -eq 262144 ] ; then
+			# Kludge: support for non-uniform sector sizes of Am29PL160
+			erase `printf '%d' 0x00000` `printf '%d' 0x03FFF`
+			erase `printf '%d' 0x04000` `printf '%d' 0x05FFF` 
+			erase `printf '%d' 0x06000` `printf '%d' 0x07FFF` 
+		else
+			erase $boot_start $boot_end
+		fi
+		program $boot_image $boot_start
+		;;
+	bootdebug)
+		if [ $sector_size -eq 262144 ] ; then
+			# Kludge: support for non-uniform sector sizes of Am29PL160
+			erase `printf '%d' 0x00000` `printf '%d' 0x03FFF`
+			erase `printf '%d' 0x04000` `printf '%d' 0x05FFF` 
+			erase `printf '%d' 0x06000` `printf '%d' 0x07FFF` 
+		else
+			erase $boot_start $boot_end
+		fi
+		program colilo_debug.bin $boot_start
+		;;
+	kernel)
+		if [ $sector_size -eq 262144 ] ; then
+			# Kludge: support for non-uniform sector sizes of Am29PL160
+			erase `printf '%d' 0x08000` `printf '%d' 0x3FFFF`
+			erase `printf '%d' 0x40000` `printf '%d' 0x7FFFF`
+		else
+			erase $kernel_start $kernel_end
+		fi
+		program $kernel_image $kernel_start
+		;;
+	root)
+		erase $root_start $root_end
+		program $root_image $root_start
+		;;
+
+	*)
+		usage
+		exit 1
+		;;
+esac
+
+# Sound bells to wake up coder
+echo -e '\x07'; sleep 1; echo -e '\x07'; sleep 1; echo -e '\x07'
+bdmreset $dev
+
Index: send.sh
===================================================================
RCS file: send.sh
diff -N send.sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ send.sh	19 Jul 2003 16:07:26 -0000	1.1
@@ -0,0 +1,6 @@
+if [ ! $# = 2 ] ; then
+	echo "usage: $0 <from> <to>"
+	exit 1
+fi
+
+( echo "mode octet"; echo "put $1 $2" ) | tftp 10.3.3.42
diff -u -p -r1.1.1.2 -r1.2
--- lib/libc/main.c	28 Feb 2003 22:45:29 -0000	1.1.1.2
+++ lib/libc/main.c	27 Jun 2003 14:58:10 -0000	1.2
@@ -1,5 +1,5 @@
 
-int main() {
+int main(void) {
 	//extern char **environ;
 	//environ = envp;
 	return 0;
Index: lib/libc/include/netinet/ip_icmp.h
===================================================================
RCS file: /cvs/uclinux/uclinux/lib/libc/include/netinet/ip_icmp.h,v
retrieving revision 1.1.1.3
retrieving revision 1.2
diff -u -p -r1.1.1.3 -r1.2
--- lib/libc/include/netinet/ip_icmp.h	28 Feb 2003 22:45:30 -0000	1.1.1.3
+++ lib/libc/include/netinet/ip_icmp.h	3 Jun 2004 06:30:26 -0000	1.2
@@ -14,9 +14,9 @@ struct icmp_ra_addr
 
 struct icmp
 {
-  u_int8_t  icmp_type;	/* type of message, see below */
-  u_int8_t  icmp_code;	/* type sub code */
-  u_int16_t icmp_cksum;	/* ones complement checksum of struct */
+  u_int8_t  type;	/* type of message, see below */
+  u_int8_t  code;	/* type sub code */
+  u_int16_t cksum;	/* ones complement checksum of struct */
   union
   {
     u_char ih_pptr;		/* ICMP_PARAMPROB */
Index: linux-2.4.x/arch/m68knommu/Boards.mk
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.4.x/arch/m68knommu/Boards.mk,v
retrieving revision 1.1.1.10
retrieving revision 1.10
diff -u -p -r1.1.1.10 -r1.10
--- linux-2.4.x/arch/m68knommu/Boards.mk	29 May 2004 00:56:23 -0000	1.1.1.10
+++ linux-2.4.x/arch/m68knommu/Boards.mk	29 May 2004 02:01:53 -0000	1.10
@@ -113,6 +113,9 @@ endif
 ifdef CONFIG_COBRA5272
 BOARD := senTec
 endif
+ifdef CONFIG_DEVELER
+BOARD := Develer
+endif
 ifdef CONFIG_BOARD_UC5272
 BOARD := uC5272
 endif
Index: linux-2.4.x/arch/m68knommu/config.in
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.4.x/arch/m68knommu/config.in,v
retrieving revision 1.1.1.11
retrieving revision 1.12
diff -u -p -r1.1.1.11 -r1.12
--- linux-2.4.x/arch/m68knommu/config.in	21 Mar 2004 02:51:15 -0000	1.1.1.11
+++ linux-2.4.x/arch/m68knommu/config.in	21 Mar 2004 04:42:35 -0000	1.12
@@ -207,6 +207,9 @@ fi
 
 if [ "$CONFIG_M5272" = "y" ]; then
 	bool 'Motorola M5272C3 board support' CONFIG_M5272C3
+	bool 'Develer/AMR board support' CONFIG_DEVELER_AMR
+	bool 'Develer/CDB4 board support' CONFIG_DEVELER_CDB4
+	bool 'Develer/SEAC board support' CONFIG_DEVELER_SEAC
 	bool 'SecureEdge SE1100 board support' CONFIG_SE1100
 	
 	bool 'Arcturus Networks uC5272 dimm board support' CONFIG_BOARD_UC5272
@@ -297,6 +300,11 @@ if [ "$CONFIG_M5206eC3" = "y" -o \
      "$CONFIG_M5407C3" = "y" ]; then
 	define_bool CONFIG_MOTOROLA y
 fi
+if [ "$CONFIG_DEVELER_AMR" = "y" -o \
+     "$CONFIG_DEVELER_CDB4" = "y" -o \
+     "$CONFIG_DEVELER_SEAC" = "y" ]; then
+    define_bool CONFIG_DEVELER y
+fi
 
 if [ "$CONFIG_CLEOPATRA" = "y" -o \
      "$CONFIG_CANCam" = "y" -o \
Index: linux-2.4.x/arch/m68knommu/platform/5272/Develer/crt0_ram.S
===================================================================
RCS file: linux-2.4.x/arch/m68knommu/platform/5272/Develer/crt0_ram.S
diff -N linux-2.4.x/arch/m68knommu/platform/5272/Develer/crt0_ram.S
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ linux-2.4.x/arch/m68knommu/platform/5272/Develer/crt0_ram.S	22 Jul 2003 12:11:47 -0000	1.4
@@ -0,0 +1,200 @@
+/*****************************************************************************/
+
+/*
+ *	crt0_ram.S -- startup code for MCF5272 ColdFire based MOTOROLA boards.
+ *
+ *	(C) Copyright 1999-2002, Greg Ungerer (gerg@snapgear.com).
+ *	(C) Copyright 2000, Lineo (www.lineo.com).
+ */
+
+/*****************************************************************************/
+
+#include "linux/autoconf.h"
+#include "asm/coldfire.h"
+#include "asm/mcfsim.h"
+
+/*****************************************************************************/
+
+/*
+ *	Motorola M5272C3 ColdFire eval board, chip select and memory setup.
+ */
+
+#define	MEM_BASE	0x00000000	/* Memory base at address 0 */
+#define	VBR_BASE	MEM_BASE	/* Vector address */
+
+/*****************************************************************************/
+
+.global	_start
+.global _rambase
+.global _ramvec
+.global	_ramstart
+.global	_ramend
+
+/*****************************************************************************/
+
+.data
+
+/*
+ *	Set up the usable of RAM stuff. Size of RAM is determined then
+ *	an initial stack set up at the end.
+ */
+_rambase:
+.long	0
+_ramvec:
+.long	0
+_ramstart:
+.long	0
+_ramend:
+.long	0
+
+#if CONFIG_BLK_DEV_INITRD
+/*
+ *	Setup initial RAM disk limits of using INITRD.
+ */
+.extern	initrd_start
+.extern initrd_end
+#endif
+
+/*****************************************************************************/
+
+.text
+
+/*
+ *	This is the codes first entry point. This is where it all
+ *	begins...
+ */
+
+_start:
+	nop					/* Filler */
+	move.w	#0x2700, %sr			/* No interrupts */
+
+	/*
+	 * Setup VBR here, otherwise buserror remap will not work.
+	 * if dBug was active before (on my SBC with dBug 1.1 of Dec 16 1996)
+	 *
+	 * bkr@cut.de 19990306
+	 *
+	 * Note: this is because dBUG points VBR to ROM, making vectors read
+	 * only, so the bus trap can't be changed. (RS)
+	 */
+	move.l	#VBR_BASE, %a7			/* Note VBR can't be read */
+	movec	%a7, %VBR
+	move.l	%a7, _ramvec			/* Set up vector addr */
+	move.l	%a7, _rambase			/* Set up base RAM addr */
+
+	/*
+	 *	Determine size of RAM, then set up initial stack.
+	 */
+#if defined(CONFIG_RAMAUTO)
+	move.l	MCF_MBAR+0x7c, %d0		/* Get SDRAM address mask */
+	andi.l	#0xfffff000, %d0		/* Mask out chip select options */
+	neg.l	%d0				/* Get size */
+#else
+#if defined(CONFIG_RAM16MB)
+#define	MEM_SIZE	0x01000000		/* Memory size 16Mb */
+#elif defined(CONFIG_RAM8MB)
+#define	MEM_SIZE	0x00800000		/* Memory size 8Mb */
+#else
+#define	MEM_SIZE	0x00400000		/* Memory size 4Mb */
+#endif
+	move.l	#MEM_SIZE, %d0
+#endif
+
+	move.l	%d0, %sp			/* Set up initial stack ptr */
+	move.l	%d0, _ramend			/* Set end ram addr */
+
+	/*
+	 *	Enable CPU internal cache.
+	 */
+	move.l	#0x01000000, %d0		/* Invalidate cache cmd */
+	movec	%d0, %CACR			/* Invalidate cache */
+	move.l	#0x80000100, %d0		/* Setup cache mask */
+	movec	%d0, %CACR			/* Enable cache */
+
+#ifdef CONFIG_ROMFS_FS
+	/*
+	 *	Move ROM filesystem above bss :-)
+	 */
+	lea.l	_sbss, %a0			/* Get start of bss */
+	lea.l	_ebss, %a1			/* Set up destination  */
+	move.l	%a0, %a2			/* Copy of bss start */
+
+#if CONFIG_BLK_DEV_INITRD
+	move.l	%a1, %d2
+	add.l	#0xfff, %d2			/* Round ROMfs start to page */
+	and.l	#0xfffff000, %d2
+	move.l	%d2, %a1			/* Save result for later */
+#endif
+
+	move.l	8(%a0), %d1			/* Get size of ROMFS */
+	addq.l	#8, %d1				/* Allow for rounding */
+	and.l	#0xfffffffc, %d1		/* Whole words */
+
+	add.l	%d1, %a0			/* Copy from end */
+	add.l	%d1, %a1			/* Copy from end */
+	move.l	%a1, _ramstart			/* Set start of ram */
+
+_copy_romfs:
+	move.l	-(%a0), %d0			/* Copy dword */
+	move.l	%d0, -(%a1)
+	cmp.l	%a0, %a2			/* Check if at end */
+	bne	_copy_romfs
+
+#else /* !CONFIG_ROMFS_FS */
+
+	lea.l	_ebss, %a1			/* Get end of bss segment */
+	move.l	%a1, _ramstart			/* Set start of ram */
+
+#endif /* !CONFIG_ROMFS_FS */
+
+	/*
+	 *	Zero out the bss region.
+	 */
+	lea.l	_sbss, %a0			/* Get start of bss */
+	lea.l	_ebss, %a1			/* Get end of bss */
+	clr.l	%d0				/* Set value */
+_clear_bss:
+	move.l	%d0, (%a0)+			/* Clear each word */
+	cmp.l	%a0, %a1			/* Check if at end */
+	bne	_clear_bss
+
+#if CONFIG_BLK_DEV_INITRD
+# if CONFIG_ROMFS_FS
+	/*
+	 *	Setup up RAMdisk info if using it.
+	 *	(Must do this after clearing the bss :-)
+	 */
+	move.l	%d2, initrd_start		/* Set up start of initrd */
+	add.l	%d1, %d2			/* Calculate end of initrd */
+	move.l	%d2, initrd_end
+
+# else /* !CONFIG_ROMFS_FS */
+
+	/*
+	 * initrd support for Coldfire currently requires romfs.
+	 * Generic initrd support requires a bootloader protocol to 
+	 * tell the kernel where the image is located.
+	 */
+	moveq.l	#0, %d2
+	move.l	%d2, initrd_start
+	move.l	%d2, initrd_end
+
+# endif /* !CONFIG_ROMFS_FS */
+#endif /* CONFIG_BLK_DEV_INITRD */
+
+	/*
+	 *	Load the current task pointer and stack.
+	 */
+	lea	init_task_union, %a0
+	movel	%a0, _current_task
+	lea	0x2000(%a0), %sp
+
+	/*
+	 *	Assember start up done, start code proper.
+	 */
+	jsr	start_kernel			/* Start Linux kernel */
+
+_exit:
+	jmp	_exit				/* Should never get here */
+
+/*****************************************************************************/
Index: linux-2.4.x/arch/m68knommu/platform/5272/Develer/ram.ld
===================================================================
RCS file: linux-2.4.x/arch/m68knommu/platform/5272/Develer/ram.ld
diff -N linux-2.4.x/arch/m68knommu/platform/5272/Develer/ram.ld
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ linux-2.4.x/arch/m68knommu/platform/5272/Develer/ram.ld	22 Jul 2003 12:22:44 -0000	1.4
@@ -0,0 +1,69 @@
+
+MEMORY {
+	ram    : ORIGIN = 0x400, LENGTH = 0x3ffc00
+}
+
+SECTIONS {
+
+	.text : {
+		_stext = . ;
+        	*(.text)
+		*(.text.exit)
+		*(.text.lock)
+		*(.exitcall.exit)
+		*(.rodata)
+		*(.rodata.*)
+        	*(.modinfo)
+		. = ALIGN(0x4) ;
+		*(.kstrtab)
+		. = ALIGN(16);          /* Exception table              */
+		__start___ex_table = .;
+		*(__ex_table)
+		__stop___ex_table = .;
+
+		__start___ksymtab = .;  /* Kernel symbol table          */
+		*(__ksymtab)
+		__stop___ksymtab = .;
+		. = ALIGN(4) ;
+		_etext = . ;
+	} > ram
+
+	.data BLOCK(0x4) : {
+		. = ALIGN(4);
+		_sdata = . ;
+		__data_start = . ;
+        *(.data)
+		*(.data.exit)
+		. = ALIGN(8192) ;
+        *(.data.init_task)
+		. = ALIGN(8192) ;
+		_edata = . ;
+	} > ram
+
+	.init BLOCK(4096) : {
+		. = ALIGN(4096);
+		__init_begin = .;
+		*(.text.init)
+		*(.data.init)
+		. = ALIGN(16);
+		__setup_start = .;
+		*(.setup.init)
+		__setup_end = .;
+		__initcall_start = .;
+		*(.initcall.init)
+		. = ALIGN(4);
+		__initcall_end = .;
+		__init_end = .;
+	} > ram
+
+	.bss BLOCK(0x4) : {
+		. = ALIGN(4);
+		_sbss = . ;
+		*(.bss)
+		*(COMMON)
+		. = ALIGN(4) ;
+		_ebss = . ;
+		_end = . ;
+	} > ram
+}
+
Index: linux-2.4.x/drivers/char/Makefile
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.4.x/drivers/char/Makefile,v
retrieving revision 1.1.1.10
retrieving revision 1.9
diff -u -p -r1.1.1.10 -r1.9
--- linux-2.4.x/drivers/char/Makefile	21 Mar 2004 02:52:02 -0000	1.1.1.10
+++ linux-2.4.x/drivers/char/Makefile	21 Mar 2004 04:42:39 -0000	1.9
@@ -213,6 +213,7 @@ endif
 
 obj-$(CONFIG_VT) += vt.o vc_screen.o consolemap.o consolemap_deftbl.o $(CONSOLE) selection.o
 obj-$(CONFIG_SERIAL) += $(SERIAL)
+obj-$(CONFIG_SERIAL_CDB4) += $(SERIAL)
 obj-$(CONFIG_SERIAL_HCDP) += hcdp_serial.o
 obj-$(CONFIG_SERIAL_21285) += serial_21285.o
 obj-$(CONFIG_SERIAL_SA1100) += serial_sa1100.o
Index: linux-2.4.x/drivers/char/ds1302.c
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.4.x/drivers/char/ds1302.c,v
retrieving revision 1.1.1.2
retrieving revision 1.3
diff -u -p -r1.1.1.2 -r1.3
--- linux-2.4.x/drivers/char/ds1302.c	5 Sep 2003 22:59:01 -0000	1.1.1.2
+++ linux-2.4.x/drivers/char/ds1302.c	6 Sep 2003 00:41:36 -0000	1.3
@@ -89,6 +89,14 @@ static volatile unsigned short	*ds1302_d
 static volatile unsigned short	*ds1302_dp =
 	(volatile unsigned short *) (MCF_MBAR + MCFSIM_PADAT);
 
+#ifdef CONFIG_DEVELER_CDB4
+
+#define	RTC_RESET	0x0200		/* PA9 of M5272 */
+#define	RTC_IODATA	0x0100		/* PA8 of M5272 */
+#define	RTC_SCLK	0x0080		/* PA7 of M5272 */
+
+#else /* !CONFIG_DEVELER_CDB4 */
+
 #define	RTC_RESET	0x0020		/* PA5 of M5272 */
 #define	RTC_IODATA	0x0040		/* PA6 of M5272 */
 #define	RTC_SCLK	0x0080		/* PA7 of M5272 */
Index: linux-2.4.x/drivers/char/mcfserial.c
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.4.x/drivers/char/mcfserial.c,v
retrieving revision 1.1.1.10
retrieving revision 1.8
diff -u -p -r1.1.1.10 -r1.8
--- linux-2.4.x/drivers/char/mcfserial.c	21 Mar 2004 02:52:06 -0000	1.1.1.10
+++ linux-2.4.x/drivers/char/mcfserial.c	21 Mar 2004 04:42:39 -0000	1.8
@@ -1763,7 +1763,7 @@ static void mcfrs_irqinit(struct mcf_ser
 
 	/* Enable the output lines for the serial ports */
 	portp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_PBCNT);
-	*portp = (*portp & ~0x000000ff) | 0x00000055;
+	*portp = (*portp & ~0x0000ffff) | 0x00000055;
 	portp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_PDCNT);
 	*portp = (*portp & ~0x000003fc) | 0x000002a8;
 	sportp = (volatile unsigned short *) (MCF_MBAR + MCFSIM_PBDDR);
Index: linux-2.4.x/drivers/char/serial.c
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.4.x/drivers/char/serial.c,v
retrieving revision 1.1.1.7
retrieving revision 1.9
diff -u -p -r1.1.1.7 -r1.9
--- linux-2.4.x/drivers/char/serial.c	21 Mar 2004 02:52:06 -0000	1.1.1.7
+++ linux-2.4.x/drivers/char/serial.c	21 Mar 2004 04:42:39 -0000	1.9
@@ -454,6 +454,36 @@ static inline void mcf_manage_sim(int ir
 # define mcf_manage_sim(irq,pri) do {} while(0)
 #endif /* !CONFIG_COLDFIRE */
 
+#ifdef CONFIG_COLDFIRE
+static inline void mcf_reset_irq(int irq)
+{
+	volatile unsigned long *icrp;
+
+	irq -= 65;
+	if (irq < 0 || irq >= 32)
+		return;
+
+	icrp = (volatile unsigned long *)(MCF_MBAR + MCFSIM_ICR1) + (irq >> 3);
+	*icrp = (*icrp & 0x77777777) | (0x80000000 >> ((irq & 7) << 2));
+}
+static inline void mcf_manage_sim(int irq, int pri)
+{
+	volatile unsigned long *icrp;
+
+	irq -= 65;
+	if(irq < 0 || irq >= 32)
+		return;
+
+	icrp = (volatile unsigned long *)(MCF_MBAR + MCFSIM_ICR1) + irq / 8;
+	irq = (7 - (irq % 8)) * 4;
+
+	*icrp = (*icrp & ((7 << irq) ^ 0x77777777)) | ((8 + pri) << irq);
+}
+#else /* !CONFIG_COLDFIRE */
+# define mcf_reset_irq(irq) do {} while(0)
+# define mcf_manage_sim(irq,pri) do {} while(0)
+#endif /* !CONFIG_COLDFIRE */
+
 static inline int serial_paranoia_check(struct async_struct *info,
 					kdev_t device, const char *routine)
 {
Index: linux-2.4.x/drivers/mtd/chips/cfi_cmdset_0002.c
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.4.x/drivers/mtd/chips/cfi_cmdset_0002.c,v
retrieving revision 1.1.1.5
retrieving revision 1.6
diff -u -p -r1.1.1.5 -r1.6
--- linux-2.4.x/drivers/mtd/chips/cfi_cmdset_0002.c	21 Mar 2004 02:52:29 -0000	1.1.1.5
+++ linux-2.4.x/drivers/mtd/chips/cfi_cmdset_0002.c	21 Mar 2004 04:42:41 -0000	1.6
@@ -883,7 +883,11 @@ static inline int do_erase_oneblock(stru
 	cfi_send_gen_cmd(0x80, cfi->addr_unlock1, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
 	cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
 	cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
+#if defined(CONFIG_MTD_CFI_BLOCKERASE)
+	cfi_write(map, CMD(0x50), adr);
+#else
 	cfi_write(map, CMD(0x30), adr);
+#endif
 	
 	timeo = jiffies + (HZ*20);
 
Index: linux-2.4.x/drivers/mtd/chips/jedec_probe.c
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.4.x/drivers/mtd/chips/jedec_probe.c,v
retrieving revision 1.1.1.3
retrieving revision 1.8
diff -u -p -r1.1.1.3 -r1.8
--- linux-2.4.x/drivers/mtd/chips/jedec_probe.c	21 Mar 2004 02:52:29 -0000	1.1.1.3
+++ linux-2.4.x/drivers/mtd/chips/jedec_probe.c	21 Mar 2004 04:42:41 -0000	1.8
@@ -963,12 +963,17 @@ static const struct amd_flash_info jedec
 		name: "SST 39LF/VF160",
 		DevSize: SIZE_2MiB,
 		CmdSet: P_ID_AMD_STD,
+#if CONFIG_MTD_CFI_BLOCKERASE 
+		NumEraseRegions: 1,
+		regions: {ERASEINFO(0x10000,32)}
+#else
 		NumEraseRegions: 2,
     /* Split into two regions to get around the 256-region restriction */
 		regions: {ERASEINFO(0x01000,256),
 			  ERASEINFO(0x01000,256),
 		}
- }
+#endif
+	}
 };
 
 
@@ -1223,8 +1228,8 @@ ok_out:
 }
 
 static struct chip_probe jedec_chip_probe = {
-	name: "JEDEC",
-	probe_chip: jedec_probe_chip
+	.name = "JEDEC",
+	.probe_chip = jedec_probe_chip
 };
 
 struct mtd_info *jedec_probe(struct map_info *map)
@@ -1237,9 +1242,9 @@ struct mtd_info *jedec_probe(struct map_
 }
 
 static struct mtd_chip_driver jedec_chipdrv = {
-	probe: jedec_probe,
-	name: "jedec_probe",
-	module: THIS_MODULE
+	.probe	= jedec_probe,
+	.name	= "jedec_probe",
+	.module	= THIS_MODULE
 };
 
 int __init jedec_probe_init(void)
Index: linux-2.4.x/drivers/mtd/maps/Config.in
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.4.x/drivers/mtd/maps/Config.in,v
retrieving revision 1.1.1.9
retrieving revision 1.12
diff -u -p -r1.1.1.9 -r1.12
--- linux-2.4.x/drivers/mtd/maps/Config.in	21 Mar 2004 02:52:30 -0000	1.1.1.9
+++ linux-2.4.x/drivers/mtd/maps/Config.in	21 Mar 2004 04:42:41 -0000	1.12
@@ -123,6 +123,12 @@ if [ "$CONFIG_ARM" = "y" ]; then
    dep_tristate '  JEDEC Flash device mapped on Ceiva/Polaroid PhotoMax Digital Picture Frame' CONFIG_MTD_CEIVA $CONFIG_MTD_JEDECPROBE  $CONFIG_ARCH_CEIVA
 fi
 
+if [ "$CONFIG_M5272" = "y" ]; then
+	dep_tristate '  CFI Flash device mapped on Motorola M5272C3' CONFIG_MTD_M5272C3 $CONFIG_MTD_CFI
+	dep_tristate '  CFI Flash Develer mapping' CONFIG_MTD_DEVELER_CFI $CONFIG_MTD_CFI
+	dep_tristate '  JEDEC Flash Develer mapping' CONFIG_MTD_DEVELER_JEDEC $CONFIG_MTD_CFI
+fi
+
 if [ "$CONFIG_COBRA5272" = "y" ]; then
 	dep_tristate '  CFI Flash device mapped on COBRA5272' CONFIG_MTD_COBRA5272 $CONFIG_MTD_CFI
 fi
Index: linux-2.4.x/drivers/mtd/maps/Makefile
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.4.x/drivers/mtd/maps/Makefile,v
retrieving revision 1.1.1.9
retrieving revision 1.10
diff -u -p -r1.1.1.9 -r1.10
--- linux-2.4.x/drivers/mtd/maps/Makefile	21 Mar 2004 02:52:30 -0000	1.1.1.9
+++ linux-2.4.x/drivers/mtd/maps/Makefile	21 Mar 2004 04:42:41 -0000	1.10
@@ -54,6 +54,8 @@ obj-$(CONFIG_MTD_SNAPARM)	+= snaparm.o
 obj-$(CONFIG_MTD_SOLUTIONENGINE)+= solutionengine.o
 obj-$(CONFIG_MTD_ADVANTA)	+= advanta.o
 obj-$(CONFIG_MTD_KeyTechnology)	+= keyTechnology.o
+obj-$(CONFIG_MTD_DEVELER_CFI)	+= develer_cfi.o
+obj-$(CONFIG_MTD_DEVELER_JEDEC)	+= develer_jedec.o
 obj-$(CONFIG_MTD_COBRA5272)     += cobra5272.o
 obj-$(CONFIG_MTD_DNP5280)	+= dnp5280.o
 obj-$(CONFIG_MTD_M5272C3)	+= m5272c3.o
Index: linux-2.4.x/drivers/mtd/maps/develer_cfi.c
===================================================================
RCS file: linux-2.4.x/drivers/mtd/maps/develer_cfi.c
diff -N linux-2.4.x/drivers/mtd/maps/develer_cfi.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ linux-2.4.x/drivers/mtd/maps/develer_cfi.c	22 Jul 2003 12:14:57 -0000	1.4
@@ -0,0 +1,215 @@
+/*
+ *
+ * Normal mappings of chips in physical memory
+ */
+
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <asm/io.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/map.h>
+#include <linux/mtd/partitions.h>
+#include <linux/config.h>
+
+
+#define WINDOW_ADDR 0xffe00000
+#define WINDOW_SIZE 0x200000
+#define BUSWIDTH 2
+
+extern char* ppcboot_getenv(char* v);
+
+static struct mtd_info *mymtd;
+
+static __u8 develer_cfi_read8(struct map_info *map, unsigned long ofs)
+{
+	return readb(map->map_priv_1 + ofs);
+}
+
+static __u16 develer_cfi_read16(struct map_info *map, unsigned long ofs)
+{
+	return readw(map->map_priv_1 + ofs);
+}
+
+static __u32 develer_cfi_read32(struct map_info *map, unsigned long ofs)
+{
+	return readl(map->map_priv_1 + ofs);
+}
+
+static void develer_cfi_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
+{
+	memcpy_fromio(to, map->map_priv_1 + from, len);
+}
+
+static void develer_cfi_write8(struct map_info *map, __u8 d, unsigned long adr)
+{
+	writeb(d, map->map_priv_1 + adr);
+	mb();
+}
+
+static void develer_cfi_write16(struct map_info *map, __u16 d, unsigned long adr)
+{
+	writew(d, map->map_priv_1 + adr);
+	mb();
+}
+
+static void develer_cfi_write32(struct map_info *map, __u32 d, unsigned long adr)
+{
+	writel(d, map->map_priv_1 + adr);
+	mb();
+}
+
+static void develer_cfi_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
+{
+	memcpy_toio(map->map_priv_1 + to, from, len);
+}
+
+static struct map_info develer_cfi_map = {
+	.name = "Develer flash device",
+	.size = WINDOW_SIZE,
+	.buswidth = BUSWIDTH,
+	.read8 = develer_cfi_read8,
+	.read16 = develer_cfi_read16,
+	.read32 = develer_cfi_read32,
+	.copy_from = develer_cfi_copy_from,
+	.write8 = develer_cfi_write8,
+	.write16 = develer_cfi_write16,
+	.write32 = develer_cfi_write32,
+	.copy_to = develer_cfi_copy_to
+};
+
+/*
+ * MTD 'PARTITIONING' STUFF 
+ */
+
+#ifndef CONFIG_PPCBOOT
+
+static struct mtd_partition develer_cfi_partitions[] = {
+	{
+		.name = "boot (32K)",
+		.size = 0x8000,
+		.offset = 0
+	},
+	{
+		.name = "kernel (480K)",
+		.size = 0x78000,
+		.offset = 0x8000
+	},
+	{
+		.name = "rootfs (1536K)",
+		.size = 0x180000,
+		.offset = 0x80000
+	}
+};
+
+#else
+
+#define DEVELER_CFI_MAX_PARTITIONS 8
+#define DEVELER_CFI_MAX_PARTARGENTRIES 3
+#define DEVELER_CFI_PTABLE_BUFSIZE 256
+static struct mtd_partition develer_cfi_partitions[DEVELER_CFI_MAX_PARTITIONS];
+static int develer_cfi_partitions_cnt=0;
+static char* develer_cfi_emptyentry = "";
+
+static void read_develer_cfi_partitiontable(void) {
+	char* envptable=ppcboot_getenv("ptable");
+	if(envptable) {
+		char ptable[DEVELER_CFI_PTABLE_BUFSIZE],*p,*pt;
+		int pcnt,acnt,i;
+		char *ptableargentry[DEVELER_CFI_MAX_PARTITIONS][DEVELER_CFI_MAX_PARTARGENTRIES];
+
+		strncpy(ptable,envptable,DEVELER_CFI_PTABLE_BUFSIZE-1);
+		ptable[DEVELER_CFI_PTABLE_BUFSIZE-1]=0;
+
+		for(pcnt=0;pcnt<DEVELER_CFI_MAX_PARTITIONS;pcnt++) {
+			for(acnt=0;acnt<DEVELER_CFI_MAX_PARTARGENTRIES;acnt++) {
+				ptableargentry[pcnt][acnt]=develer_cfi_emptyentry;
+			};
+		};
+
+		pcnt=acnt=0;
+		p=pt=ptable;
+		while(1) {
+			if((*p == ',') || (*p == ':') || (*p == 0)) {
+				if(pcnt<DEVELER_CFI_MAX_PARTITIONS) {      
+					if(acnt<DEVELER_CFI_MAX_PARTARGENTRIES)
+						ptableargentry[pcnt][acnt++]=pt;
+					if((*p == ':') || ( *p == 0 ))
+					{ acnt=0; pcnt++; };
+					if( *p == 0 )
+						break;
+					pt=p+1;
+				};
+				*p=0;
+			};
+			p++;
+		};
+
+		for(i=0;i<pcnt;i++) {
+			develer_cfi_partitions[i].name=
+				(char*)kmalloc(strlen(ptableargentry[i][0])+1,GFP_KERNEL);
+			strcpy(develer_cfi_partitions[i].name,ptableargentry[i][0]);
+			develer_cfi_partitions[i].size=
+				simple_strtoul(ptableargentry[i][1],0,16)*0x1000;
+			develer_cfi_partitions[i].offset=
+				simple_strtoul(ptableargentry[i][2],0,16)*0x1000;
+		};
+
+		develer_cfi_partitions_cnt=pcnt;
+	};
+};
+
+#endif
+
+#if LINUX_VERSION_CODE < 0x20212 && defined(MODULE)
+#define init_develer_cfi init_module
+#define cleanup_develer_cfi cleanup_module
+#endif
+
+int __init init_develer_cfi(void)
+{
+       	printk(KERN_NOTICE "Develer cfi flash device: %x at %x\n", WINDOW_SIZE, WINDOW_ADDR);
+	develer_cfi_map.map_priv_1 = (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE);
+
+	if (!develer_cfi_map.map_priv_1) {
+		printk("Failed to ioremap\n");
+		return -EIO;
+	}
+	mymtd = do_map_probe("cfi_probe", &develer_cfi_map);
+	if (mymtd) {
+		mymtd->module = THIS_MODULE;
+
+#ifdef CONFIG_PPCBOOT
+                read_develer_cfi_partitiontable();
+		if(develer_cfi_partitions_cnt) {
+		  return add_mtd_partitions(mymtd, develer_cfi_partitions, develer_cfi_partitions_cnt);
+		}
+		else {
+		  return  -ENXIO;
+		};
+#else
+		return add_mtd_partitions(mymtd, develer_cfi_partitions,
+					  sizeof(develer_cfi_partitions) /
+					  sizeof(struct mtd_partition));
+#endif
+	}
+
+	iounmap((void *)develer_cfi_map.map_priv_1);
+	return -ENXIO;
+}
+
+static void __exit cleanup_develer_cfi(void)
+{
+	if (mymtd) {
+		del_mtd_partitions(mymtd);
+		map_destroy(mymtd);
+	}
+	if (develer_cfi_map.map_priv_1) {
+		iounmap((void *)develer_cfi_map.map_priv_1);
+		develer_cfi_map.map_priv_1 = 0;
+	}
+}
+
+module_init(init_develer_cfi);
+module_exit(cleanup_develer_cfi);
+
Index: linux-2.4.x/drivers/mtd/maps/develer_jedec.c
===================================================================
RCS file: linux-2.4.x/drivers/mtd/maps/develer_jedec.c
diff -N linux-2.4.x/drivers/mtd/maps/develer_jedec.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ linux-2.4.x/drivers/mtd/maps/develer_jedec.c	4 Feb 2004 21:07:15 -0000	1.6
@@ -0,0 +1,215 @@
+/*
+ *
+ * Normal mappings of chips in physical memory
+ */
+
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <asm/io.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/map.h>
+#include <linux/mtd/partitions.h>
+#include <linux/config.h>
+
+
+#define WINDOW_ADDR 0xffe00000
+#define WINDOW_SIZE 0x200000
+#define BUSWIDTH 2
+
+extern char* ppcboot_getenv(char* v);
+
+static struct mtd_info *mymtd;
+
+static __u8 develer_jedec_read8(struct map_info *map, unsigned long ofs)
+{
+	return readb(map->map_priv_1 + ofs);
+}
+
+static __u16 develer_jedec_read16(struct map_info *map, unsigned long ofs)
+{
+	return readw(map->map_priv_1 + ofs);
+}
+
+static __u32 develer_jedec_read32(struct map_info *map, unsigned long ofs)
+{
+	return readl(map->map_priv_1 + ofs);
+}
+
+static void develer_jedec_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
+{
+	memcpy_fromio(to, map->map_priv_1 + from, len);
+}
+
+static void develer_jedec_write8(struct map_info *map, __u8 d, unsigned long adr)
+{
+	writeb(d, map->map_priv_1 + adr);
+	mb();
+}
+
+static void develer_jedec_write16(struct map_info *map, __u16 d, unsigned long adr)
+{
+	writew(d, map->map_priv_1 + adr);
+	mb();
+}
+
+static void develer_jedec_write32(struct map_info *map, __u32 d, unsigned long adr)
+{
+	writel(d, map->map_priv_1 + adr);
+	mb();
+}
+
+static void develer_jedec_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
+{
+	memcpy_toio(map->map_priv_1 + to, from, len);
+}
+
+static struct map_info develer_jedec_map = {
+	.name = "Develer flash device",
+	.size = WINDOW_SIZE,
+	.buswidth = BUSWIDTH,
+	.read8 = develer_jedec_read8,
+	.read16 = develer_jedec_read16,
+	.read32 = develer_jedec_read32,
+	.copy_from = develer_jedec_copy_from,
+	.write8 = develer_jedec_write8,
+	.write16 = develer_jedec_write16,
+	.write32 = develer_jedec_write32,
+	.copy_to = develer_jedec_copy_to
+};
+
+/*
+ * MTD 'PARTITIONING' STUFF 
+ */
+
+#ifndef CONFIG_PPCBOOT
+
+static struct mtd_partition develer_jedec_partitions[] = {
+	{
+		.name = "boot (64K)",
+		.size = 0x10000,
+		.offset = 0
+	},
+	{
+		.name = "kernel (448K)",
+		.size = 0x70000,
+		.offset = 0x10000
+	},
+	{
+		.name = "rootfs (1536K)",
+		.size = 0x180000,
+		.offset = 0x80000
+	}
+};
+
+#else
+
+#define DEVELER_JEDEC_MAX_PARTITIONS 8
+#define DEVELER_JEDEC_MAX_PARTARGENTRIES 3
+#define DEVELER_JEDEC_PTABLE_BUFSIZE 256
+static struct mtd_partition develer_jedec_partitions[DEVELER_JEDEC_MAX_PARTITIONS];
+static int develer_jedec_partitions_cnt=0;
+static char* develer_jedec_emptyentry = "";
+
+static void read_develer_jedec_partitiontable(void) {
+	char* envptable=ppcboot_getenv("ptable");
+	if(envptable) {
+		char ptable[DEVELER_JEDEC_PTABLE_BUFSIZE],*p,*pt;
+		int pcnt,acnt,i;
+		char *ptableargentry[DEVELER_JEDEC_MAX_PARTITIONS][DEVELER_JEDEC_MAX_PARTARGENTRIES];
+
+		strncpy(ptable,envptable,DEVELER_JEDEC_PTABLE_BUFSIZE-1);
+		ptable[DEVELER_JEDEC_PTABLE_BUFSIZE-1]=0;
+
+		for(pcnt=0;pcnt<DEVELER_JEDEC_MAX_PARTITIONS;pcnt++) {
+			for(acnt=0;acnt<DEVELER_JEDEC_MAX_PARTARGENTRIES;acnt++) {
+				ptableargentry[pcnt][acnt]=develer_jedec_emptyentry;
+			};
+		};
+
+		pcnt=acnt=0;
+		p=pt=ptable;
+		while(1) {
+			if((*p == ',') || (*p == ':') || (*p == 0)) {
+				if(pcnt<DEVELER_JEDEC_MAX_PARTITIONS) {      
+					if(acnt<DEVELER_JEDEC_MAX_PARTARGENTRIES)
+						ptableargentry[pcnt][acnt++]=pt;
+					if((*p == ':') || ( *p == 0 ))
+					{ acnt=0; pcnt++; };
+					if( *p == 0 )
+						break;
+					pt=p+1;
+				};
+				*p=0;
+			};
+			p++;
+		};
+
+		for(i=0;i<pcnt;i++) {
+			develer_jedec_partitions[i].name=
+				(char*)kmalloc(strlen(ptableargentry[i][0])+1,GFP_KERNEL);
+			strcpy(develer_jedec_partitions[i].name,ptableargentry[i][0]);
+			develer_jedec_partitions[i].size=
+				simple_strtoul(ptableargentry[i][1],0,16)*0x1000;
+			develer_jedec_partitions[i].offset=
+				simple_strtoul(ptableargentry[i][2],0,16)*0x1000;
+		};
+
+		develer_jedec_partitions_cnt=pcnt;
+	};
+};
+
+#endif
+
+#if LINUX_VERSION_CODE < 0x20212 && defined(MODULE)
+#define init_develer_jedec init_module
+#define cleanup_develer_jedec cleanup_module
+#endif
+
+int __init init_develer_jedec(void)
+{
+       	printk(KERN_NOTICE "Develer jedec flash device: %x at %x\n", WINDOW_SIZE, WINDOW_ADDR);
+	develer_jedec_map.map_priv_1 = (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE);
+
+	if (!develer_jedec_map.map_priv_1) {
+		printk("Failed to ioremap\n");
+		return -EIO;
+	}
+	mymtd = do_map_probe("jedec_probe", &develer_jedec_map);
+	if (mymtd) {
+		mymtd->module = THIS_MODULE;
+
+#ifdef CONFIG_PPCBOOT
+                read_develer_jedec_partitiontable();
+		if(develer_jedec_partitions_cnt) {
+		  return add_mtd_partitions(mymtd, develer_jedec_partitions, develer_jedec_partitions_cnt);
+		}
+		else {
+		  return  -ENXIO;
+		};
+#else
+		return add_mtd_partitions(mymtd, develer_jedec_partitions,
+					  sizeof(develer_jedec_partitions) /
+					  sizeof(struct mtd_partition));
+#endif
+	}
+
+	iounmap((void *)develer_jedec_map.map_priv_1);
+	return -ENXIO;
+}
+
+static void __exit cleanup_develer_jedec(void)
+{
+	if (mymtd) {
+		del_mtd_partitions(mymtd);
+		map_destroy(mymtd);
+	}
+	if (develer_jedec_map.map_priv_1) {
+		iounmap((void *)develer_jedec_map.map_priv_1);
+		develer_jedec_map.map_priv_1 = 0;
+	}
+}
+
+module_init(init_develer_jedec);
+module_exit(cleanup_develer_jedec);
+
Index: linux-2.4.x/fs/Config.in
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.4.x/fs/Config.in,v
retrieving revision 1.1.1.6
retrieving revision 1.4
diff -u -p -r1.1.1.6 -r1.4
--- linux-2.4.x/fs/Config.in	21 Mar 2004 02:53:19 -0000	1.1.1.6
+++ linux-2.4.x/fs/Config.in	21 Mar 2004 04:42:44 -0000	1.4
@@ -49,6 +49,7 @@ fi
 dep_tristate 'Journalling Flash File System v2 (JFFS2) support' CONFIG_JFFS2_FS $CONFIG_MTD
 if [ "$CONFIG_JFFS2_FS" = "y" -o "$CONFIG_JFFS2_FS" = "m" ] ; then
    int 'JFFS2 debugging verbosity (0 = quiet, 2 = noisy)' CONFIG_JFFS2_FS_DEBUG 0
+   dep_tristate '  Tweak garbage collection parms for AMR AMD AM29PL160 flash' CONFIG_TWEAK_JFFS2_GC_PARMS $CONFIG_MTD_AMR_CFI
 fi
 tristate 'Compressed ROM file system support' CONFIG_CRAMFS
 bool 'Virtual memory file system support (former shm fs)' CONFIG_TMPFS
Index: linux-2.4.x/fs/binfmt_flat.c
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.4.x/fs/binfmt_flat.c,v
retrieving revision 1.1.1.9
retrieving revision 1.14
diff -u -p -r1.1.1.9 -r1.14
--- linux-2.4.x/fs/binfmt_flat.c	21 Mar 2004 02:53:19 -0000	1.1.1.9
+++ linux-2.4.x/fs/binfmt_flat.c	21 Mar 2004 04:42:45 -0000	1.14
@@ -361,11 +361,13 @@ calc_reloc(unsigned long r, struct lib_i
 	/* Range checked already above so doing the range tests is redundant...*/
 	return(addr);
 
+#ifdef CONFIG_BINFMT_SHARED_FLAT
 failed:
 	printk(", killing %s!\n", current->comm);
 	send_sig(SIGSEGV, current, 0);
-
+	
 	return RELOC_FAILED;
+#endif
 }
 
 /****************************************************************************/
Index: linux-2.4.x/fs/jffs2/nodelist.h
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.4.x/fs/jffs2/nodelist.h,v
retrieving revision 1.1.1.7
retrieving revision 1.9
diff -u -p -r1.1.1.7 -r1.9
--- linux-2.4.x/fs/jffs2/nodelist.h	21 Mar 2004 02:53:24 -0000	1.1.1.7
+++ linux-2.4.x/fs/jffs2/nodelist.h	21 Mar 2004 04:42:45 -0000	1.9
@@ -222,13 +222,26 @@ struct jffs2_eraseblock
 #define ALLOC_DELETION	1	/* Deletion node. Best to allow it */
 #define ALLOC_GC	2	/* Space requested for GC. Give it or die */
 
-#define JFFS2_RESERVED_BLOCKS_BASE 3						/* Number of free blocks there must be before we... */
-#define JFFS2_RESERVED_BLOCKS_WRITE (JFFS2_RESERVED_BLOCKS_BASE + 2)		/* ... allow a normal filesystem write */
-#define JFFS2_RESERVED_BLOCKS_DELETION (JFFS2_RESERVED_BLOCKS_BASE + 1)		/* ... allow a normal filesystem deletion */
+#ifdef CONFIG_TWEAK_JFFS2_GC_PARMS
+
+/* Settings for Develer AMD flash, with big 256k blocks */
+#define JFFS2_RESERVED_BLOCKS_BASE 1						
+#define JFFS2_RESERVED_BLOCKS_WRITE (JFFS2_RESERVED_BLOCKS_BASE + 1)		
+#define JFFS2_RESERVED_BLOCKS_DELETION (JFFS2_RESERVED_BLOCKS_BASE)		
+#define JFFS2_RESERVED_BLOCKS_GCTRIGGER (JFFS2_RESERVED_BLOCKS_BASE + 1)
+#define JFFS2_RESERVED_BLOCKS_GCBAD (JFFS2_RESERVED_BLOCKS_BASE)
+#define JFFS2_RESERVED_BLOCKS_GCMERGE (JFFS2_RESERVED_BLOCKS_BASE)	
+
+#else
+
+#define JFFS2_RESERVED_BLOCKS_BASE 3   /* Number of free blocks there must be before we... */
+#define JFFS2_RESERVED_BLOCKS_WRITE (JFFS2_RESERVED_BLOCKS_BASE + 2)	/* ... allow a normal filesystem write */
+#define JFFS2_RESERVED_BLOCKS_DELETION (JFFS2_RESERVED_BLOCKS_BASE + 1)/* ... allow a normal filesystem deletion */
 #define JFFS2_RESERVED_BLOCKS_GCTRIGGER (JFFS2_RESERVED_BLOCKS_BASE + 3)	/* ... wake up the GC thread */
 #define JFFS2_RESERVED_BLOCKS_GCBAD (JFFS2_RESERVED_BLOCKS_BASE + 1)		/* ... pick a block from the bad_list to GC */
-#define JFFS2_RESERVED_BLOCKS_GCMERGE (JFFS2_RESERVED_BLOCKS_BASE)		/* ... merge pages when garbage collecting */
+#define JFFS2_RESERVED_BLOCKS_GCMERGE (JFFS2_RESERVED_BLOCKS_BASE)	/* ... merge pages when garbage collecting */
 
+#endif /* CONFIG_TWEAK_JFFS2_GC_PARMS */
 
 #define PAD(x) (((x)+3)&~3)
 
Index: linux-2.4.x/include/asm-armnommu/flat.h
===================================================================
RCS file: linux-2.4.x/include/asm-armnommu/flat.h
diff -N linux-2.4.x/include/asm-armnommu/flat.h
--- linux-2.4.x/include/asm-armnommu/flat.h	5 Sep 2003 22:59:48 -0000	1.1.1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-/*
- * include/asm-armnommu/flat.h -- uClinux flat-format executables
- */
-
-#ifndef __ARMNOMMU_FLAT_H__
-#define __ARMNOMMU_FLAT_H__
-
-#define	flat_stack_align(sp)			/* nothing needed */
-#define	flat_argvp_envp_on_stack()		1
-#define	flat_old_ram_flag(flags)		(flags)
-#define	flat_reloc_valid(reloc, size)		((reloc) <= (size))
-#define	flat_get_addr_from_rp(rp, relval)	get_unaligned(rp)
-#define	flat_put_addr_at_rp(rp, val, relval)	put_unaligned(val,rp)
-#define	flat_get_relocate_addr(rel)		(rel)
-
-#endif /* __ARMNOMMU_FLAT_H__ */
Index: linux-2.4.x/include/asm-m68knommu/io.h
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.4.x/include/asm-m68knommu/io.h,v
retrieving revision 1.1.1.6
retrieving revision 1.6
diff -u -p -r1.1.1.6 -r1.6
--- linux-2.4.x/include/asm-m68knommu/io.h	5 Sep 2003 22:59:55 -0000	1.1.1.6
+++ linux-2.4.x/include/asm-m68knommu/io.h	6 Sep 2003 00:49:26 -0000	1.6
@@ -51,6 +51,7 @@ static inline unsigned int _swapl(volati
 #define writew(b,addr) (void)((*(volatile unsigned short *) (addr)) = (b))
 #define writel(b,addr) (void)((*(volatile unsigned int *) (addr)) = (b))
 
+
 /*
  * The following are some defines we need for MTD with our
  * COBRA5272 board.
@@ -69,6 +70,7 @@ static inline unsigned int _swapl(volati
 #define __raw_writel writel
 #endif /* CONFIG_COBRA5272 */
 
+
 static inline void io_outsb(unsigned int addr, void *buf, int len)
 {
 	volatile unsigned char *ap = (volatile unsigned char *) addr;
Index: linux-2.4.x/include/asm-m68knommu/nettel.h
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.4.x/include/asm-m68knommu/nettel.h,v
retrieving revision 1.1.1.3
retrieving revision 1.5
diff -u -p -r1.1.1.3 -r1.5
--- linux-2.4.x/include/asm-m68knommu/nettel.h	28 Feb 2003 22:45:03 -0000	1.1.1.3
+++ linux-2.4.x/include/asm-m68knommu/nettel.h	12 Mar 2003 15:23:30 -0000	1.5
@@ -16,7 +16,7 @@
 #include <linux/config.h>
 
 /****************************************************************************/
-#ifdef CONFIG_NETtel
+#if defined(CONFIG_NETtel) || defined(CONFIG_DEVELER_AMR) || defined(CONFIG_DEVELER_CDB4)
 /****************************************************************************/
 
 #ifdef CONFIG_COLDFIRE
@@ -98,6 +98,10 @@ static __inline__ void mcf_setppleds(uns
  */
 #define	MCF_HAVEDCD0
 #define	MCF_HAVEDTR0
+#if defined(CONFIG_DEVELER_AMR) || defined(CONFIG_DEVELER_CDB4)
+#define	MCF_HAVEDCD1
+#define	MCF_HAVEDTR1
+#endif
 
 #ifndef __ASSEMBLY__
 static __inline__ unsigned int mcf_getppdcd(unsigned int portnr)
@@ -107,6 +111,13 @@ static __inline__ unsigned int mcf_getpp
 		pp = (volatile unsigned short *) (MCF_MBAR + MCFSIM_PBDAT);
 		return((*pp & 0x0080) ? 0 : 1);
 	}
+#if defined(HAVE_DCD1)
+	else if (portnr == 1) {
+		pp = (volatile unsigned short *) (MCF_MBAR + MCFSIM_PBDAT);
+		return((*pp & 0x0020) ? 0 : 1);
+	}
+#endif
+
 	return(0);
 }
 
@@ -117,6 +128,12 @@ static __inline__ unsigned int mcf_getpp
 		pp = (volatile unsigned short *) (MCF_MBAR + MCFSIM_PBDAT);
 		return((*pp & 0x0040) ? 0 : 1);
 	}
+#if defined(HAVE_DTR1)
+	else if (portnr == 1) {
+		pp = (volatile unsigned short *) (MCF_MBAR + MCFSIM_PBDAT);
+		return((*pp & 0x0010) ? 0 : 1);
+	}
+#endif
 	return(0);
 }
 
@@ -134,6 +151,6 @@ static __inline__ void mcf_setppdtr(unsi
 /*---------------------------------------------------------------------------*/
 
 /****************************************************************************/
-#endif /* CONFIG_NETtel */
+#endif /* CONFIG_NETtel || CONFIG_DEVELER_AMR || CONFIG_DEVELER_CDB4 */
 /****************************************************************************/
 #endif	/* nettel_h */
Index: linux-2.4.x/include/asm-m68knommu/serial.h
===================================================================
RCS file: linux-2.4.x/include/asm-m68knommu/serial.h
diff -N linux-2.4.x/include/asm-m68knommu/serial.h
--- linux-2.4.x/include/asm-m68knommu/serial.h	5 Sep 2003 22:59:55 -0000	1.1.1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,67 +0,0 @@
-/*
- * linux/include/asm-m68knommu/serial.h
- *
- * Copyright (C) 2003 Develer S.r.l. (http://www.develer.com/)
- * Author: Bernardo Innocenti <bernie@codewiz.org>
- *
- * Based on linux/include/asm-i386/serial.h
- */
-#include <linux/config.h>
-
-/*
- * This assumes you have a 1.8432 MHz clock for your UART.
- *
- * It'd be nice if someone built a serial card with a 24.576 MHz
- * clock, since the 16550A is capable of handling a top speed of 1.5
- * megabits/second; but this requires the faster clock.
- */
-#define BASE_BAUD ( 1843200 / 16 )
-
-#ifdef CONFIG_SERIAL_CDB4
-
-#define CONFIG_SERIAL_SHARE_IRQ
-
-#define CDB4_COM_BASE		((u8 *)0x40000000)
-#define CDB4_COM_IRQ		67	/* external IRQ3 */
-#define CDB4_COM_IRQPRI		5	/* interrupt priority */
-#define CDB4_COM_RESET_BIT	13	/* PA13 hooked to 16C554 RESET line, active high */
-#define STD_COM_FLAGS		ASYNC_BOOT_AUTOCONF
-
-#define SERIAL_PORT_DFNS				\
-	{						\
-		.baud_base	= BASE_BAUD,		\
-		.iomem_base	= CDB4_COM_BASE + 0x10,	\
-		.io_type	= SERIAL_IO_MEM,	\
-		.irq		= CDB4_COM_IRQ,		\
-		.flags		= STD_COM_FLAGS		\
-	},						\
-	{						\
-		.baud_base	= BASE_BAUD,		\
-		.iomem_base	= CDB4_COM_BASE + 0x18,	\
-		.io_type	= SERIAL_IO_MEM,	\
-		.irq		= CDB4_COM_IRQ,		\
-		.flags		= STD_COM_FLAGS		\
-	},						\
-	{						\
-		.baud_base	= BASE_BAUD,		\
-		.iomem_base	= CDB4_COM_BASE + 0x20,	\
-		.io_type	= SERIAL_IO_MEM,	\
-		.irq		= CDB4_COM_IRQ,		\
-		.flags		= STD_COM_FLAGS		\
-	},						\
-	{						\
-		.baud_base	= BASE_BAUD,		\
-		.iomem_base	= CDB4_COM_BASE + 0x28,	\
-		.io_type	= SERIAL_IO_MEM,	\
-		.irq		= CDB4_COM_IRQ,		\
-		.flags		= STD_COM_FLAGS		\
-	}
-
-#define RS_TABLE_SIZE  4
-
-#else /* !CONFIG_SERIAL_CDB4 */
-
-#error serial port not supported on this board
-
-#endif /* !CONFIG_SERIAL_CDB4 */
-
Index: linux-2.4.x/include/asm-m68knommu/system.h
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.4.x/include/asm-m68knommu/system.h,v
retrieving revision 1.1.1.8
retrieving revision 1.7
diff -u -p -r1.1.1.8 -r1.7
--- linux-2.4.x/include/asm-m68knommu/system.h	21 Mar 2004 02:53:58 -0000	1.1.1.8
+++ linux-2.4.x/include/asm-m68knommu/system.h	21 Mar 2004 04:42:46 -0000	1.7
@@ -232,6 +232,13 @@ static inline unsigned long __xchg(unsig
         jmp 0xf0000400;			\
         ");				\
 })
+#elif defined(CONFIG_DEVELER_AMR) || defined(CONFIG_DEVELER_CDB4) || defined(CONFIG_DEVELER_SEAC)
+#define HARD_RESET_NOW() ({			\
+	asm(					\
+		"movew #0x2700, %sr\n\t"	\
+		"jmp 0xffe00400\n"		\
+	);					\
+})
 /*
  * HARD_RESET_NOW() for senTec COBRA5272:
  *
@@ -274,6 +281,5 @@ static inline unsigned long __xchg(unsig
         ");				\
 })
 #endif
-#endif
 
 #endif /* _M68KNOMMU_SYSTEM_H */
Index: linux-2.4.x/include/asm-niosnommu/flat.h
===================================================================
RCS file: linux-2.4.x/include/asm-niosnommu/flat.h
diff -N linux-2.4.x/include/asm-niosnommu/flat.h
--- linux-2.4.x/include/asm-niosnommu/flat.h	5 Sep 2003 23:00:00 -0000	1.1.1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,18 +0,0 @@
-/*
- * include/asm-niosnommu/flat.h -- uClinux flat-format executables
- *
- * this file is yet to be completed: davidm@snapgear.com
- */
-
-#ifndef __NIOSNOMMU_FLAT_H__
-#define __NIOSNOMMU_FLAT_H__
-
-#define	flat_stack_align(sp)			XXXX
-#define	flat_argvp_envp_on_stack()		XXXX
-#define	flat_old_ram_flag(flags)		(flags)
-#define	flat_reloc_valid(reloc, size)		((reloc) <= (size))
-#define	flat_get_addr_from_rp(rp, relval)	XXXX
-#define	flat_put_addr_at_rp(rp, val, relval)	XXXX
-#define	flat_get_relocate_addr(rel)		XXXX
-
-#endif /* __NIOSNOMMU_FLAT_H__ */
Index: linux-2.4.x/net/Config.in
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.4.x/net/Config.in,v
retrieving revision 1.1.1.5
retrieving revision 1.4
diff -u -p -r1.1.1.5 -r1.4
--- linux-2.4.x/net/Config.in	21 Mar 2004 02:54:41 -0000	1.1.1.5
+++ linux-2.4.x/net/Config.in	21 Mar 2004 04:42:48 -0000	1.4
@@ -100,11 +100,6 @@ fi
 #bool 'Network code profiler' CONFIG_NET_PROFILE
 endmenu
 
-tristate 'IP Security Protocol (FreeS/WAN IPSEC)' CONFIG_IPSEC
-if [ "$CONFIG_IPSEC" != "n" ]; then
-  source ../freeswan/klips/net/ipsec/Config.in
-fi
-
 mainmenu_option next_comment
 comment 'Network testing'
 tristate 'Packet Generator (USE WITH CAUTION)' CONFIG_NET_PKTGEN
Index: linux-2.6.x/Makefile
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.6.x/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -p -r1.1.1.1 -r1.2
--- linux-2.6.x/Makefile	21 Mar 2004 02:54:51 -0000	1.1.1.1
+++ linux-2.6.x/Makefile	21 Mar 2004 09:24:50 -0000	1.2
@@ -486,6 +486,7 @@ define cmd_vmlinux__
 	$(drivers-y) \
 	$(net-y) \
 	--end-group \
+	-M -Map $@.map \
 	$(filter .tmp_kallsyms%,$^) \
 	-o $@
 endef
Index: linux-2.6.x/arch/m68knommu/Kconfig
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.6.x/arch/m68knommu/Kconfig,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -p -r1.1.1.1 -r1.2
--- linux-2.6.x/arch/m68knommu/Kconfig	21 Mar 2004 02:54:53 -0000	1.1.1.1
+++ linux-2.6.x/arch/m68knommu/Kconfig	21 Mar 2004 09:24:50 -0000	1.2
@@ -288,6 +288,29 @@ config M5282C3
 	help
 	  Support for the Motorola M5282C3 board.
 
+config DEVELER_AMR
+	bool "ISC/Develer AMR board support"
+	depends on M5272
+	help
+	  Support for the ISC/Develer AMR board.
+
+config DEVELER_CDB4
+	bool "AEP/Develer CDB4 board support"
+	depends on M5272
+	help
+	  Support for the AEP/Develer CDB4 board.
+
+config DEVELER_SEAC
+	bool "SEAC/Develer SC board support"
+	depends on M5272
+	help
+	  Support for the SEAC/Develer SC board.
+
+config DEVELER
+	bool
+	default y
+	depends on (DEVELER_AMR || DEVELER_CDB4 || DEVELER_SEAC)
+
 config ARN5307
 	bool "Arnewsh 5307 board support"
 	depends on M5307
Index: linux-2.6.x/arch/m68knommu/Makefile
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.6.x/arch/m68knommu/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -p -r1.1.1.1 -r1.2
--- linux-2.6.x/arch/m68knommu/Makefile	21 Mar 2004 02:54:53 -0000	1.1.1.1
+++ linux-2.6.x/arch/m68knommu/Makefile	21 Mar 2004 09:24:50 -0000	1.2
@@ -28,6 +28,7 @@ board-$(CONFIG_UCQUICC)		:= uCquicc
 board-$(CONFIG_DRAGEN2)		:= de2
 board-$(CONFIG_ARNEWSH)		:= ARNEWSH
 board-$(CONFIG_MOTOROLA)	:= MOTOROLA
+board-$(CONFIG_DEVELER)		:= MOTOROLA
 board-$(CONFIG_ELITE)		:= eLITE
 board-$(CONFIG_eLIA)		:= eLIA
 board-$(CONFIG_NETtel)		:= NETtel
Index: linux-2.6.x/arch/m68knommu/kernel/vmlinux.lds.S
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.6.x/arch/m68knommu/kernel/vmlinux.lds.S,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -p -r1.1.1.1 -r1.2
--- linux-2.6.x/arch/m68knommu/kernel/vmlinux.lds.S	21 Mar 2004 02:54:53 -0000	1.1.1.1
+++ linux-2.6.x/arch/m68knommu/kernel/vmlinux.lds.S	21 Mar 2004 09:24:50 -0000	1.2
@@ -128,6 +128,15 @@
 #endif
 
 /*
+ *	Develer boards are similar to M5272C3, but we can grab some
+ *	more RAM because we're using colilo instead of dBUG.
+ */
+#if defined(CONFIG_DEVELER)
+#define	RAM_START	0x400
+#define	RAM_LENGTH	0x3ffc00
+#endif
+
+/*
  *	These flash boot boards use all of ram for operation. Again the
  *	actual memory size is not important here, assume at least 4MiB.
  *	They currently have no support for running in flash.
Index: linux-2.6.x/drivers/mtd/chips/Kconfig
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.6.x/drivers/mtd/chips/Kconfig,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -p -r1.1.1.1 -r1.2
--- linux-2.6.x/drivers/mtd/chips/Kconfig	21 Mar 2004 02:55:02 -0000	1.1.1.1
+++ linux-2.6.x/drivers/mtd/chips/Kconfig	21 Mar 2004 09:24:50 -0000	1.2
@@ -168,6 +168,17 @@ config MTD_CFI_STAA
 	  sets which a CFI-compliant chip may claim to implement. This code
 	  provides support for one of those command sets.
 
+config MTD_CFI_BLOCKERASE
+	bool "Use BLOCK ERASE command"
+	depends on MTD_CFI_AMDSTD
+	default n
+	help
+	  Some flash chips such as the SST S71145, have two different erase
+	  commands, one for sectors (4KB) and one for blocks (64KB). Using
+	  larger erase units might be faster and reduce memory usage of JFFS2
+	  for such chips. Note that the chip mapping must be adjusted to
+	  reflect this change.
+
 config MTD_RAM
 	tristate "Support for RAM chips in bus mapping"
 	depends on MTD
Index: linux-2.6.x/drivers/mtd/chips/cfi_cmdset_0002.c
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.6.x/drivers/mtd/chips/cfi_cmdset_0002.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -p -r1.1.1.1 -r1.2
--- linux-2.6.x/drivers/mtd/chips/cfi_cmdset_0002.c	21 Mar 2004 02:55:02 -0000	1.1.1.1
+++ linux-2.6.x/drivers/mtd/chips/cfi_cmdset_0002.c	21 Mar 2004 09:24:50 -0000	1.2
@@ -1035,8 +1035,12 @@ static inline int do_erase_oneblock(stru
 	cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
 	cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
 
-	cfi_write(map, CMD(0x30), adr);
-	
+#if defined(CONFIG_MTD_CFI_BLOCKERASE)
+	cfi_write(map, CMD(0x50), adr);
+#else
+ 	cfi_write(map, CMD(0x30), adr);
+#endif
+
 	timeo = jiffies + (HZ*20);
 
 	/* Wait for the end of programing/erasure by using the toggle method.
Index: linux-2.6.x/drivers/mtd/chips/jedec_probe.c
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.6.x/drivers/mtd/chips/jedec_probe.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -p -r1.1.1.1 -r1.2
--- linux-2.6.x/drivers/mtd/chips/jedec_probe.c	21 Mar 2004 02:55:02 -0000	1.1.1.1
+++ linux-2.6.x/drivers/mtd/chips/jedec_probe.c	21 Mar 2004 09:24:50 -0000	1.2
@@ -11,13 +11,11 @@
 #include <linux/init.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
-#include <linux/init.h>
 #include <asm/io.h>
 #include <asm/byteorder.h>
 #include <linux/errno.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
-#include <linux/init.h>
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
@@ -1089,6 +1087,28 @@ static const struct amd_flash_info jedec
 		.regions	= {
 			ERASEINFO(0x01000,128),
 		}
+	}, {
+		.mfr_id		= MANUFACTURER_SST,
+		.dev_id		= SST39LF160,
+		.name		= "SST 39LF/VF160",
+		.uaddr		= {
+			[0] = MTD_UADDR_0x5555_0x2AAA /* x8 */
+		},
+		.DevSize	= SIZE_2MiB,
+		.CmdSet		= P_ID_AMD_STD,
+#if CONFIG_MTD_CFI_BLOCKERASE
+		.NumEraseRegions= 1,
+		.regions	= {
+			ERASEINFO(0x10000,32)
+		}
+#else
+		.NumEraseRegions= 2,
+		/* Split into two regions to get around the 256-region restriction */
+		.regions	= {
+			ERASEINFO(0x01000,256),
+			ERASEINFO(0x01000,256),
+		}
+#endif
         }, {
 		.mfr_id		= MANUFACTURER_SST,
 		.dev_id		= SST39SF010A,
Index: linux-2.6.x/drivers/mtd/maps/Kconfig
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.6.x/drivers/mtd/maps/Kconfig,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -p -r1.1.1.1 -r1.2
--- linux-2.6.x/drivers/mtd/maps/Kconfig	21 Mar 2004 02:55:02 -0000	1.1.1.1
+++ linux-2.6.x/drivers/mtd/maps/Kconfig	21 Mar 2004 09:24:50 -0000	1.2
@@ -440,6 +440,15 @@ config MTD_FORTUNET
 	  This enables access to the Flash on the FortuNet board.  If you
 	  have such a board, say 'Y'.
 
+config MTD_M5272C3_JFFS2
+	tristate "CFI Flash device on Motorola M5272C3 for JFFS2 usage"
+	depends on M5272 && MTD_CFI
+	help
+	  This enables MTD access to CFI and JEDEC compatible flash devices
+	  on board designs derived from the Motorola M5272C3. The partition
+	  map is suitable for using a JFFS2 root filesystem and a bootloader
+	  such as CoLilo.
+
 config MTD_AUTCPU12
 	tristate "NV-RAM mapping AUTCPU12 board"
 	depends on ARM && ARCH_AUTCPU12
Index: linux-2.6.x/drivers/mtd/maps/Makefile
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.6.x/drivers/mtd/maps/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -p -r1.1.1.1 -r1.2
--- linux-2.6.x/drivers/mtd/maps/Makefile	21 Mar 2004 02:55:02 -0000	1.1.1.1
+++ linux-2.6.x/drivers/mtd/maps/Makefile	21 Mar 2004 09:24:50 -0000	1.2
@@ -52,6 +52,7 @@ obj-$(CONFIG_MTD_FORTUNET)	+= fortunet.o
 obj-$(CONFIG_MTD_REDWOOD)	+= redwood.o
 obj-$(CONFIG_MTD_UCLINUX)	+= uclinux.o
 obj-$(CONFIG_MTD_NETtel)	+= nettel.o
+obj-$(CONFIG_MTD_M5272C3_JFFS2)	+= m5272c3_jffs2.o
 obj-$(CONFIG_MTD_SNAPGEODE)	+= snapgeode.o
 obj-$(CONFIG_MTD_SE4000)	+= se4000.o
 obj-$(CONFIG_MTD_SCB2_FLASH)	+= scb2_flash.o
Index: linux-2.6.x/drivers/mtd/maps/m5272c3_jffs2.c
===================================================================
RCS file: linux-2.6.x/drivers/mtd/maps/m5272c3_jffs2.c
diff -N linux-2.6.x/drivers/mtd/maps/m5272c3_jffs2.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ linux-2.6.x/drivers/mtd/maps/m5272c3_jffs2.c	21 Mar 2004 09:24:50 -0000	1.1
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2003 Bernardo Innocenti <bernie@develer.com>
+ *
+ * Based on physmap.c by David Woodhouse <dwmw2@infradead.org>
+ * Based on m5272c3.c
+ *
+ * MTD partition map for M5272C3 and similar boards.
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/fs.h>
+#include <linux/major.h>
+#include <linux/root_dev.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/map.h>
+#include <linux/mtd/partitions.h>
+
+
+#define WINDOW_ADDR 0xffe00000
+#define WINDOW_SIZE 0x200000
+#define BUSWIDTH 2
+
+static struct mtd_info *mymtd;
+
+static struct map_info m5272c3_jffs2_map = {
+	.name = "M5272C3 flash device",
+	.size = WINDOW_SIZE,
+	.buswidth = BUSWIDTH,
+	.phys = WINDOW_ADDR
+};
+
+/*
+ * MTD 'PARTITIONING' STUFF 
+ */
+static struct mtd_partition m5272c3_jffs2_partitions[] = {
+	{
+		.name	= "boot (32K)",
+		.size	= 0x8000,
+		.offset	= 0
+	}, {
+		.name	= "kernel (480K)",
+		.size	= 0x78000,
+		.offset	= MTDPART_OFS_APPEND /* 0x8000 */
+	}, {
+		.name	= "rootfs (1536K)",
+		.size	= MTDPART_SIZ_FULL, /* 0x180000 */
+		.offset	= MTDPART_OFS_APPEND /* 0x80000 */
+	}
+};
+
+#define	NUM_PARTITIONS	(sizeof(m5272c3_jffs2_partitions) / sizeof(m5272c3_jffs2_partitions[0]))
+
+
+int __init init_m5272c3_jffs2(void)
+{
+	printk(KERN_NOTICE "m5272c3[mtd] flash device: %x at %x\n", WINDOW_SIZE, WINDOW_ADDR);
+	m5272c3_jffs2_map.virt = (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE);
+
+	if (!m5272c3_jffs2_map.virt) {
+		printk("Failed to ioremap\n");
+		return -EIO;
+	}
+
+	simple_map_init(&m5272c3_jffs2_map);
+
+	if (!(mymtd = do_map_probe("cfi_probe", &m5272c3_jffs2_map)))
+		mymtd = do_map_probe("jedec_probe", &m5272c3_jffs2_map);
+
+	if (mymtd) {
+		mymtd->owner = THIS_MODULE;
+
+		printk(KERN_NOTICE 
+		       "Using physmap partition definition\n");
+		add_mtd_partitions(mymtd, m5272c3_jffs2_partitions, NUM_PARTITIONS);
+
+		printk("m5272c3[mtd]: set '%s' to be root filesystem\n",
+		     	m5272c3_jffs2_partitions[2].name);
+		ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, 2);
+
+		return 0;
+	}
+
+	iounmap((void *)m5272c3_jffs2_map.virt);
+	return -ENXIO;
+}
+
+static void __exit cleanup_m5272c3_jffs2(void)
+{
+	if (mymtd) {
+		del_mtd_partitions(mymtd);
+		map_destroy(mymtd);
+	}
+	if (m5272c3_jffs2_map.virt) {
+		iounmap((void *)m5272c3_jffs2_map.virt);
+		m5272c3_jffs2_map.virt = 0;
+	}
+}
+
+module_init(init_m5272c3_jffs2);
+module_exit(cleanup_m5272c3_jffs2);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Bernardo Innocenti <bernie@develer>");
+MODULE_DESCRIPTION("Develer MTD map driver");
+
Index: linux-2.6.x/drivers/mtd/maps/physmap.c
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.6.x/drivers/mtd/maps/physmap.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -p -r1.1.1.1 -r1.2
--- linux-2.6.x/drivers/mtd/maps/physmap.c	21 Mar 2004 02:55:02 -0000	1.1.1.1
+++ linux-2.6.x/drivers/mtd/maps/physmap.c	21 Mar 2004 09:24:50 -0000	1.2
@@ -23,7 +23,7 @@ static struct mtd_info *mymtd;
 
 
 struct map_info physmap_map = {
-	.name = "Physically mapped flash",
+	.name = "physmap",
 	.size = WINDOW_SIZE,
 	.buswidth = BUSWIDTH,
 	.phys = WINDOW_ADDR,
Index: linux-2.6.x/include/asm-m68knommu/atomic.h
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.6.x/include/asm-m68knommu/atomic.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -p -r1.1.1.1 -r1.2
--- linux-2.6.x/include/asm-m68knommu/atomic.h	21 Mar 2004 02:55:26 -0000	1.1.1.1
+++ linux-2.6.x/include/asm-m68knommu/atomic.h	21 Mar 2004 09:24:50 -0000	1.2
@@ -56,12 +56,12 @@ static __inline__ void atomic_sub(int i,
 
 static __inline__ void atomic_inc(volatile atomic_t *v)
 {
-	__asm__ __volatile__("addql #1,%0" : "=m" (*v): "0" (*v));
+	__asm__ __volatile__("addql #1,%0" : "=m" (*v): "m" (*v));
 }
 
 static __inline__ void atomic_dec(volatile atomic_t *v)
 {
-	__asm__ __volatile__("subql #1,%0" : "=m" (*v): "0" (*v));
+	__asm__ __volatile__("subql #1,%0" : "=m" (*v): "m" (*v));
 }
 
 static __inline__ int atomic_dec_and_test(volatile atomic_t *v)
Index: linux-2.6.x/include/asm-m68knommu/system.h
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.6.x/include/asm-m68knommu/system.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -p -r1.1.1.1 -r1.2
--- linux-2.6.x/include/asm-m68knommu/system.h	21 Mar 2004 02:55:26 -0000	1.1.1.1
+++ linux-2.6.x/include/asm-m68knommu/system.h	21 Mar 2004 09:24:50 -0000	1.2
@@ -232,7 +232,9 @@ cmpxchg(volatile int *p, int old, int ne
 #endif
 
 #ifdef CONFIG_COLDFIRE
-#if defined(CONFIG_M5272) && defined(CONFIG_NETtel)
+#if defined(CONFIG_M5272)
+
+#if defined(CONFIG_NETtel)
 /*
  *	Need to account for broken early mask of 5272 silicon. So don't
  *	jump through the original start address. Jump strait into the
@@ -244,6 +246,15 @@ cmpxchg(volatile int *p, int old, int ne
         jmp 0xf0000400;			\
         ");				\
 })
+#elif defined(CONFIG_DEVELER_AMR) || defined(CONFIG_DEVELER_CDB4) || defined(CONFIG_DEVELER_SEAC)
+#define HARD_RESET_NOW() ({			\
+	asm(					\
+		"movew #0x2700, %sr\n\t"	\
+		"jmp 0xffe00400\n"		\
+	);					\
+})
+#endif /* CONFIG_NETtel || CONFIG_DEVELER */
+
 #elif defined(CONFIG_NETtel) || defined(CONFIG_eLIA) || defined(CONFIG_DISKtel) || defined(CONFIG_SECUREEDGEMP3) || defined(CONFIG_CLEOPATRA)
 #define HARD_RESET_NOW() ({		\
         asm("				\
Index: linux-2.6.x/include/linux/bio.h
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.6.x/include/linux/bio.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -p -r1.1.1.1 -r1.2
--- linux-2.6.x/include/linux/bio.h	21 Mar 2004 02:55:28 -0000	1.1.1.1
+++ linux-2.6.x/include/linux/bio.h	21 Mar 2004 09:24:50 -0000	1.2
@@ -231,13 +231,13 @@ extern void bio_put(struct bio *);
 
 extern void bio_endio(struct bio *, unsigned int, int);
 struct request_queue;
-extern inline int bio_phys_segments(struct request_queue *, struct bio *);
-extern inline int bio_hw_segments(struct request_queue *, struct bio *);
+extern int bio_phys_segments(struct request_queue *, struct bio *);
+extern int bio_hw_segments(struct request_queue *, struct bio *);
 
-extern inline void __bio_clone(struct bio *, struct bio *);
+extern void __bio_clone(struct bio *, struct bio *);
 extern struct bio *bio_clone(struct bio *, int);
 
-extern inline void bio_init(struct bio *);
+extern void bio_init(struct bio *);
 
 extern int bio_add_page(struct bio *, struct page *, unsigned int,unsigned int);
 extern int bio_get_nr_vecs(struct block_device *);
Index: linux-2.6.x/include/linux/elevator.h
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.6.x/include/linux/elevator.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -p -r1.1.1.1 -r1.2
--- linux-2.6.x/include/linux/elevator.h	21 Mar 2004 02:55:28 -0000	1.1.1.1
+++ linux-2.6.x/include/linux/elevator.h	21 Mar 2004 09:24:50 -0000	1.2
@@ -96,9 +96,9 @@ extern elevator_t iosched_as;
 
 extern int elevator_init(request_queue_t *, elevator_t *);
 extern void elevator_exit(request_queue_t *);
-extern inline int elv_rq_merge_ok(struct request *, struct bio *);
-extern inline int elv_try_merge(struct request *, struct bio *);
-extern inline int elv_try_last_merge(request_queue_t *, struct bio *);
+extern int elv_rq_merge_ok(struct request *, struct bio *);
+extern int elv_try_merge(struct request *, struct bio *);
+extern int elv_try_last_merge(request_queue_t *, struct bio *);
 
 /*
  * Return values from elevator merger
Index: linux-2.6.x/include/linux/sched.h
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.6.x/include/linux/sched.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -p -r1.1.1.1 -r1.2
--- linux-2.6.x/include/linux/sched.h	21 Mar 2004 02:55:29 -0000	1.1.1.1
+++ linux-2.6.x/include/linux/sched.h	21 Mar 2004 09:24:50 -0000	1.2
@@ -670,7 +670,7 @@ static inline int capable(int cap)
 extern struct mm_struct * mm_alloc(void);
 
 /* mmdrop drops the mm and the page tables */
-extern inline void FASTCALL(__mmdrop(struct mm_struct *));
+extern void FASTCALL(__mmdrop(struct mm_struct *));
 static inline void mmdrop(struct mm_struct * mm)
 {
 	if (atomic_dec_and_test(&mm->mm_count))
Index: linux-2.6.x/include/net/tcp.h
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.6.x/include/net/tcp.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -p -r1.1.1.1 -r1.2
--- linux-2.6.x/include/net/tcp.h	21 Mar 2004 02:55:29 -0000	1.1.1.1
+++ linux-2.6.x/include/net/tcp.h	21 Mar 2004 09:24:50 -0000	1.2
@@ -738,7 +738,7 @@ DECLARE_SNMP_STAT(struct tcp_mib, tcp_st
 #define TCP_ADD_STATS_BH(field, val)	SNMP_ADD_STATS_BH(tcp_statistics, field, val)
 #define TCP_ADD_STATS_USER(field, val)	SNMP_ADD_STATS_USER(tcp_statistics, field, val)
 
-extern inline void		tcp_put_port(struct sock *sk);
+extern void			tcp_put_port(struct sock *sk);
 extern void			tcp_inherit_port(struct sock *sk, struct sock *child);
 
 extern void			tcp_v4_err(struct sk_buff *skb, u32);
Index: linux-2.6.x/kernel/fork.c
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.6.x/kernel/fork.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -p -r1.1.1.1 -r1.2
--- linux-2.6.x/kernel/fork.c	21 Mar 2004 02:55:30 -0000	1.1.1.1
+++ linux-2.6.x/kernel/fork.c	21 Mar 2004 09:24:50 -0000	1.2
@@ -416,7 +416,7 @@ struct mm_struct * mm_alloc(void)
  * is dropped: either by a lazy thread or by
  * mmput. Free the page directory and the mm.
  */
-inline void __mmdrop(struct mm_struct *mm)
+void __mmdrop(struct mm_struct *mm)
 {
 	BUG_ON(mm == &init_mm);
 	mm_free_pgd(mm);
Index: linux-2.6.x/net/xfrm/Kconfig
===================================================================
RCS file: /cvs/uclinux/uclinux/linux-2.6.x/net/xfrm/Kconfig,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -p -r1.1.1.1 -r1.2
--- linux-2.6.x/net/xfrm/Kconfig	21 Mar 2004 02:55:32 -0000	1.1.1.1
+++ linux-2.6.x/net/xfrm/Kconfig	21 Mar 2004 09:24:50 -0000	1.2
@@ -2,7 +2,7 @@
 # XFRM configuration
 #
 config XFRM
-       bool
+       bool "Kick me"
        depends on NET
 
 config XFRM_USER
Index: tools/cksum.exe
===================================================================
RCS file: tools/cksum.exe
diff -N tools/cksum.exe
Binary files /tmp/cvs52W5QT and /dev/null differ
Index: tools/crypt.c
===================================================================
RCS file: tools/crypt.c
diff -N tools/crypt.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tools/crypt.c	26 Jan 2003 17:24:17 -0000	1.1
@@ -0,0 +1,61 @@
+/*
+   Copyright © 1995-2001, The AROS Development Team. All rights reserved.
+   $Id: crypt.c,v 1.1 2003/01/26 17:24:17 aleph Exp $
+
+Desc: Utility for crypt(3).
+Lang: english
+ */
+
+/*
+   This is the sourcecode for crypt. It is a small program which makes
+   it more convenient to create Unix passwords with crypt(3).
+
+   To compile:
+
+   cc crypt.c -o crypt
+
+   If you get an error during link which says that "crypt" is an
+   unknown symbol, try this:
+
+   cc crypt.c -o crypt -lcrypt
+
+   Then run this with your password as the first argument. If you
+   want to test if it really works, try it like this:
+
+   crypt test xx
+
+   which must print:
+
+   Encrypting test: xx1LtbDbOY4/E
+
+   If it prints something else, then your version of crypt(3) is not
+   compatible.
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+
+int main (int argc, char ** argv)
+{
+	char salt[3];
+	char * set = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./";
+
+	srand (time (NULL));
+
+	salt[0] = set[getpid() % sizeof(set)];
+	salt[1] = set[rand() % sizeof(set)];
+	salt[2] = 0;
+
+	if (argc > 2)
+	{
+		salt[0] = argv[2][0];
+		salt[1] = argv[2][1];
+	}
+
+	printf ("Encrypting %s: %s\n", argv[1], crypt (argv[1], salt));
+
+	return 0;
+}
+
Index: uClibc/Makefile
===================================================================
RCS file: /cvs/uclinux/uclinux/uClibc/Makefile,v
retrieving revision 1.1.1.8
retrieving revision 1.2
diff -u -p -r1.1.1.8 -r1.2
--- uClibc/Makefile	21 Mar 2004 02:56:14 -0000	1.1.1.8
+++ uClibc/Makefile	3 Jun 2004 06:24:52 -0000	1.2
@@ -69,7 +69,7 @@ lib/main.o: $(ROOTDIR)/lib/libc/main.c
 
 bogus $(SHARED_TARGET): lib/libc.a lib/main.o Makefile
 	make -C $(ROOTDIR) relink
-	$(CC) -nostartfiles -o $(SHARED_TARGET) $(ARCH_CFLAGS) -Wl,-elf2flt -nostdlib		\
+	$(CC) -nostartfiles -o $(SHARED_TARGET) $(ARCH_CFLAGS) -Wl,-elf2flt=-v -nostdlib		\
 		-Wl,-shared-lib-id,${LIBID}				\
 		lib/main.o \
 		-Wl,--whole-archive,lib/libc.a,-lgcc,--no-whole-archive
Index: uClibc/libc/sysdeps/linux/common/getdents.c
===================================================================
RCS file: /cvs/uclinux/uclinux/uClibc/libc/sysdeps/linux/common/getdents.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -p -r1.1.1.1 -r1.2
--- uClibc/libc/sysdeps/linux/common/getdents.c	28 Feb 2003 22:45:54 -0000	1.1.1.1
+++ uClibc/libc/sysdeps/linux/common/getdents.c	3 Mar 2003 18:19:27 -0000	1.2
@@ -28,6 +28,7 @@
 #include <sys/types.h>
 #include <sysdep.h>
 #include <sys/syscall.h>
+#include <linux/types.h>
 
 
 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
@@ -90,7 +91,9 @@ ssize_t __getdents (int fd, char *buf, s
 	dp->d_ino = kdp->d_ino;
 	dp->d_off = kdp->d_off;
 	dp->d_reclen = new_reclen;
+#ifdef __USE_FILE_OFFSET64
 	dp->d_type = DT_UNKNOWN;
+#endif
 	memcpy (dp->d_name, kdp->d_name,
 		kdp->d_reclen - offsetof (struct kernel_dirent, d_name));
 	dp = (struct dirent *) ((char *) dp + new_reclen);
Index: uClibc/libc/sysdeps/linux/common/bits/in.h
===================================================================
RCS file: /cvs/uclinux/uclinux/uClibc/libc/sysdeps/linux/common/bits/in.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -p -r1.1.1.1 -r1.2
--- uClibc/libc/sysdeps/linux/common/bits/in.h	14 Apr 2002 14:58:34 -0000	1.1.1.1
+++ uClibc/libc/sysdeps/linux/common/bits/in.h	25 Jul 2003 03:46:45 -0000	1.2
@@ -66,7 +66,7 @@
 struct ip_opts
   {
     struct in_addr ip_dst;	/* First hop; zero without source route.  */
-    char ip_opts[40];		/* Actually variable in size.  */
+    char _ip_opts[40];		/* Actually variable in size.  */
   };
 
 /* Structure used for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP. */
Index: user/busybox/Config.h
===================================================================
RCS file: /cvs/uclinux/uclinux/user/busybox/Config.h,v
retrieving revision 1.1.1.5
retrieving revision 1.15
diff -u -p -r1.1.1.5 -r1.15
--- user/busybox/Config.h	28 Jan 2003 18:02:13 -0000	1.1.1.5
+++ user/busybox/Config.h	19 Jun 2003 14:58:09 -0000	1.15
@@ -9,88 +9,87 @@
 // BusyBox Applications
 //#define BB_ADJTIMEX
 //#define BB_AR
-#define BB_ASH
-#define BB_BASENAME
+//#define BB_ASH
+//#define BB_BASENAME
 #define BB_CAT
-#define BB_CHGRP
+//#define BB_CHGRP
 #define BB_CHMOD
-#define BB_CHOWN
-#define BB_CHROOT
-#define BB_CHVT
-#define BB_CLEAR
+//#define BB_CHOWN
+//#define BB_CHROOT
+//#define BB_CHVT
+//#define BB_CLEAR
 //#define BB_CMP
 #define BB_CP
 //#define BB_CPIO
-#define BB_CUT
+//#define BB_CUT
 #define BB_DATE
 //#define BB_DC
-#define BB_DD
+//#define BB_DD
 //#define BB_DEALLOCVT
 #define BB_DF
-#define BB_DIRNAME
-#define BB_DMESG
+//#define BB_DIRNAME
+//#define BB_DMESG
 //#define BB_DOS2UNIX
 //#define BB_DPKG
 //#define BB_DPKG_DEB
 //#define BB_DUTMP
-#define BB_DU
+//#define BB_DU
 //#define BB_DUMPKMAP
 #define BB_ECHO
-#define BB_ENV
+//#define BB_ENV
 //#define BB_EXPR
 //#define BB_FBSET
 //#define BB_FDFLUSH
-#define BB_FIND
-#define BB_FREE
+//#define BB_FIND
+//#define BB_FREE
 //#define BB_FREERAMDISK
 //#define BB_FSCK_MINIX
 //#define BB_GETOPT
-#define BB_GREP
-#define BB_GUNZIP
-#define BB_GZIP
-#define BB_HALT
-#define BB_HEAD
+//#define BB_GREP
+//#define BB_GUNZIP
+//#define BB_GZIP
+//#define BB_HALT
+//#define BB_HEAD
 //#define BB_HOSTID
-//#define BB_HOSTNAME
+#define BB_HOSTNAME
 //#define BB_HUSH
-#define BB_ID
-//#define BB_IFCONFIG
-#define BB_INIT
+//#define BB_ID
+#define BB_IFCONFIG
+//#define BB_INIT
 //#define BB_INSMOD
 #define BB_KILL
 #define BB_KILLALL
-#define BB_KLOGD
+//#define BB_KLOGD
 //#define BB_LASH
 //#define BB_LENGTH
 #define BB_LN
 //#define BB_LOADACM
 //#define BB_LOADFONT
 //#define BB_LOADKMAP
-#define BB_LOGGER
+//#define BB_LOGGER
 //#define BB_LOGNAME
-//#define BB_LOSETUP
 #define BB_LS
-#define BB_LSMOD
+//#define BB_LSMOD
 //#define BB_MAKEDEVS
 //#define BB_MD5SUM
 #define BB_MKDIR
 //#define BB_MKFIFO
 //#define BB_MKFS_MINIX
-#define BB_MKNOD
-#define BB_MKSWAP
+//#define BB_MKNOD
+//#define BB_MKSWAP
 //#define BB_MKTEMP
-#define BB_MODPROBE
-#define BB_MORE
+//#define BB_MODPROBE
+//#define BB_MORE
 #define BB_MOUNT
 //#define BB_MSH
 //#define BB_MT
 #define BB_MV
 //#define BB_NC
 //#define BB_NSLOOKUP
-#define BB_PIDOF
-//#define BB_PING
+//#define BB_PIDOF
+#define BB_PING
 //#define BB_PIVOT_ROOT
-#define BB_POWEROFF
+//#define BB_POWEROFF
 //#define BB_PRINTF
 #define BB_PS
 #define BB_PWD
@@ -98,50 +97,48 @@
 //#define BB_READLINK
 #define BB_REBOOT
 //#define BB_RENICE
-#define BB_RESET
+//#define BB_RESET
 #define BB_RM
 #define BB_RMDIR
 //#define BB_RMMOD
-//#define BB_ROUTE
+#define BB_ROUTE
 //#define BB_RPM2CPIO
-#define BB_SED
+//#define BB_SED
 //#define BB_SETKEYCODES
 #define BB_SLEEP
-#define BB_SORT
+//#define BB_SORT
 //#define BB_STTY
-#define BB_SWAPONOFF
-#define BB_SYNC
+//#define BB_SWAPONOFF
+//#define BB_SYNC
 #define BB_SYSLOGD
-#define BB_TAIL
-#define BB_TAR
+//#define BB_TAIL
+//#define BB_TAR
 //#define BB_TEE
-//#define BB_TEST
+#define BB_TEST
 //#define BB_TELNET
 //#define BB_TFTP
-//#define BB_TIME
-//#define BB_TOP
 #define BB_TOUCH
 //#define BB_TR
 //#define BB_TRACEROUTE
-#define BB_TRUE_FALSE
-#define BB_TTY
+//#define BB_TRUE_FALSE
+//#define BB_TTY
 //#define BB_UNIX2DOS
 //#define BB_UUENCODE
 //#define BB_UUDECODE
-#define BB_UMOUNT
-#define BB_UNIQ
-#define BB_UNAME
+//#define BB_UMOUNT
+//#define BB_UNIQ
+//#define BB_UNAME
 //#define BB_UPDATE
 #define BB_UPTIME
 //#define BB_USLEEP
-//#define BB_VI
+#define BB_VI
 //#define BB_WATCHDOG
-#define BB_WC
+//#define BB_WC
 //#define BB_WGET
-#define BB_WHICH
-#define BB_WHOAMI
-#define BB_XARGS
-#define BB_YES
+//#define BB_WHICH
+//#define BB_WHOAMI
+//#define BB_XARGS
+//#define BB_YES
 // End of Applications List
 //
 //
@@ -154,7 +151,7 @@
 //
 // If you enabled one or more of the shells, you may select which one
 // should be run when sh is invoked:
-#define BB_FEATURE_SH_IS_ASH
+//#define BB_FEATURE_SH_IS_ASH
 //#define BB_FEATURE_SH_IS_HUSH
 //#define BB_FEATURE_SH_IS_LASH
 //#define BB_FEATURE_SH_IS_MSH
@@ -182,43 +179,40 @@
 //#define BB_FEATURE_USE_DEVPS_PATCH
 //
 // show verbose usage messages
-#define BB_FEATURE_VERBOSE_USAGE
+//#define BB_FEATURE_VERBOSE_USAGE
 //
 // Use termios to manipulate the screen ('more' is prettier with this on)
 //#define BB_FEATURE_USE_TERMIOS
 //
-// calculate terminal & column widths (for more, ls, and telnet)
-#define BB_FEATURE_AUTOWIDTH
+// calculate terminal & column widths (for more and ls)
+//#define BB_FEATURE_AUTOWIDTH
 //
 // show username/groupnames for ls
-#define BB_FEATURE_LS_USERNAME
+//#define BB_FEATURE_LS_USERNAME
 //
 // show file timestamps in ls
 #define BB_FEATURE_LS_TIMESTAMPS
 //
 // enable ls -p and -F
-#define BB_FEATURE_LS_FILETYPES
+//#define BB_FEATURE_LS_FILETYPES
 //
 // sort the file names
-#define BB_FEATURE_LS_SORTFILES
+//#define BB_FEATURE_LS_SORTFILES
 //
 // enable ls -R
-#define BB_FEATURE_LS_RECURSIVE
+//#define BB_FEATURE_LS_RECURSIVE
 //
 // enable ls -L
-#define BB_FEATURE_LS_FOLLOWLINKS
-//
-// Use color to identify different file types
-#define BB_FEATURE_LS_COLOR
+//#define BB_FEATURE_LS_FOLLOWLINKS
 //
 // Disable for a smaller (but less functional) ping
-#define BB_FEATURE_FANCY_PING
+//#define BB_FEATURE_FANCY_PING
 //
 // Make init use a simplified /etc/inittab file (recommended).
-#define BB_FEATURE_USE_INITTAB
+//#define BB_FEATURE_USE_INITTAB
 //
 //Enable init being called as /linuxrc
-#define BB_FEATURE_LINUXRC
+//#define BB_FEATURE_LINUXRC
 //
 //Have init enable core dumping for child processes (for debugging only) 
 //#define BB_FEATURE_INIT_COREDUMPS
@@ -227,17 +221,17 @@
 //#define BB_FEATURE_EXTRA_QUIET
 //
 // enable syslogd -R remotehost
-#define BB_FEATURE_REMOTE_LOG
+//#define BB_FEATURE_REMOTE_LOG
 //
 // enable syslogd -C
 //#define BB_FEATURE_IPC_SYSLOG
 //
 //Disable for a simple tail implementation (2.34k vs 3k for the full one).
 //Both provide 'tail -f', but this cuts out -c, -q, -s, and -v. 
-#define BB_FEATURE_FANCY_TAIL
+//#define BB_FEATURE_FANCY_TAIL
 //
 // Enable support for loop devices in mount
-#define BB_FEATURE_MOUNT_LOOP
+//#define BB_FEATURE_MOUNT_LOOP
 //
 // Enable support for a real /etc/mtab file instead of /proc/mounts
 //#define BB_FEATURE_MTAB_SUPPORT
@@ -245,37 +239,34 @@
 // Enable support for mounting remote NFS volumes. 
 // You may need to mount with "-o nolock" if you are
 // not running a local portmapper daemon...
-//
-// If you are using uClibc, be sure that you've already compiled
-// uClibc with INCLUDE_RPC=true (contained in the Config file)
 //#define BB_FEATURE_NFSMOUNT
 //
 // Enable support forced filesystem unmounting 
 // (i.e., in case of an unreachable NFS system).
-#define BB_FEATURE_MOUNT_FORCE
+//#define BB_FEATURE_MOUNT_FORCE
 //
 // Enable support for creation of tar files.
-#define BB_FEATURE_TAR_CREATE
+//#define BB_FEATURE_TAR_CREATE
 //
 // Enable support for "--exclude" and "-X" for excluding files
-#define BB_FEATURE_TAR_EXCLUDE
+//#define BB_FEATURE_TAR_EXCLUDE
 //
 // Enable support for tar -z option (currently only works for inflating)
-#define BB_FEATURE_TAR_GZIP 
+//#define BB_FEATURE_TAR_GZIP
 //
 // Enable reverse sort
-#define BB_FEATURE_SORT_REVERSE
+//#define BB_FEATURE_SORT_REVERSE
 //
 // Enable uniqe sort
-#define BB_FEATURE_SORT_UNIQUE
+//#define BB_FEATURE_SORT_UNIQUE
 //
 // Enable command line editing in the shell.  
 // Only relevant if a shell is enabled. On by default.
-#define BB_FEATURE_COMMAND_EDITING
+//#define BB_FEATURE_COMMAND_EDITING
 //
 // Enable tab completion in the shell.  This is now working quite nicely.
 // This feature adds a bit over 4k. Only relevant if a shell is enabled.
-#define BB_FEATURE_COMMAND_TAB_COMPLETION
+//#define BB_FEATURE_COMMAND_TAB_COMPLETION
 //
 // Attempts to match usernames in a ~-prefixed path
 //#define BB_FEATURE_COMMAND_USERNAME_COMPLETION
@@ -301,13 +292,6 @@
 // Only relevant if a shell is enabled.
 //#define BB_FEATURE_SH_FANCY_PROMPT
 //
-// Uncomment this option to disable job control.  Job control lets you 
-// run jobs in the background (which completely useless for is all you 
-// are doing is running scripts).  Disabing this is bad for interactive
-// use, since when you hit ^C in an application, it will also kill the 
-// shell.  This adds about 2.5k on an x86 system.
-#define BB_FEATURE_ASH_JOB_CONTROL
-//
 //Turn on extra fbset options
 //#define BB_FEATURE_FBSET_FANCY
 //
@@ -315,7 +299,7 @@
 //#define BB_FEATURE_FBSET_READMODE
 //
 // Support insmod/lsmod/rmmod for post 2.1 kernels
-#define BB_FEATURE_NEW_MODULE_INTERFACE
+//#define BB_FEATURE_NEW_MODULE_INTERFACE
 //
 // Support insmod/lsmod/rmmod for pre 2.1 kernels
 //#define BB_FEATURE_OLD_MODULE_INTERFACE
@@ -332,7 +316,7 @@
 // Support for Minix filesystem, version 2
 //#define BB_FEATURE_MINIX2
 //
-// Enable ifconfig status reporting output -- this feature adds 7k.
+// Enable ifconfig status reporting output -- this feature adds 12k.
 //#define BB_FEATURE_IFCONFIG_STATUS
 //
 // Enable ifconfig slip-specific options "keepalive" and "outfill"
@@ -344,20 +328,16 @@
 // Enable ifconfig option "hw".  Currently works for only with "ether".
 //#define BB_FEATURE_IFCONFIG_HW
 //
-// Allows "broadcast +" to set broadcast automatically based on hostaddr
-// and netmask, at a cost of about 100 bytes of code (i386).
-//#define BB_FEATURE_IFCONFIG_BROADCAST_PLUS
-//
 // Enable busybox --install [-s]
 // to create links (or symlinks) for all the commands that are 
 // compiled into the binary.  (needs /proc filesystem)
 //#define BB_FEATURE_INSTALLER
 //
 // Enable a nifty progress meter in wget (adds just under 2k)
-#define BB_FEATURE_WGET_STATUSBAR
+//#define BB_FEATURE_WGET_STATUSBAR
 //
 // Enable HTTP authentication in wget
-#define BB_FEATURE_WGET_AUTHENTICATION
+//#define BB_FEATURE_WGET_AUTHENTICATION
 //
 // Clean up all memory before exiting -- usually not needed
 // as the OS can clean up...  Don't enable this unless you
@@ -365,19 +345,16 @@
 //#define BB_FEATURE_CLEAN_UP
 //
 // Support for human readable output by ls, du, etc.(example 13k, 23M, 235G)
-#define BB_FEATURE_HUMAN_READABLE
+//#define BB_FEATURE_HUMAN_READABLE
 //
 // Support for the find -type option.
-#define BB_FEATURE_FIND_TYPE
+//#define BB_FEATURE_FIND_TYPE
 //
 // Support for the find -perm option.
-#define BB_FEATURE_FIND_PERM
+//#define BB_FEATURE_FIND_PERM
 //
-// Support for the find -mtime option.
-#define BB_FEATURE_FIND_MTIME
-//
-//// Support for the find -newer option.
-#define BB_FEATURE_FIND_NEWER
+// Support for the find -mtine option.
+//#define BB_FEATURE_FIND_MTIME
 //
 // Support for the -A -B and -C context flags in grep
 //#define BB_FEATURE_GREP_CONTEXT
@@ -386,25 +363,25 @@
 //#define BB_FEATURE_GREP_EGREP_ALIAS
 //
 // Tell tftp what commands that should be supported.
-#define BB_FEATURE_TFTP_PUT
-#define BB_FEATURE_TFTP_GET
+//#define BB_FEATURE_TFTP_PUT
+//#define BB_FEATURE_TFTP_GET
 //
 // features for vi
-#define BB_FEATURE_VI_COLON		// ":" colon commands, no "ex" mode
-#define BB_FEATURE_VI_YANKMARK		// Yank/Put commands and Mark cmds
-#define BB_FEATURE_VI_SEARCH		// search and replace cmds
-#define BB_FEATURE_VI_USE_SIGNALS	// catch signals
-#define BB_FEATURE_VI_DOT_CMD		// remember previous cmd and "." cmd
-#define BB_FEATURE_VI_READONLY		// vi -R and "view" mode
-#define BB_FEATURE_VI_SETOPTS		// set-able options,  ai ic showmatch
-#define BB_FEATURE_VI_SET		// :set
-#define BB_FEATURE_VI_WIN_RESIZE	// handle window resize
+#define BB_FEATURE_VI_COLON // ":" colon commands, no "ex" mode
+#define BB_FEATURE_VI_YANKMARK // Yank/Put commands and Mark cmds
+//#define BB_FEATURE_VI_SEARCH // search and replace cmds
+//#define BB_FEATURE_VI_USE_SIGNALS // catch signals
+//#define BB_FEATURE_VI_DOT_CMD // remember previous cmd and "." cmd
+//#define BB_FEATURE_VI_READONLY // vi -R and "view" mode
+//#define BB_FEATURE_VI_SETOPTS // set-able options, ai ic showmatch
+//#define BB_FEATURE_VI_SET // :set
+//#define BB_FEATURE_VI_WIN_RESIZE // handle window resize
 //
 // Enable a if you system have setuped locale
 //#define BB_LOCALE_SUPPORT
 //
 // Support for TELNET to pass TERM type to remote host.  Adds 384 bytes.
-#define BB_FEATURE_TELNET_TTYPE
+//#define BB_FEATURE_TELNET_TTYPE
 //
 // Support for devfs.
 //#define BB_FEATURE_DEVFS
@@ -421,10 +398,13 @@
 // mere mortals so leave this stuff alone.
 //
 #include <features.h>
-#if defined(__uClinux__)
-	#undef BB_ASH			/* Not even a chance it will work */
+#if defined __UCLIBC__ && ! defined __UCLIBC_HAS_MMU__
 	#undef BB_RPM2CPIO		/* Uses gz_open(), which uses fork() */
 	#undef BB_DPKG_DEB		/* Uses gz_open(), which uses fork() */
+	#undef BB_ASH			/* Uses fork() */
+	#undef BB_HUSH			/* Uses fork() */
+	#undef BB_LASH			/* Uses fork() */
+	#undef BB_INIT			/* Uses fork() */
 	#undef BB_FEATURE_TAR_GZIP	/* Uses fork() */
 	#undef BB_UPDATE		/* Uses daemon() */
 #endif
@@ -443,10 +423,6 @@
 	#undef BB_FEATURE_SH_FANCY_PROMPT
 #endif
 //
-#if (defined BB_ASH || defined BB_HUSH || defined BB_MSH) && ! defined BB_TEST
-	#define BB_TEST
-#endif
-//
 #ifdef BB_KILLALL
 	#ifndef BB_KILL
 		#define BB_KILL
@@ -484,11 +460,15 @@
 #endif
 //
 #if defined BB_ASH && defined BB_FEATURE_SH_IS_ASH
+# define BB_SH
 # define shell_main ash_main
 #elif defined BB_HUSH && defined BB_FEATURE_SH_IS_HUSH
+# define BB_SH
 # define shell_main hush_main
 #elif defined BB_LASH && defined BB_FEATURE_SH_IS_LASH
+# define BB_SH
 # define shell_main lash_main
 #elif defined BB_MSH && defined BB_FEATURE_SH_IS_MSH
+# define BB_SH
 # define shell_main msh_main
 #endif
Index: user/busybox/Makefile
===================================================================
RCS file: /cvs/uclinux/uclinux/user/busybox/Makefile,v
retrieving revision 1.1.1.6
retrieving revision 1.5
diff -u -p -r1.1.1.6 -r1.5
--- user/busybox/Makefile	21 Mar 2004 02:57:01 -0000	1.1.1.6
+++ user/busybox/Makefile	21 Mar 2004 04:43:00 -0000	1.5
@@ -90,7 +90,9 @@ AR = $(CROSS)ar
 STRIP = $(CROSS)strip
 endif
 
-FLTFLAGS += -s 20000
+#bernie: reduce stack size to 8KB (hopefully sufficient)
+#FLTFLAGS += -s 20000
+FLTFLAGS += -s 16000
 
 # Becuase Config.h is always imported as part of Busybox, we set it
 # up so that we can use a copy of it that gets modified
Index: user/busybox/install-romfs.sh
===================================================================
RCS file: /cvs/uclinux/uclinux/user/busybox/install-romfs.sh,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -p -r1.1.1.1 -r1.2
--- user/busybox/install-romfs.sh	22 Jan 2002 00:33:09 -0000	1.1.1.1
+++ user/busybox/install-romfs.sh	25 Apr 2002 18:32:21 -0000	1.2
@@ -20,7 +20,7 @@ for i in $h ; do
 	if [ \! -f $prefix$app ]
 	then
 		echo "  $prefix$app -> $bb_path"
-		if [ "$CONFIG_JFFS_FS" = "" ]; then
+		if [ "$CONFIG_JFFS_FS" = "" ] && [ "$CONFIG_JFFS2_FS" = "" ]; then
 			ln $bb_path $prefix$app || exit 1
 		else
 			ln -s busybox $prefix$app || exit 1
Index: user/cron/cron-parent.c
===================================================================
RCS file: /cvs/uclinux/uclinux/user/cron/cron-parent.c,v
retrieving revision 1.1.1.2
retrieving revision 1.3
diff -u -p -r1.1.1.2 -r1.3
--- user/cron/cron-parent.c	16 May 2003 01:10:32 -0000	1.1.1.2
+++ user/cron/cron-parent.c	16 May 2003 17:05:55 -0000	1.3
@@ -17,6 +17,10 @@
 #include <string.h>
 #include <syslog.h>
 
+#ifndef OPEN_MAX
+#define OPEN_MAX 64
+#endif
+
 #if 0
 /* Defining this symbol turns off the closing of *all* FDs prior to execution.
  * Stderr will be cloned to the FD mentioned in this #define and that FD will
Index: user/cron/cron.c
===================================================================
RCS file: /cvs/uclinux/uclinux/user/cron/cron.c,v
retrieving revision 1.1.1.4
retrieving revision 1.5
diff -u -p -r1.1.1.4 -r1.5
--- user/cron/cron.c	16 May 2003 01:10:32 -0000	1.1.1.4
+++ user/cron/cron.c	16 May 2003 17:05:55 -0000	1.5
@@ -489,6 +489,9 @@ failed:
 
 /* This routine runs along the task list and executes any job that wants
  * to be run.
+ *
+ * NOTE: check_runs() must not be inlined because vfork() seems to
+ * corrupt variables in main() when gcc inlines this function.
  */
 static void check_runs(struct tm *now)
 {
Index: user/gettyd/gettyd.c
===================================================================
RCS file: /cvs/uclinux/uclinux/user/gettyd/gettyd.c,v
retrieving revision 1.1.1.5
retrieving revision 1.9
diff -u -p -r1.1.1.5 -r1.9
--- user/gettyd/gettyd.c	28 Feb 2003 22:46:20 -0000	1.1.1.5
+++ user/gettyd/gettyd.c	3 Mar 2003 18:19:27 -0000	1.9
@@ -15,10 +15,14 @@
 #include <unistd.h>
 #include <string.h>
 #include <syslog.h>
+#include <limits.h>
+#include <stdlib.h>
 #include <signal.h>
 #include <sys/types.h>
+#include <sys/stat.h>
 #include <sys/termios.h>
 #include <sys/wait.h>
+#include <sys/ioctl.h>
 
 #include "gettyd.h"
 
@@ -30,17 +34,22 @@
 #define	PPPD		"/usr/sbin/pppd"
 #endif
 
+#define LOCK_PREFIX	"/var/lock/LCK.."	/* Prefix to lock files    */
+#define TTYFD		10			/* FD to use for device    */
+
+
+
 /*****************************************************************************/
 
-void usage(int rc)
+static inline int usage(int rc)
 {
-	printf("usage: gettyd <device> [<device>...]\n");
-	exit(rc);
+	printf("usage: gettyd <device>\n");
+	return rc;
 }
 
 /*****************************************************************************/
 
-int creatpidfile()
+static inline int creatpidfile()
 {
 	FILE	*f;
 	pid_t	pid;
@@ -49,6 +58,7 @@ int creatpidfile()
 	pid = getpid();
 	if ((f = fopen(pidfile, "w")) == NULL) {
 		/* Oh well... */
+		syslog(LOG_ERR, "error creating pid file: %s", strerror(errno));
 		return(-1);
 	}
 	fprintf(f, "%d\n", pid);
@@ -56,45 +66,222 @@ int creatpidfile()
 	return(0);
 }
 
+
 /*****************************************************************************/
 
+/* used only by init_serial and close_serial, to save
+ * and set at exit the status of ttySx */
+static struct termios oldtio;
+
 /*
- *	Spawn all those lines that are not running.
+ * INIT_SERIAL
+ *
+ * Inizializza e apre la porta seriale
+ * Viene aperta inizialmente in modo asincrono, altrimenti
+ * la open si blocca aspettando qualche segnale sulla
+ * seriale. Dopo aver impostato il modo CREAD viene
+ * rimessa in modo sincrono.
  */
 
-void spawn(struct line *lines)
+int init_serial(char *tty)
 {
-	char	*sp, *bp;
-	pid_t	pid;
-	int	i;
+	int fd, val;
+	struct termios newtio;
 
-	for (i = 0; (lines[i].device != NULL); i++) {
-		if (lines[i].pid != 0)
-			continue;
-
-		/* Find base device name */
-		if (lines[i].device[0] == '/') {
-			for (bp = sp = lines[i].device; (bp != NULL); ) {
-				sp = bp + 1;
-				bp = strchr(sp, '/');
-			}
-		}
+	if ( (fd = open(tty, O_RDWR | O_NOCTTY | O_NONBLOCK)) < 0 )
+		return -1;
+
+	tcgetattr(fd, &oldtio);
+	memset(&newtio, 0, sizeof(newtio));
+
+	//	CS8     : 8n1 (8bit,no parity,1 stopbit)
+	//	CREAD   : enable receiving characters
+	newtio.c_cflag = B19200 | CS8 | CREAD; // FIXME
+
+	//	IGNPAR  : ignore bytes with parity errors
+	newtio.c_iflag = IGNPAR;
+
+	newtio.c_cc[VTIME] = 6;  // six seconds read timeout
+	newtio.c_cc[VMIN] = 0;
+
+	// now clean the modem line and activate the settings for the port
+	tcflush(fd, TCIFLUSH);
+	tcsetattr(fd, TCSANOW, &newtio);
+
+	// reset blocking i/o mode
+	val = fcntl(fd, F_GETFL, 0);
+	val &= ~O_NONBLOCK;
+	if (fcntl(fd, F_SETFL, val) < 0)
+		return -1;
+
+	return fd;
+}
+
+
+/*****************************************************************************/
+/* 
+ * returns: 0, dev is locked by someone, lock file already present
+ *          1, ok!
+ *         -1, malloc error
+ *         -2, could'nt remove stale lock file
+ *         -3, vfork failed, child not executed
+ */
+
+int exec_child(char *dev, char *child, char *av[])
+{
+	extern char	**environ;
+	int fd, n;
+	pid_t pid;
+	char buf[12];
+	const char	 *p;
+	char		 *lock_file;
+
+	/* Determine the lock file name */
+	p = strrchr(dev, '/');
+	if (p == NULL)
+		p = dev;
+	else
+		p++;
+
+	lock_file = malloc(sizeof(LOCK_PREFIX) + strlen(p));
+	if (lock_file == NULL)
+		return -1;
+
+	strcpy(lock_file, LOCK_PREFIX);
+	strcpy(lock_file + sizeof(LOCK_PREFIX)-1, p);
+
+	/* Create the lock file now */
+	for (;;) {
+		fd = open(lock_file, O_EXCL | O_CREAT | O_RDWR, 0644);
+		if (fd >= 0)
+			break;
+
+		if (errno != EEXIST)
+			return 0;
+		/* Check if the lock file is stale */
+		fd = open(lock_file, O_RDONLY, 0);
+		if (fd < 0)
+			return 0;
+		n = read(fd, buf, 11);
+		close(fd);
+		if (n <= 0)
+			return 0;
+		buf[n] = '\0';
+		pid = atoi(buf);
+		/* if process exists we cannot unlink the lock file */
+		if (kill(pid, 0) != -1 || errno != ESRCH)
+			return 0;
+
+		if (unlink(lock_file) != 0)
+			return -2; /* stale file not removed! */
+		syslog(LOG_NOTICE, "Removed stale lock on %s (pid %d)", dev, pid);
+	}
+
+	/* exec the child */
+	if ((pid = vfork()) == 0) {
+		close(fd);
+		/* stdin & out to dev */
+		dup2(TTYFD, 0);
+		dup2(TTYFD, 1);
+		close(TTYFD);
+		execve(child, av, environ);
+		syslog(LOG_ERR, "execve failed: %s", strerror(errno));
+		_exit(0);
+	}
+	/* Write child's pid to lock file */
+	if (pid > 0) {
+		sprintf(buf, "%10d\n", pid);
+		write(fd, buf, strlen(buf) * sizeof(char));
+	}
+	close(fd);
+	/* Wait for the ppp process to finish */
+	if (pid > 0) {
+		wait(NULL);
+	} else {
+		syslog(LOG_ERR, "vfork()=%d failed: %s", pid, strerror(errno));
+		unlink(lock_file);
+		return -3;
+	}
+	unlink(lock_file);
+
+	return 1;
+}
 
-		pid = vfork();
-		if (pid < 0) {
-			syslog(LOG_ERR, "vfork()=%d failed!  errno=%d",
-				pid, errno);
-			return;
+/*****************************************************************************/
+
+/*
+ *	This is the magic child process body.
+ *	Its purpose is to busily await for a carrier detect for
+ *	the specified device and to then invoke pppd.
+ */
+
+static inline int guard_dev(const char *device) {
+	int fd, rc;
+	char *av[5];
+
+	if (device == NULL)
+		return 0177;
+
+	/* Move to the device directory.  Saves prepending /dev to the string */
+	if (chdir("/dev") < 0) {
+		syslog(LOG_ERR, "couldn't chdir into /dev: %s", strerror(errno));
+		return 0177;
+	}
+
+	fd = open(device, O_NOCTTY | O_NDELAY | O_ACCMODE);	/* No access requested or needed */
+	// fd = init_serial((char *)device);
+	if (fd != -1) {
+		int stale_fail;
+
+		/* Push the file descriptor up high */
+		if (fd != TTYFD) {
+			dup2(fd, TTYFD);
+			close(fd);
 		}
-		if (pid == 0) {
-			execl(PPPD, PPPD, lines[i].device, (char *) 0);
-			/* Exec() failed...!! */
-			exit(errno);
+
+		/* The main waiting loop */
+		for (stale_fail = 0;; sleep(1)) {
+			int status;
+
+			/* Check for carrier */
+			if (-1 == ioctl(TTYFD, TIOCMGET, &status)) {
+				/* syslog(LOG_WARNING, "FIXME - ioctl error: %s", strerror(errno)); */
+				return 0177;
+			}
+			if (!(TIOCM_CAR & status)) {
+				stale_fail = 0;
+				continue;
+			}
+
+			av[0] = PPPD;
+			av[1] = (char *)device;
+			av[2] = "file";
+#ifdef CONFIG_USER_FLATFSD_FLATFSD
+			av[3] = "/etc/config/options.dialin";
+#else
+			av[3] = "/etc/ppp/options.dialin";
+#endif
+			av[4] = NULL;
+			rc = exec_child((char *)device, PPPD, av);
+
+			if (rc == -2) {
+				if (!stale_fail)
+					syslog(LOG_WARNING, "Couldn't remove stale lock on %s", device);
+				stale_fail = 1;
+			}
+			else if (rc == -1) {
+				syslog(LOG_ERR, "malloc: %s", strerror(errno));
+				return 0177;  /* malloc error */
+			}
+
+			/* ignore other errors... */
 		}
-		lines[i].pid = pid;
+
 	}
+	return 0177;
 }
 
+
 /*****************************************************************************/
 
 static int gotterm;
@@ -108,52 +295,19 @@ void term_handler(int signum)
 
 int main(int argc, char *argv[])
 {
-	struct line	dialin[16];
-	pid_t		pid;
-	int		i, nrdevs, status;
-	struct		sigaction sa;
-
-	if ((argc <= 1) || (argc > (sizeof(dialin) / sizeof(struct line))))
+	if (argc != 2)
 		usage(1);
-
-	memset(&dialin, 0, sizeof(dialin));
-
+		
 	openlog("gettyd", 0, 0);
-	for (i = 0, nrdevs = argc - 1; (i < nrdevs); i++) {
-		dialin[i].device = argv[i+1];
-		syslog(LOG_INFO, "setting up dialin on %s", dialin[i].device);
-	}
 
 	/* Disconnect from the real world */
 	setpgrp();
 	close(2);
 	close(1);
 	close(0);
-	creatpidfile();
-
-	memset(&sa, 0, sizeof(sa));
-	sa.sa_handler = term_handler;
-	sigaction(SIGTERM, &sa, NULL);
+	if (creatpidfile() < 0)
+		exit(1);
 
-	for (;;) {
-		spawn(&dialin[0]);
-		sleep(1);
-
-		status = 0;
-		if ((pid = wait(&status)) < 0 || gotterm) {
-			for (i = 0; (i < nrdevs); i++)
-				if (dialin[i].pid != 0)
-					kill(dialin[i].pid, SIGTERM);
-			exit(1);
-		}
-
-		for (i = 0; (i < nrdevs); i++) {
-			if (dialin[i].pid == pid) {
-				dialin[i].pid = 0;
-				break;
-			}
-		}
-	}
+	return guard_dev(argv[1]);
 }
 
-/*****************************************************************************/
Index: user/init/Makefile
===================================================================
RCS file: /cvs/uclinux/uclinux/user/init/Makefile,v
retrieving revision 1.1.1.4
retrieving revision 1.6
diff -u -p -r1.1.1.4 -r1.6
--- user/init/Makefile	16 May 2003 01:10:50 -0000	1.1.1.4
+++ user/init/Makefile	16 Jul 2003 23:39:25 -0000	1.6
@@ -1,9 +1,15 @@
 
 EXEC1 = init
 OBJS1 = simpleinit.o
+ifdef CONFIG_USER_INIT_INIT
+ALL_EXECS += $(EXEC1)
+endif
 
 EXEC2 = expand
 OBJS2 = expand.o
+ifdef CONFIG_USER_INIT_EXPAND
+ALL_EXECS += $(EXEC2)
+endif
 
 ifdef CONFIG_UCLINUX
 BINDIR = /bin
@@ -18,7 +24,7 @@ ifdef CONFIG_LIB_UC_LIBC_TIMEZONE
 CFLAGS += -DINCLUDE_TIMEZONE
 endif
 
-all: $(EXEC1) $(EXEC2)
+all: $(ALL_EXECS)
 
 $(EXEC1): $(OBJS1)
 	$(CC) $(LDFLAGS) -o $@ $(OBJS1) $(LIBCRYPT) $(LDLIBS$(LDLIBS_$@))
@@ -32,8 +38,8 @@ romfs:
 	$(ROMFSINST) -e CONFIG_USER_INIT_INIT /bin/$(EXEC1)
 	$(ROMFSINST) -e CONFIG_USER_INIT_INIT -e CONFIG_USER_FACTORY_FACTTEST \
 			-a "facttest:unknown:/bin/facttest" /etc/inittab
-	$(ROMFSINST) -e CONFIG_USER_INIT_INIT -e CONFIG_USER_BUSYBOX_SYSLOGD \
-			-a "slog:unknown:${BINDIR}/syslogd -n" /etc/inittab
+#	$(ROMFSINST) -e CONFIG_USER_INIT_INIT -e CONFIG_USER_BUSYBOX_SYSLOGD \
+#			-a "slog:unknown:${BINDIR}/syslogd -n" /etc/inittab
 	$(ROMFSINST) -e CONFIG_USER_INIT_INIT -e CONFIG_USER_BUSYBOX_KLOGD \
 			-a "klog:unknown:${BINDIR}/klogd -n" /etc/inittab
 
Index: user/iptables/extensions/.connmark-test
===================================================================
RCS file: user/iptables/extensions/.connmark-test
diff -N user/iptables/extensions/.connmark-test
--- user/iptables/extensions/.connmark-test	28 Feb 2003 22:46:22 -0000	1.1.1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,2 +0,0 @@
-#! /bin/sh
-[ -f $KERNEL_DIR/net/ipv4/netfilter/ipt_connmark.c ] && echo connmark
Index: user/login/login.c
===================================================================
RCS file: /cvs/uclinux/uclinux/user/login/login.c,v
retrieving revision 1.1.1.6
retrieving revision 1.10
diff -u -p -r1.1.1.6 -r1.10
--- user/login/login.c	21 Mar 2004 02:57:39 -0000	1.1.1.6
+++ user/login/login.c	5 Dec 2004 03:36:06 -0000	1.10
@@ -8,12 +8,14 @@
  * 	(C) Copyright 2000, Lineo Inc. (www.lineo.com) 
  *
  *	Made some changes and additions Nick Brok (nick@nbrok.iaehv.nl).
+ *	Add -f and -p support - Bernardo Innocenti (bernie@develer.com)
  */
 
 /*****************************************************************************/
 
 #include <stdio.h>
 #include <unistd.h>
+#include <crypt.h>
 #include <stdlib.h>
 #include <fcntl.h>
 #include <getopt.h>
@@ -111,23 +113,32 @@ int main(int argc, char *argv[])
 {
 	char	*user;
 	char	*realpwd, *gotpwd, *cpwd;
-	char *host = NULL;
-	int flag;
-
-    while ((flag = getopt(argc, argv, "h:")) != EOF) {
-        switch (flag) {
-        case 'h':
-            host = optarg;
-            break;
-        default:
+	char	*host = NULL;
+	int	flag;
+	int	i;
+	int	good = 0;
+
+	while ((flag = getopt(argc, argv, "fph:")) != EOF) {
+		switch (flag) {
+			case 'h':
+			host = optarg;
+			break;
+		case 'f':
+			good = 1;
+			break;
+		case 'p':
+			/* FIXME: not really implemented */
+			break;
+	        default:
 			fprintf(stderr,
 			"login [OPTION]... [username]\n"
 			"\nBegin a new session on the system\n\n"
 			"Options:\n"
 			"\t-h\t\tName of the remote host for this login.\n"
+			"\t-f\t\tSkip authentication.\n"
 			);
-        }
-    }
+		}
+	}
 
 	chdir("/");
 
@@ -144,52 +155,48 @@ int main(int argc, char *argv[])
 		user = &usernamebuf[0];
 	}
 
-	gotpwd = getpass("Password: ");
-	realpwd = getrealpass(user);
+	if (!good) {
+		gotpwd = getpass("Password: ");
+		realpwd = getrealpass(user);
+
 #ifdef OLD_CONFIG_PASSWORDS
-	if ((realpwd == NULL) && 
-			((*user == '\0') || (strcmp(user, "root") == 0)))
-		realpwd = getoldpass(PATH_OLD_PASSWD);
+		if ((realpwd == NULL) && 
+				((*user == '\0') || (strcmp(user, "root") == 0)))
+			realpwd = getoldpass(PATH_OLD_PASSWD);
 #endif
-	openlog("login", LOG_PID, LOG_AUTHPRIV);
-	if (gotpwd && realpwd
+		openlog("login", LOG_PID, LOG_AUTHPRIV);
+		if (gotpwd && realpwd
 #ifdef ONLY_ALLOW_ROOT
-			&& strcmp(user, "root") == 0
+				&& strcmp(user, "root") == 0
 #endif
 			) {
-		int good = 0;
-
 
-		cpwd = crypt(gotpwd, realpwd);
-		if (strcmp(cpwd, realpwd) == 0) 
-			good++;
+			cpwd = crypt(gotpwd, realpwd);
+			if (strcmp(cpwd, realpwd) == 0) 
+				good++;
 
 #ifdef OLD_CONFIG_PASSWORDS
-		cpwd = crypt_old(gotpwd, realpwd);
-		if (strcmp(cpwd, realpwd) == 0)
-			good++;
+			cpwd = crypt_old(gotpwd, realpwd);
+			if (strcmp(cpwd, realpwd) == 0)
+				good++;
 #endif
+		}
+	}
+
+	openlog("login", 0, LOG_AUTHPRIV);
 
 #ifdef CONFIG_AMAZON
-		access__attempted(!good, user);
+	access__attempted(!good, user);
 #endif
-		if (good) {
-			syslog(LOG_INFO, "Authentication successful for %s from %s\n",
-					user, host ? host : "unknown");
+	if (good) {
+		syslog(LOG_INFO, "Authentication successful for %s from %s\n",
+				user, host ? host : "unknown");
 #ifdef EMBED
-			execlp("sh", "sh", NULL);
+		execlp("/bin/sh", "/bin/sh", NULL);
 #else
-			execlp("sh", "sh", "-t", NULL);
+		execlp("sh", "sh", "-t", NULL);
 #endif
-		} else {
-			syslog(LOG_ERR, "Authentication attempt failed for %s from %s because: Bad Password\n",
-					user, host ? host : "unknown");
-			sleep(DELAY_EXIT);
-		}
 	} else {
-#ifdef CONFIG_AMAZON
-		access__attempted(1, user);
-#endif
 		syslog(LOG_ERR, "Authentication attempt failed for %s from %s because: Invalid Username\n",
 					user, host ? host : "unknown");
 		sleep(DELAY_EXIT);
Index: user/login/passwd.c
===================================================================
RCS file: /cvs/uclinux/uclinux/user/login/passwd.c,v
retrieving revision 1.1.1.3
retrieving revision 1.4
diff -u -p -r1.1.1.3 -r1.4
--- user/login/passwd.c	28 Feb 2003 22:46:26 -0000	1.1.1.3
+++ user/login/passwd.c	3 Mar 2003 18:19:27 -0000	1.4
@@ -11,6 +11,7 @@
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
+#include <crypt.h>
 #include <fcntl.h>
 #include <pwd.h>
 #include <getopt.h>
diff -u -p -r1.1.1.1 -r1.2
--- user/mount/nfs_mount3.h	22 Jan 2002 00:31:29 -0000	1.1.1.1
+++ user/mount/nfs_mount3.h	22 Jan 2002 22:13:29 -0000	1.2
@@ -12,6 +12,20 @@
  * The kernel includes are at least as good as this file.
  * Use them.
  */
+
+/* bernie: imported from <linux/nfs.h> and <linux/nfs2.h>
+ * this is a quick & dirty fix to get linux/nfs_mount.h to compile
+ */
+struct nfs2_fh {
+	char			data[32];
+};
+struct nfs_fh {
+	unsigned short		size;
+	unsigned char		data[64];
+};
+
+#define NFS_VERSION 3
+
 #include <linux/nfs_mount.h>
 
 #else /* KERNEL_NFS_MOUNT_VERSION < 3 */
Index: user/mount/nfsmount.c
===================================================================
RCS file: /cvs/uclinux/uclinux/user/mount/nfsmount.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -p -r1.1.1.1 -r1.2
--- user/mount/nfsmount.c	22 Jan 2002 00:31:28 -0000	1.1.1.1
+++ user/mount/nfsmount.c	22 Jan 2002 22:13:29 -0000	1.2
@@ -46,7 +46,6 @@
 #include "sundries.h"
 #include "nfsmount.h"
 
-#include <linux/nfs.h>
 #include "mount_constants.h"
 #include "nfs_mount3.h"
 
Index: user/mtd-utils/Makefile
===================================================================
RCS file: /cvs/uclinux/uclinux/user/mtd-utils/Makefile,v
retrieving revision 1.1.1.7
retrieving revision 1.10
diff -u -p -r1.1.1.7 -r1.10
--- user/mtd-utils/Makefile	21 Mar 2004 02:57:50 -0000	1.1.1.7
+++ user/mtd-utils/Makefile	1 Jun 2004 16:30:57 -0000	1.10
@@ -1,23 +1,26 @@
 # -*- sh -*-
 
-# $Id: Makefile,v 1.1.1.7 2004/03/21 02:57:50 root Exp $
+# $Id: Makefile,v 1.10 2004/06/01 16:30:57 bernie Exp $
 
 #
 # These flags are used for build native versions of the tools for the
 # host system so it can generate images etc
 #
-#MY_CFLAGS = -I$(ROOTDIR)/$(LINUXDIR)/include
-MY_CFLAGS = -I/usr/include
-BUILD_CFLAGS += $(MY_CFLAGS)
+MY_CFLAGS = -I$(ROOTDIR)/$(LINUXDIR)/include
+CFLAGS := $(MY_CFLAGS) $(CFLAGS)
 BUILD_CC = gcc
 CFLAGS += $(INCZ) -D__USE_BSD
 
+# Don't build target binaries when mtd-utils is being
+# implicitly added by user/Makefile for JFFS2.
+ifeq ($(strip $(CONFIG_USER_MTDUTILS)),y)
 TARGETS = erase eraseall \
 	      nftl_format nftldump doc_loadbios doc_loadipl \
 	      ftl_format ftl_check \
 	      nanddump nandtest nandwrite \
 	      mkfs.jffs mkfs.jffs2 \
-	      lock unlock einfo mtd_debug fcp 
+	      lock unlock einfo mtd_debug fcp
+endif
 
 BUILD_TARGETS = $(patsubst %,build/%,$(TARGETS))
 
@@ -42,6 +45,8 @@ clean:
 	rm -rf build
 
 romfs:
+	true
+ifeq ($(strip $(CONFIG_USER_MTDUTILS)),y)
 	$(ROMFSINST) -e CONFIG_USER_MTDUTILS_ERASE        /bin/erase
 	$(ROMFSINST) -e CONFIG_USER_MTDUTILS_ERASEALL     /bin/eraseall
 	$(ROMFSINST) -e CONFIG_USER_MTDUTILS_FTL_CHECK    /bin/ftl_check
@@ -55,16 +60,18 @@ romfs:
 	$(ROMFSINST) -e CONFIG_USER_MTDUTILS_NANDWRITE    /bin/nandwrite
 	$(ROMFSINST) -e CONFIG_USER_MTDUTILS_DOC_LOADBIOS /bin/doc_loadbios
 	$(ROMFSINST) -e CONFIG_USER_MTDUTILS_DOC_LOADIPL  /bin/doc_loadipl
+endif
 
 mkfs.jffs2.o crc32.o: crc32.h
 build/mkfs.jffs2.o build/crc32.o: crc32.h
 compr_rubin.o: pushpull.h
 build/compr_rubin.o: pushpull.h
 compr_rubin.o: histo_mips.h compr_rubin.h
+#compr_zlib.o: zlib.h
 build/compr_rubin.o: histo_mips.h compr_rubin.h
 
 $(SYMLINKS):
-	ln -sf $(ROOTDIR)/$(LINUXDIR)/fs/jffs2/$@ $@
+	ln -sf $(ROOTDIR)/linux-2.4.x/fs/jffs2/$@ $@
 
 mkfs.jffs2: $(JFFS2_OBJS)
 	$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(LDPATH) -lz $(LDLIBS)
Index: user/mtd-utils/compr_rtime.c
===================================================================
RCS file: /cvs/uclinux/uclinux/user/mtd-utils/compr_rtime.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -p -r1.1.1.1 -r1.2
--- user/mtd-utils/compr_rtime.c	21 Mar 2004 02:57:50 -0000	1.1.1.1
+++ user/mtd-utils/compr_rtime.c	3 Jun 2004 06:32:08 -0000	1.2
@@ -24,7 +24,7 @@
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/errno.h>
-#include <linux/string.h> 
+#include <string.h> 
 
 /* _compress returns the compressed size, -1 if bigger */
 int jffs2_rtime_compress(unsigned char *data_in, unsigned char *cpage_out, 
Index: user/mtd-utils/eraseall.c
===================================================================
RCS file: /cvs/uclinux/uclinux/user/mtd-utils/eraseall.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -p -r1.1.1.1 -r1.2
--- user/mtd-utils/eraseall.c	22 Jan 2002 00:33:05 -0000	1.1.1.1
+++ user/mtd-utils/eraseall.c	3 Jun 2004 06:32:52 -0000	1.2
@@ -97,8 +97,13 @@ void process_options( int argc, char *ar
     exe_name=argv[0];
 
     for(;;) {
-        int option_index = 0;
         static const char* short_options="q";
+
+#ifdef EMBED
+        int c=getopt( argc, argv, short_options);
+
+#else /* !EMBED */
+        int option_index = 0;
         static const struct option long_options[] = {
             {"help", no_argument, 0, 0},
             {"version", no_argument, 0, 0},
@@ -110,11 +115,14 @@ void process_options( int argc, char *ar
 
         int c=getopt_long( argc, argv, short_options,
                            long_options, &option_index );
+#endif /* !EMBED */
+
         if( c==EOF ) {
             break;
         }
 
         switch( c ) {
+#ifndef EMBED
         case 0 :
             switch( option_index ) {
             case 0 :
@@ -125,6 +133,7 @@ void process_options( int argc, char *ar
                 break;
             }
             break;
+#endif /* EMBED */
 	case 'q' :
 	    quiet=1;
 	    break;
Index: user/mtd-utils/mkfs.jffs2.c
===================================================================
RCS file: /cvs/uclinux/uclinux/user/mtd-utils/mkfs.jffs2.c,v
retrieving revision 1.1.1.6
retrieving revision 1.2
diff -u -p -r1.1.1.6 -r1.2
--- user/mtd-utils/mkfs.jffs2.c	21 Mar 2004 02:57:50 -0000	1.1.1.6
+++ user/mtd-utils/mkfs.jffs2.c	3 Jun 2004 06:33:02 -0000	1.2
@@ -1128,7 +1128,7 @@ static int go(char *dname, FILE * devtab
 	return 0;
 }
 
-
+#ifndef EMBED
 static struct option long_options[] = {
 	{"pad", 2, NULL, 'p'},
 	{"root", 1, NULL, 'r'},
@@ -1144,6 +1144,7 @@ static struct option long_options[] = {
 	{"devtable", 1, NULL, 'D'},
 	{NULL, 0, NULL, 0}
 };
+#endif /* EMBED */
 
 static char *helptext =
 	"Usage: mkfs.jffs2 [OPTIONS]\n"
@@ -1165,7 +1166,7 @@ static char *helptext =
 	"  -v, --version          Display version information\n\n";
 
 
-static char *revtext = "$Revision: 1.1.1.6 $";
+static char *revtext = "$Revision: 1.2 $";
 
 int main(int argc, char **argv)
 {
@@ -1174,8 +1175,13 @@ int main(int argc, char **argv)
 	struct stat statbuf;
 	FILE *devtable = NULL;
 
-	while ((opt = getopt_long(argc, argv, "D:p::d:r:s:e:o:blqfh?v", 
-			long_options, &c)) >= 0) {
+#ifdef EMBED
+	while ((opt = getopt(argc, argv, "D:p::d:r:s:e:o:blqfh?v")) >= 0)
+#else
+	while ((opt = getopt_long(argc, argv, "D:p::d:r:s:e:o:blqfh?v",
+			long_options, &c)) >= 0)
+#endif
+	{
 		switch (opt) {
 		case 'D':
 			devtable = xfopen(optarg, "r");
Index: user/ping/ping.c
===================================================================
RCS file: /cvs/uclinux/uclinux/user/ping/ping.c,v
retrieving revision 1.1.1.4
retrieving revision 1.5
diff -u -p -r1.1.1.4 -r1.5
--- user/ping/ping.c	5 Sep 2003 23:02:02 -0000	1.1.1.4
+++ user/ping/ping.c	6 Sep 2003 00:51:07 -0000	1.5
@@ -91,7 +91,7 @@ char pkg[] = "netkit-base-0.10";
 #define SAFE_TO_DROP_ROOT
 #endif
 
-#if defined(__GLIBC__) && (__GLIBC__ >= 2)
+#if !defined(__UCLIBC__) && defined(__GLIBC__) && (__GLIBC__ >= 2)
 #define icmphdr			icmp
 #ifndef __UCLIBC__
 #define ICMP_DEST_UNREACH	ICMP_UNREACH
Index: user/pppd/pppd/ipcp.c
===================================================================
RCS file: /cvs/uclinux/uclinux/user/pppd/pppd/ipcp.c,v
retrieving revision 1.1.1.5
retrieving revision 1.8
diff -u -p -r1.1.1.5 -r1.8
--- user/pppd/pppd/ipcp.c	21 Mar 2004 02:58:48 -0000	1.1.1.5
+++ user/pppd/pppd/ipcp.c	22 Mar 2004 09:00:00 -0000	1.8
@@ -17,14 +17,6 @@
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
-#ifndef lint
-static char rcsid[] = "$Id: ipcp.c,v 1.1.1.5 2004/03/21 02:58:48 root Exp $";
-#endif
-
-/*
- * TODO:
- */
-
 #include <stdio.h>
 #include <string.h>
 #include <netdb.h>
@@ -1800,20 +1792,13 @@ add_resolv(peerdns1, peerdns2)
     int fd;
     FILE *oldf;
     struct stat buf;
-    char pathname[128];
     char buffer[128];
 
     syslog(LOG_INFO,"Adding resolv.conf for %s",ip_ntoa(peerdns1));
-    strcpy(pathname, _PATH_TEMP);
-    fd = mkstemp(pathname);
-    if(fd < 0) {
-        error("Unable to create temporary file");
-        return;
-    }
-    f = fdopen(fd,"w");
+    f = fopen(_PATH_TEMP,"w");
             
     if (f == NULL) {
-	error("Failed to open %s: %m", pathname);
+	error("Failed to open " _PATH_TEMP ": %m");
         close(fd);
 	return;
     }
@@ -1842,12 +1827,23 @@ add_resolv(peerdns1, peerdns2)
 
     if (ferror(f))
 	error("Write failed to %s: %m", _PATH_RESOLV);
+
     fclose(f);
-    if(rename(pathname, _PATH_RESOLV) < 0)
-        error("Unable to rename %s to %s: %m", pathname, _PATH_RESOLV);
+
+    if(rename(_PATH_TEMP, _PATH_RESOLV) < 0)
+        error("Unable to rename %s to %s: %m", _PATH_TEMP, _PATH_RESOLV);
     if (chmod(_PATH_RESOLV, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH) < 0)
-    	error("Unable to change permissions for %s to 666", _PATH_RESOLV);
-    
+	error("Unable to change permissions for %s to 644", _PATH_RESOLV);
+
+    /* bernie: attempt to create temporary file again */
+    memset(buffer,0,sizeof(buffer));
+    if ((f = fopen(_PATH_TEMP, "w")))
+    {
+        fwrite(buffer, sizeof(buffer), 1, f);
+        fclose(f);
+    }
+    else
+        error("Unable to create %s: %m", _PATH_TEMP);
 }
 static void
 remove_resolv(peerdns1, peerdns2)
@@ -1857,24 +1853,16 @@ remove_resolv(peerdns1, peerdns2)
     int fd;
     FILE *oldf;
     struct stat buf;
-    char pathname[128];
     char buffer[128];
     size_t count;
     char * dnsname1 = NULL;
     char * dnsname2 = NULL;
-
     
 
     syslog(LOG_INFO,"Removing resolv.conf for %s",ip_ntoa(peerdns1));
-    strcpy(pathname, _PATH_TEMP);
-    fd = mkstemp(pathname);
-    if(fd < 0) {
-        error("Unable to create temporary file");
-        return;
-    }
-    f = fdopen(fd,"w");
+    f = fopen(_PATH_TEMP,"w");
     if (f == NULL) {
-	error("Failed to open %s: %m", pathname);
+	error("Failed to open %s: %m", _PATH_TEMP);
         close(fd);
 	return;
     }
@@ -1882,8 +1870,8 @@ remove_resolv(peerdns1, peerdns2)
     if(oldf == NULL) {
         fclose(f);
         error("remove_resolv: %s not found : %m",_PATH_RESOLV);
-	if(unlink(pathname) < 0)
-            error("unable to remove old %s: %m",pathname);
+	if(unlink(_PATH_TEMP) < 0)
+            error("unable to remove old %s: %m",_PATH_TEMP);
         return;
     }
 
@@ -1931,11 +1919,20 @@ remove_resolv(peerdns1, peerdns2)
     if (ferror(f))
 	error("Write failed to %s: %m", _PATH_RESOLV);
     fclose(f);
-    if(rename(pathname, _PATH_RESOLV) < 0)
-        error("Unable to rename %s to %s: %m", pathname, _PATH_RESOLV);
+    if(rename(_PATH_TEMP, _PATH_RESOLV) < 0)
+        error("Unable to rename %s to %s: %m", _PATH_TEMP, _PATH_RESOLV);
     if (chmod(_PATH_RESOLV, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH) < 0)
-    	error("Unable to change permissions for %s to 666", _PATH_RESOLV);
+	error("Unable to change permissions for %s to 644", _PATH_RESOLV);
 
+    /* bernie: attempt to create temporary file again */
+    memset(buffer,0,sizeof(buffer));
+    if ((f = fopen(_PATH_TEMP, "w")))
+    {
+        fwrite(buffer, sizeof(buffer), 1, f);
+        fclose(f);
+    }
+    else
+        error("Unable to create %s: %m", _PATH_TEMP);
 }
 /*
  * ipcp_printpkt - print the contents of an IPCP packet.
Index: user/pppd/pppd/main.c
===================================================================
RCS file: /cvs/uclinux/uclinux/user/pppd/pppd/main.c,v
retrieving revision 1.1.1.6
retrieving revision 1.6
diff -u -p -r1.1.1.6 -r1.6
--- user/pppd/pppd/main.c	21 Mar 2004 02:58:48 -0000	1.1.1.6
+++ user/pppd/pppd/main.c	21 Mar 2004 04:43:06 -0000	1.6
@@ -17,10 +17,6 @@
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
-#ifndef lint
-static char rcsid[] = "$Id: main.c,v 1.1.1.6 2004/03/21 02:58:48 root Exp $";
-#endif
-
 #include <stdio.h>
 #include <ctype.h>
 #include <stdlib.h>
@@ -627,7 +623,7 @@ main(argc, argv)
 	    set_up_tty(pty_slave, 1);
 	}
 
-#ifndef EMBED
+/*#ifndef EMBED*/
 	/*
 	 * Lock the device if we've been asked to.
 	 */
@@ -637,7 +633,7 @@ main(argc, argv)
 		goto fail;
 	    locked = 1;
 	}
-#endif
+/*#endif*/
 
 	/*
 	 * Open the serial device and set it up to be the ppp interface.
@@ -933,12 +929,14 @@ main(argc, argv)
 	    close(pty_slave);
 	if (real_ttyfd >= 0)
 	    close_tty();
-#ifndef EMBED
+/*#ifndef EMBED*/
 	if (locked) {
 	    unlock();
 	    locked = 0;
 	}
+/*#endif*/
 
+#ifndef EMBED
 	if (!demand) {
 #endif
 	    if (pidfilename[0] != 0
@@ -1222,7 +1220,7 @@ cleanup()
     if (pidfilename[0] != 0 && unlink(pidfilename) < 0 && errno != ENOENT) 
 	warn("unable to delete pid file %s: %m", pidfilename);
     pidfilename[0] = 0;
-    
+ 
     {
     	FILE *in;
 	char pidnumber[100];
@@ -1240,10 +1238,8 @@ cleanup()
 			fclose(in);
 	}
     }	
-#ifndef EMBED
     if (locked)
 	unlock();
-#endif
 }
 
 /*
Index: user/pppd/pppd/utils.c
===================================================================
RCS file: /cvs/uclinux/uclinux/user/pppd/pppd/utils.c,v
retrieving revision 1.1.1.2
retrieving revision 1.4
diff -u -p -r1.1.1.2 -r1.4
--- user/pppd/pppd/utils.c	28 Jan 2003 18:02:43 -0000	1.1.1.2
+++ user/pppd/pppd/utils.c	8 May 2004 17:20:28 -0000	1.4
@@ -17,7 +17,7 @@
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 #ifndef lint
-static char rcsid[] = "$Id: utils.c,v 1.1.1.2 2003/01/28 18:02:43 aleph Exp $";
+static char rcsid[] = "$Id: utils.c,v 1.4 2004/05/08 17:20:28 bernie Exp $";
 #endif
 
 #include <stdio.h>
@@ -33,6 +33,7 @@ static char rcsid[] = "$Id: utils.c,v 1.
 #include <utmp.h>
 #include <time.h>
 #include <pwd.h>
+#include <time.h>
 #include <sys/param.h>
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -694,7 +695,7 @@ dbglog __V((char *fmt, ...))
     va_end(pvar);
 }
 
-#ifndef EMBED
+/*#ifndef EMBED*/
 
 /* Procedures for locking the serial device using a lock file. */
 #ifndef LOCK_DIR
@@ -777,12 +778,13 @@ lock(dev)
 #ifndef LOCK_BINARY
 	n = read(fd, lock_buffer, 11);
 #else
+	pid = 0;
 	n = read(fd, &pid, sizeof(pid));
 #endif /* LOCK_BINARY */
 	close(fd);
 	fd = -1;
-	if (n <= 0) {
-	    error("Can't read pid from lock file %s", lock_file);
+	if (n < 0) {
+	    error("Can't read pid from lock file %s: %m", lock_file);
 	    break;
 	}
 
@@ -881,4 +883,4 @@ unlock()
     }
 }
 
-#endif /* EMBED */
+/*#endif*/ /* EMBED */
Index: user/smtpclient/smtpclient_main.c
===================================================================
RCS file: /cvs/uclinux/uclinux/user/smtpclient/smtpclient_main.c,v
retrieving revision 1.1.1.2
retrieving revision 1.3
diff -u -p -r1.1.1.2 -r1.3
--- user/smtpclient/smtpclient_main.c	5 Sep 2003 23:02:29 -0000	1.1.1.2
+++ user/smtpclient/smtpclient_main.c	6 Sep 2003 00:51:07 -0000	1.3
@@ -40,9 +40,12 @@
 #include <stdlib.h>
 #include <stdarg.h>
 #include <errno.h>
+#include <unistd.h>
+#include <time.h>
 
 #include <sys/types.h>
 #include <sys/socket.h>
+#include <sys/stat.h>
 #include <netinet/in.h>
 #include <syslog.h>
 #include <stdio.h>
@@ -77,6 +80,11 @@ static FILE *rfp;
 #define LOG_DAEMON 0
 #endif
 
+/* Strings used for generation of Date header */
+static char *hdr_months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+                              "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
+static char *hdr_wdays[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
+
 /*
 **  logging support
 */
@@ -105,6 +113,8 @@ void usage(void)
     fprintf(stderr, "Message Header Options:\n");
     fprintf(stderr, "  -s, --subject=STR      subject line of message\n");
     fprintf(stderr, "  -f, --from=ADDR        address of the sender\n");
+    fprintf(stderr, "  -d, --date=DATE        date of message\n");
+    fprintf(stderr, "  -D, --date-file=FILE   get date of message from modtime of FILE\n");
     fprintf(stderr, "  -r, --reply-to=ADDR    address of the sender for replies\n");
     fprintf(stderr, "  -e, --errors-to=ADDR   address to send delivery errors to\n");
     fprintf(stderr, "  -c, --carbon-copy=ADDR address to send copy of message to\n");
@@ -288,6 +298,8 @@ void toqp(FILE *infile, FILE *outfile)
 struct option options[] = {
     { "subject",      1, NULL, 's' },
     { "from",         1, NULL, 'f' },
+    { "date",         1, NULL, 'd' },
+    { "date-file",    1, NULL, 'D' },
     { "replay-to",    1, NULL, 'r' },
     { "errors-to",    1, NULL, 'e' },
     { "carbon-copy",  1, NULL, 'c' },
@@ -315,13 +327,16 @@ int main(int argc, char **argv)
     struct passwd *pwd;
     char *cp;
     char *src_host = NULL;
+    char *date_hdr = NULL;
+    char *date_file = NULL;
+    char datebuf[32];
     int cache_in = 0;
     char *line_cache = NULL;
 
     /*
      *  Parse options
      */
-    while ((c = getopt_long(argc, argv, ":H:s:f:r:e:c:S:P:MLvVhR", options, NULL)) != EOF) {
+    while ((c = getopt_long(argc, argv, ":H:s:f:d:D:r:e:c:S:P:MLvVhR", options, NULL)) != EOF) {
         switch (c) {
 	    case 'H':
 		src_host = optarg;
@@ -332,6 +347,12 @@ int main(int argc, char **argv)
             case 'f':
                 from_addr = optarg;
                 break;
+	    case 'd':
+		date_hdr = optarg;
+		break;
+	    case 'D':
+		date_file = optarg;
+		break;
             case 'r':
                 reply_addr = optarg;
                 break;
@@ -452,6 +473,28 @@ int main(int argc, char **argv)
     }
 
     /*
+     *  Determine date of message from a file (if option -D)
+     */
+    if (date_file) {
+	struct stat st;
+	struct tm tm;
+
+	if (stat(date_file, &st) == -1) {
+	    log("%s: file not found\n", date_file);
+	    exit(1);
+	}
+	if (!gmtime_r(&st.st_mtime, &tm)) {
+	    log("Error converting date from %s\n", date_file);
+	}
+	else {
+	    snprintf(datebuf, sizeof(datebuf), "%s, %d %s %d %02d:%02d:%02d +0000", 
+		         hdr_wdays[tm.tm_wday], tm.tm_mday, hdr_months[tm.tm_mon],
+		         1900 + tm.tm_year, tm.tm_hour, tm.tm_min, tm.tm_sec);
+	    date_hdr = datebuf;
+	}
+    }
+
+    /*
      *  Connect to smtp daemon on mailhost.
      */
     if ((hp = gethostbyname(mailhost)) == NULL) {
@@ -506,6 +549,11 @@ int main(int argc, char **argv)
     if (subject)
         fprintf(sfp, "Subject: %s\r\n", subject);
 
+    if (date_hdr) {
+	fprintf(sfp, "Date: %s\r\n", date_hdr);
+	dprintf("Date header: %s\n", date_hdr);
+    }
+
     if (reply_addr)
         fprintf(sfp, "Reply-To: %s\r\n", reply_addr);
     if (err_addr)
Index: user/strace/bjm.c
===================================================================
RCS file: /cvs/uclinux/uclinux/user/strace/bjm.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -p -r1.1.1.2 -r1.2
--- user/strace/bjm.c	18 Feb 2002 10:24:18 -0000	1.1.1.2
+++ user/strace/bjm.c	5 Dec 2004 03:36:37 -0000	1.2
@@ -47,7 +47,39 @@
 #endif
 #include <sys/syscall.h>
 #include <signal.h>
-#include <linux/module.h>
+
+/* From linux/module.h */
+#define MOD_UNINITIALIZED	0
+#define MOD_RUNNING		1
+#define MOD_DELETED		2
+#define MOD_AUTOCLEAN		4
+#define MOD_VISITED  		8
+#define MOD_USED_ONCE		16
+#define MOD_JUST_FREED		32
+#define MOD_INITIALIZING	64
+
+/* From linux/module.h */
+#define QM_MODULES	1
+#define QM_DEPS		2
+#define QM_REFS		3
+#define QM_SYMBOLS	4
+#define QM_INFO		5
+
+/* From linux/module.h */
+struct module_info
+{
+	unsigned long addr;
+	unsigned long size;
+	unsigned long flags;
+	long usecount;
+};
+
+/* From linux/module.h */
+struct module_symbol
+{
+	unsigned long value;
+	const char *name;
+};
 
 #ifdef __NR_query_module
 static struct xlat which[] = {
Index: user/strace/process.c
===================================================================
RCS file: /cvs/uclinux/uclinux/user/strace/process.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -p -r1.1.1.2 -r1.2
--- user/strace/process.c	28 Jan 2003 18:03:04 -0000	1.1.1.2
+++ user/strace/process.c	5 Dec 2004 03:36:50 -0000	1.2
@@ -87,6 +87,7 @@
 
 #ifdef LINUX
 #include <asm/posix_types.h>
+#include <asm/ptrace.h>
 #undef GETGROUPS_T
 #define GETGROUPS_T __kernel_gid_t
 #endif /* LINUX */
Index: user/strace/system.c
===================================================================
RCS file: /cvs/uclinux/uclinux/user/strace/system.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -p -r1.1.1.1 -r1.2
--- user/strace/system.c	22 Jan 2002 00:33:01 -0000	1.1.1.1
+++ user/strace/system.c	5 Dec 2004 03:37:21 -0000	1.2
@@ -1694,15 +1694,21 @@ static struct xlat sysctl_kern[] = {
 };
 
 static struct xlat sysctl_vm[] = {
+#ifdef VM_SWAPCTL
 	{ VM_SWAPCTL, "VM_SWAPCTL" },
+#endif
 #ifdef VM_KSWAPD
 	{ VM_KSWAPD, "VM_KSWAPD" },
 #endif
 #ifdef VM_SWAPOUT
 	{ VM_SWAPOUT, "VM_SWAPOUT" },
 #endif
+#ifdef VM_FREEPG
 	{ VM_FREEPG, "VM_FREEPG" },
+#endif
+#ifdef VM_BDFLUSH
 	{ VM_BDFLUSH, "VM_BDFLUSH" },
+#endif
 #ifdef VM_MAXID
 	{ VM_MAXID, "VM_MAXID" },
 #endif
Index: user/telnetd/sys_term.c
===================================================================
RCS file: /cvs/uclinux/uclinux/user/telnetd/sys_term.c,v
retrieving revision 1.1.1.4
retrieving revision 1.5
diff -u -p -r1.1.1.4 -r1.5
--- user/telnetd/sys_term.c	21 Mar 2004 03:00:00 -0000	1.1.1.4
+++ user/telnetd/sys_term.c	29 May 2004 14:22:42 -0000	1.5
@@ -48,7 +48,7 @@ char st_rcsid[] = 
 #include <libtelnet/auth.h>
 #endif
 
-//#define USE_OPENPTY 1
+#define USE_OPENPTY 1
 //#define DEVFS 1
 #ifdef USE_OPENPTY
 #include <pty.h>
Index: user/tftpd/tftpd.c
===================================================================
RCS file: /cvs/uclinux/uclinux/user/tftpd/tftpd.c,v
retrieving revision 1.1.1.2
retrieving revision 1.5
diff -u -p -r1.1.1.2 -r1.5
--- user/tftpd/tftpd.c	5 Sep 2003 23:02:41 -0000	1.1.1.2
+++ user/tftpd/tftpd.c	29 May 2004 14:25:56 -0000	1.5
@@ -50,6 +50,7 @@ static char sccsid[] = "@(#)tftpd.c	5.8 
 #include <netdb.h>
 #include <setjmp.h>
 #include <syslog.h>
+#include <fcntl.h>
 #ifdef EMBED
 #include <unistd.h>
 #include <linux/autoconf.h>
@@ -254,7 +255,7 @@ validate_access(filename, mode)
 	struct stat stbuf;
 	int	fd;
 
-#ifndef CONFIG_NETtel
+#if !defined(CONFIG_NETtel) && !defined(CONFIG_DEVELER)
 	if (*filename != '/')
 		return (EACCESS);
 	if (stat(filename, &stbuf) < 0)
@@ -277,7 +278,7 @@ validate_access(filename, mode)
 	}
 #endif
 #endif /*!CONFIG_NETTEL*/
-	fd = open(filename, mode == RRQ ? 0 : 1);
+	fd = open(filename, mode == RRQ ? O_RDONLY : O_WRONLY | O_CREAT | O_TRUNC, 0666);
 	if (fd < 0)
 		return (errno + 100);
 	file = fdopen(fd, (mode == RRQ)? "r":"w");
@@ -479,7 +480,7 @@ nak(error)
 		if (pe->e_code == error)
 			break;
 	if (pe->e_code < 0) {
-		pe->e_msg = sys_errlist[error - 100];
+		pe->e_msg = strerror(error - 100);
 		tp->th_code = EUNDEF;   /* set 'undef' errorcode */
 	}
 	strcpy(tp->th_msg, pe->e_msg);
Index: vendors/config/m68knommu/config.arch
===================================================================
RCS file: /cvs/uclinux/uclinux/vendors/config/m68knommu/config.arch,v
retrieving revision 1.1.1.4
retrieving revision 1.5
diff -u -p -r1.1.1.4 -r1.5
--- vendors/config/m68knommu/config.arch	21 Mar 2004 03:00:43 -0000	1.1.1.4
+++ vendors/config/m68knommu/config.arch	3 Jun 2004 06:35:41 -0000	1.5
@@ -57,7 +57,7 @@ endif
 MACHINE       = m68k
 ARCH          = m68knommu
 ENDIAN        = big
-CROSS_COMPILE = m68k-elf-
+CROSS_COMPILE = m68k-uclinux-
 CROSS         = $(CROSS_COMPILE)
 
 CC        = $(CROSS_COMPILE)gcc $(CPUFLAGS)
@@ -88,9 +88,9 @@ endif
 ifdef UCLINUX_BUILD_LIB
 
   ifdef CONFIG_LIB_DEBUG
-	CFLAGS  :=  $(if $(LOPT),$(LOPT),-O1) -g
+	CFLAGS  :=  $(if $(LOPT),$(LOPT),-Os) -g
   else
-	CFLAGS  :=  $(if $(LOPT),$(LOPT),-O2) -g -fomit-frame-pointer
+	CFLAGS  :=  $(if $(LOPT),$(LOPT),-Os) -g -fomit-frame-pointer
   endif
 	CFLAGS  += $(CPUFLAGS)
 	CFLAGS  += $(VENDOR_CFLAGS)
@@ -131,9 +131,9 @@ endif
 ifdef UCLINUX_BUILD_USER
 
 	GCC_DIR = $(shell $(CC) -v 2>&1|grep specs|sed -e 's/.* \(.*\)specs/\1\./')
-	GCC_LIB = /usr/local/m68k-elf/lib
+	GCC_LIB = /usr/local/m68k-uclinux/lib
 
-	SLIBC        = -lc
+	SLIBC        = -lc -lgcc
 	SLIBM        = -lm
 	SLIBNET      = -lnet
 	SLIBDES      = -ldes
@@ -239,7 +239,7 @@ ifdef UCLINUX_BUILD_USER
   endif
 
   ifneq ($(LIBCDIR),libc)
-	LDFLAGS += -nostartfiles $(ROOTDIR)/lib/$(LIBCDIR)/lib/crt0.o
+	LDFLAGS += -nostdlib -nostartfiles $(ROOTDIR)/lib/$(LIBCDIR)/lib/crt0.o
   endif
   	LDFLAGS += $(LDPATH)
 
