2012년 7월 11일 수요일

zlib cross compile

  • official home

 http://zlib.net/

  • download

http://zlib.net/
or
http://sourceforge.net/projects/libpng/files/zlib/1.2.7/zlib-1.2.7.tar.gz/download

  •   build and install ( cross compile )

configure command does not include CC configuration.
You must put CC and others directly

$ CC=arm-none-linux-gnueabi-gcc AR=arm-none-linux-gnueabi-ar RANLIB=arm-none-linux-gnueabi-ranlib ./configure --shared --prefix=$PWD/build

make
make install


2012년 7월 7일 토요일

2012년 7월 5일 목요일

LZO build and install


  • Introduction


LZO is a data compression library which is suitable for data de-/compression in real-time. This means it favours speed over compression ratio.
LZO is written in ANSI C. Both the source code and the compressed data format are designed to be portable across platforms.
LZO is lossless compression algorithm
LZO is using in ubifs
  • official home

http://www.oberhumer.com/

  • download

http://www.oberhumer.com/opensource/lzo/

  • build and install ( cross compile )

./configure --host=arm-none-linux-gnueabi --prefix=/targetnfs/usr
make
make install

sometimes you need to contain this lib in toolchain

./configure --host=arm-none-linux-gnueabi --prefix=/opt/toolchains/arm-2009q1/usr/
make
make install

2012년 7월 4일 수요일

mtd-utils build and install


  • officail homepage


http://www.linux-mtd.infradead.org/index.html

  • download


ftp://ftp.infradead.org/pub/mtd-utils/
or
git clone git://git.infradead.org/mtd-utils.git mtd-utils

  • configure and build for cross compile


mtd-utils does not supprot configure.
You must modify Makefile of commom.mk directlry

In common.mk defines CC

CC := $(CROSS)gcc
AR := $(CROSS)ar
RANLIB := $(CROSS)ranlib


just add variable CROSS on top of common.mk for example

CROSS :=arm-none-linux-gnueabi-

  • Install


In Makefile instill DIR defined as DESTDIR

install:: $(addprefix $(BUILDDIR)/,${BINS}) ${SCRIPTS}
        mkdir -p ${DESTDIR}/${SBINDIR}
        install -m 0755 $^ ${DESTDIR}/${SBINDIR}/
        mkdir -p ${DESTDIR}/${MANDIR}/man1
        install -m 0644 mkfs.jffs2.1 ${DESTDIR}/${MANDIR}/man1/
        -gzip -9f ${DESTDIR}/${MANDIR}/man1/*.1


Do below commnad

$ make install  DESTDIR=/home/user/mtd/install

finally you can do as below

$ make CROSS=arm-none-linux-gnueabi- DESTDIR=/home/user/mtd/install all install

  • build error handling


sometimes it can return errors, because of cross compiler restriction

$ error: sys/acl.h: No such file or directory

It means your cross toolchanin does not support ACL.
mtd-util has build option for this

$ make CROSS=arm-none-linux-gnueabi- WITHOUT_XATTR=1

The access control list(ACL) enables higher flexible access control based on UNIX users and groups than traditional user/group/others model. '--with-xattr' or '--with-posix-acl' options on mkfs.jffs2 enables to
copy the ACLs associated with any files in host environment into jffs2 image file. The purpose of this feature is improvement of security in embedded region.

refer to http://lists.infradead.org/pipermail/linux-mtd/2006-November/016814.html

error: lzo/lzo1x.h: No such file or directory

There is an option build without LZO
But it does not works properly, also LZO must be needed because ubifs includes LZO

$make CROSS=arm-none-linux-gnueabi- WITHOUT_XATTR=1 WITHOUT_LZO=1

It will cause build error also in ubifs related package
Refer to http://dokyunblog.blogspot.kr/2012/07/introduction-lzo-is-data-compression.html
Contain LZO lib in toolchain.


ethtool build and install


ethtool is a small utility for examining and tuning your ethernet-based
network interface. 

dowload


http://sourceforge.net/projects/gkernel/files/ethtool/ --> old version
https://ftp.kernel.org/pub/software/network/ethtool/ --> current & latest version


configure


$ ./configure --host=arm-none-linux-gnueabi
$ ./configure --host=arm-none-linux-gnueabi --prefix=/targetnfs/durota/rfs/usr

build


$ make
$ make install

2012년 6월 5일 화요일

DMA related kernel APIs

dma_map_single
  ==> map DMA address for virtual memory,
  ==>use kmalloc if continuous memory is not enough, it returens fail
dma_unmap_single
  ==> free memory by allocating dma_map_single
dma_alloc_cohernet
  ==> allocate coherent memory for DMA
  ==> it allocates memory in conherent area,
  ==> refer to memory.h in architecture
  ==> it can be decided by CONSISTENT_DMA_SIZE

other APIs
  ==> dma_pool_create
  ==> dma_pool_alloc
  ==> dma_pool_free
  ==> dma_pool_destory
  ==> dma_alloc_writecombine

Also you can decide dma memory attributes by using kernel APIs

For more detail,  refer to dma-api.txt in kernel doc

condiserations when you alloc DMA memory

1. allocate meory in coherent area ?
2. use memory as like pool?
3. how mush you are using coherent memory
4. swap area is used or not

But everytime you can not have enough memory......if you have, it's not real

2011년 12월 26일 월요일

inetutil cross compile - ( telnetd )

inetutil includes various network utils
such as telnet client, telnet daemon, tftp, and so on

download  source code

http://ftp.gnu.org/gnu/inetutils/

untar inetutils-1.8.tar.gz

and configure

# ./configure --host=arm-none-linux-gnueabi --build=i686 --prefix=/usr/bin
# make

I have compile error while building ifconfig,
just disable ifconfig then succeeded

# ./configure --host=arm-none-linux-gnueabi --build=i686 --prefix=/usr/bin --disable-ifconfig
# make

if you want to find other tool that is not included in inetutils
try to find net-tools

http://sourceforge.net/projects/net-tools/