Version 0.0.0 of the DPCM GPL firmware was based on several single packages. Compiling these is described in the
following (not everything listed was included in the final release though).
These steps are also good hints for compiling other packages if you want to play around with it.
busybox (Verified with version 1.00)
openssl (Verified with version 0.9.6m)
- run "./Configure linux-elf-arm no-shared"
- edit Makefile:
- replace "CC= gcc" by "CC= arm-elf-gcc"
- within the "CFLAG=" line, replace "-O3" by "-O2" and add "-D__PIC__ -fpic -msingle-pic-base -Wl,-elf2flt=-z"
- run make
- copy *.a to you cross-toolchain lib/fpic/msingle-pic-base directory (e.g. /usr/local/arm-elf/lib/fpic/msingle-pic-base)
flex (Verified with version 2.5.31)
- run configure:
CC="arm-elf-gcc" CFLAGS="-D__PIC__ -fpic -msingle-pic-base -Wl,-elf2flt=-z" ./configure --host=arm-elf-linux
- run make
- copy libfl.a to you cross-toolchain lib/fpic/msingle-pic-base directory (e.g. /usr/local/arm-elf/lib/fpic/msingle-pic-base)
ipsec-tools (Verified with version 0.5.2, earlier versions will not cross compile)
- requires openssl (libcrypto.a) and flex (libfl.a)
- requires openssl source code (path must be given to configure with "--with-openssl=")
- apply the patch
- run configure:
CC="arm-elf-gcc" CFLAGS="-O2 -D__PIC__ -fpic -msingle-pic-base" LDFLAGS="-fpic -msingle-pic-base -Wl,-elf2flt=-z" ./configure --disable-readline --with-pic --disable-ipv6 --with-kernel-headers=/path/to/linux-2.4.29/include/ --with-openssl=/path/to/openssl-0.9.6m/ --host=arm-elf-linux --prefix=''
- in config.h: replace "#define WITH_SHA2" by "#undef WITH_SHA2" to save some space
- run make
iptables (Verified with version 1.3.3)
- In Makefile replace "CFLAGS:=" by "CFLAGS+=" (replace the colon by a plus sign), otherwise it will completely
ignore our CFLAGS from the command line and produce an useless binary
- Do the same thing for "LDFLAGS", but be careful that you get the correct line: there are two "LDFLAGS=" lines in the Makefile,
one within a "ifndef NO_SHARED_LIBS" block, the other in the "else" part of this block; we need the latter one, i.e. you have
to replace "LDFLAGS = -static" by "LDFLAGS += -static"
- run make:
CC="arm-elf-gcc" CFLAGS="-D__PIC__ -fpic -msingle-pic-base" LDFLAGS="-fpic -msingle-pic-base -Wl,-elf2flt=-z" make KERNEL_DIR=/path/to/linux-kernel-sources/ NO_SHARED_LIBS=1
- make will probably fail with "undefined reference to `in6addr_any'" - don't worry, this is related to the build of ip6tables, which we don't need,
because we only want iptables which has already been built at this time
pppd (part of http://www.uclinux.org/pub/uClinux/dist/uClinux-dist-20041215.tar.bz2,
directory user/pppd/pppd)
- Go into the pppd subdirectory (uClinux-dist/user/pppd/pppd, i.e. "pppd" twice!)
- cp Makefile.linux Makefile
- Put the following lines at the beginning of Makefile:
CC = arm-elf-gcc
CCFLAGS = -O2 -pipe -Wall -D__PIC__ -fpic -msingle-pic-base
LDFLAGS = -fpic -msingle-pic-base -Wl,-elf2flt=-z
DEFS = -DEMBED -D__uClinux__ -DPLUGIN -DPLUGIN_PPPOE
LDLIBS = /usr/local/arm-elf/lib/fpic/msingle-pic-base/libcrypt.a \
/usr/local/arm-elf/lib/fpic/msingle-pic-base/libutil.a \
plugins/pppoe/pppoe.o \
plugins/pppoe/libpppoe.a
- Comment out the "MPPE=y" line in Makefile
- In Makefile, within the "EXINCS =" line, replace "-I../linux" by "-I/usr/local/arm-elf"
- cp plugins/pppoe/Makefile.linux plugins/pppoe/Makefile
- Put the following lines at the beginning of plugins/pppoe/Makefile:
CC = arm-elf-gcc
AR = arm-elf-ar
CFLAGS = -O2 -pipe -Wall -D__PIC__ -fpic -msingle-pic-base -D_linux_ -DEMBED
LDFLAGS = -fpic -msingle-pic-base -Wl,-elf2flt=-z
- Comment out the "#include <config/autoconf.h>" line in plugins/pppoe/pppoe.c
- Compile the PPPoE plugin: "(cd plugins/pppoe;make pppoe.o libpppoe.a)"
- run make
- run "arm-elf-flthdr -s 8192 pppd"
chat (part of http://www.uclinux.org/pub/uClinux/dist/uClinux-dist-20041215.tar.bz2,
directory user/pppd/chat)
diald (part of http://www.uclinux.org/pub/uClinux/dist/uClinux-dist-20041215.tar.bz2,
directory user/diald)
- Put the following lines at the beginning of Makefile:
CC = arm-elf-gcc
CFLAGS = -O2 -pipe -Wall -D__PIC__ -fpic -msingle-pic-base -DEMBED \
-DCONFIG_USER_NET_TOOLS_IFCONFIG -DCONFIG_USER_NET_TOOLS_ROUTE
LDFLAGS = -fpic -msingle-pic-base -Wl,-elf2flt=-z
- Comment out the "#include <config/autoconf.h>" line in diald.h
- adjust some paths in config.h: replace
#define DIALD_CONFIG_FILE "/etc/config/diald.conf"
#define DIALD_DEFS_FILE "/etc/diald.defs"
by
#define DIALD_CONFIG_FILE "/etc/ppp/diald.conf"
#define DIALD_DEFS_FILE "/etc/ppp/diald.defs"
and
#define PATH_PPPD "/bin/pppd"
by
#define PATH_PPPD "/sbin/pppd"
- run make
- run "arm-elf-flthdr -s 8192 diald"
inetd (part of http://www.uclinux.org/pub/uClinux/dist/uClinux-dist-20041215.tar.bz2,
directory user/inetd)
telnetd (part of http://www.uclinux.org/pub/uClinux/dist/uClinux-dist-20041215.tar.bz2,
directory user/telnetd)
boa (part of http://www.uclinux.org/pub/uClinux/dist/uClinux-dist-20041215.tar.bz2,
directory user/boa)
dnsmasq (Verified with version 2.22)
- Put the following lines at the beginning of src/Makefile:
CC = arm-elf-gcc
CFLAGS = -O2 -pipe -Wall -D__PIC__ -fpic -msingle-pic-base -D__uClinux__ \
-D__UCLIBC__
LDFLAGS = -fpic -msingle-pic-base -Wl,-elf2flt=-z
- In the last line of src/Makefile, put "$(LDFLAGS)" after "$(CC)":
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
- run make
brctl (from the bridge-utils package, verified with version 1.0.6)
- run configure:
CC="arm-elf-gcc" CFLAGS="-O2 -D__PIC__ -fpic -msingle-pic-base" LDFLAGS="-fpic -msingle-pic-base -Wl,-elf2flt=-z" ./configure --with-linux-headers=/path/to/linux-kernel-sources/include/ --host=arm-elf-linux
- run make
mtd-utils (verified with
CVS version of 2005-03-04,
which is the last version for 2.4 kernels, as
described on the linux-mtd homepage)
- cd mtd/util
- edit flash_eraseall.c: replace "bbtest = 1" by "bbtest = 0"
- edit Makefile: replace "CFLAGS :=" by "CFLAGS +="
- run make:
CROSS="arm-elf-" CFLAGS="-D__PIC__ -fpic -msingle-pic-base -Wl,-elf2flt=-z" LDFLAGS="-fpic -msingle-pic-base -Wl,-elf2flt=-z" make
- compiling will fail at some point, but that doesn't matter as we only want the flash_eraseall program
netkit-tftp (verified with version 0.17)
- cd into the tftpd subdirectory
- edit Makefile: comment out "#include ../MCONFIG" and "#include ../MRULES"
- apply
the patch which adds/changes a few things:
- Allow upload of files which don't yet exist (otherwise only existing files may be overwritten which doesn't make sense for us)
- Do not check for any permissions; uClinux always is a single user environment, so permission checking doesn't make sense
- The tftpd directory is change from /tftpboot to /var/files
- If a file named "tiburon.rbt" is uploaded, the program /bin/upgrade_firmware is launched which is supposed to upgrade
the firmware; this makes firmware updates a little more convenient and matches the original DPCM firmware behavior
- run make:
CC="arm-elf-gcc" CFLAGS="-O2 -D__PIC__ -fpic -msingle-pic-base" LDFLAGS="-fpic -msingle-pic-base -Wl,-elf2flt=-z" make
vconfig (verified with version 1.9)
- rm -f vconfig *.o
- make CC="arm-elf-gcc" CCFLAGS="-D__PIC__ -fpic -msingle-pic-base" LDFLAGS="-D__PIC__ -fpic -msingle-pic-base -Wl,-elf2flt=-z"
- ignore the strip error
|