Thursday, March 27, 2008

iptable kernel setup

CONFIG_NF_CONNTRACK_FTP
CONFIG_IP_NF_TARGET_MASQUERADE
CONFIG_NF_NAT
CONFIG_NF_NAT_NEEDED
CONFIG_NETFILTER_XT_MATCH_LIMIT
CONFIG_IP_NF_TARGET_LOG
CONFIG_NETFILTER_XT_MATCH_STATE
CONFIG_NF_CONNTRACK_ENABLED
CONFIG_NF_CONNTRACK

CONFIG_NETFILTER

CONFIG_PACKET
CONFIG_IP_NF_IPTABLES
CONFIG_NF_NAT_IRC
CONFIG_NF_CONNTRACK_IRC


iptables compile

1. check out a iptables from SVN
svn co https://svn.netfilter.org/netfilter/trunk/iptables
2. cd iptables
3. run autogen.sh, here is the content of autogen.sh
#!/bin/bash
autoreconf -fi;
rm -Rf autom4te*.cache;
--------------------------------------
This will generate configure

4. run ./configure with following option, or run_configure with content as below

./configure CC=powerpc-405-linux-gnu-gcc --build=powerpc-405-linux-gnu --target=powerpc-amcc-linux --host=powerpc-amcc-linux --with-kernel=/localhome/wli/linux-2.6.24 --with-ksource=/localhome/wli/linux-2.6.24 --with-gnu-ld

5. run ./made with content as below
#!/bin/bash
if [ -n "$1" ]; then
linux_path=$1
else
linux_path="/localhome/wli/linux-2.6.24"
fi
mv $linux_path/include/linux/errno.h $linux_path/include/linux/errno_org.h
ln -s $linux_path/include/asm-generic/errno.h $linux_path/include/linux/errno.h
make CC=powerpc-405-linux-gnu-gcc KERNEL_DIR=$linux_path KBUILD_OUTPUT=""
mv $linux_path/include/linux/errno_org.h $linux_path/include/linux/errno.h


Tuesday, March 18, 2008

how to compile dnrd package

1. untar dnrd package
tar xvfz dnrd-2.20.3.tar.gz
2. cd dnrd-2.20.3
./configure CC=powerpc-405-linux-gnu-gcc --host=powerpc-amcc-linux --build=powerpc-405-linux-gnu --target=powerpc-amcc-linux
3. run make

How to build AR680 image

1. Untar ar680w package
tar xvfz ar680w_v1.00_gpl.070802.tgz
2. cd ar680
Run ./build_tool_chain
3. Edit setupenv
change arm crosstool path to /localhome/wli/ar680/crosstol/....
4. make
5. make
6. After build sucessfully, here is the message..
WRG-N15 make F/W image (release image)!
boundary: 0x10000 (64K)
output: raw.img
input(0): kernel.img
input(1): rootfs.img
Opening file (0): kernel.img ...
Input File ------ size : 0x000c2084 (794756)
Add IN File ----- size : 0x000c2084 (794756)
Opening file (1): rootfs.img ...
Input File ------ size : 0x001af000 (1765376)
Output File ----- size : 0x000c2084 (794756)
Output Pack To -- size : 0x000d0000 (851968)
Tags Added ------ size : 0x000d0028 (852008)
Add IN File ----- size : 0x0027f028 (2617384)
packimgs exit with code 0.
Create a new image file web.img
image header ----------------------------------------
signature : [wrgn15_airlink_ar680w]
magic : 0x20040220
-----------------------------------------------------
input image file ------------------------------------
file length : 2617384 (0x27f028)
file peek : 5d00008000508a210000000000000062
digest : 8359a62ad10c0c8930c360fa8283f3a9
-----------------------------------------------------
v2 image block header -------------------------------
Little endian image !
magic : 0x20040220
size : 2617384 (0x27f028)
offset : 0 (0x0)
devname : /dev/mtdblock/1
digest : 8359a62ad10c0c8930c360fa8283f3a9
-----------------------------------------------------
-----------------------------------------------------
Image file : ar680w_v1.00_83id.bin
Signature : wrgn15_airlink_ar680w
Build number : 83id
-----------------------------------------------------
-rw-rw-r-- 1 wli wli 2617496 Mar 18 13:44 images/ar680w_v1.00_83id.bin

Friday, March 14, 2008

How to set timezone in busybox

busybox time display utility date, by default use UTC zone. To change time zone to PST.
set TZ=PST8PDT, where PST is a acrynom for Pacific standard time, 8=PST is 8 hours ealier than UTC, PDT=pacific daylight saving time.

To change to mountain time, which is GMT-6. set TZ=MST6MDT.

Another example.
TZ=NST3:30NDT1:30
This means that Newfoundland Standard Time (NST) is 3.5 hours
earlier than Coordinated Universal Time (UTC). Both standard
time and daylight saving time apply to this locale. Newfoundland
Daylight Time is 1.5 hours earlier than Coordinated Universal
Time (UTC).