2012년 7월 23일 월요일

Required packages for android

Flex : http://flex.org/

flex is a software development kit for the development (SDK) deployment of cross-platform rich Internet applications based on the Adobe Flash platform

Bison : http://www.gnu.org/software/bison/

Bison is a general-purpose parser generator that converts an annotated context-free grammar into a deterministic LR or generalized LR (GLR) parser employing LALR(1) parser tables

gnupg : http://www.gnupg.org/

GnuPG is the GNU project's complete and free implementation of the OpenPGP standard as defined by RFC4880 . GnuPG allows to encrypt and sign your data and communication, features a versatile key management system as well as access modules for all kinds of public key directories

gperf : http://www.gnu.org/software/gperf/

GNU gperf is a perfect hash function generator

curl : http://curl.haxx.se/

cURL is a computer software project providing a library and command-line tool for transferring data using various protocols. The cURL project produces two products, libcurl and cURL. It was first released in 1997
TBD

2012년 7월 21일 토요일

Set up basic development enviroment on ubuntu

  • install ssh

$ apt-get install openssh-server

  • install samba server

$ apt-get install samba

 add user
$ smbpasswd -a [user]

edit /etc/samba/smb.conf for adding smb configuration for new user
for example
 [dokyun]
   comment = dokyun private
   browseable = yes
   path = /home2/dokyun
   guest ok = no
   writable = yes
   create mask = 0755

for multi-user add below
  valid users = dokyun redbomb ...

  restart samba server
$smbd restart

  • install build tool

$ apt-get install build-essential

  • vim install

$ apt-get install vim

It fixs the strange operation of special key input on vi

  • install vnc server

It provides gui enviroment for network client

$ apt-get install vnc4server

  create vnc server on 5901 port
$ vnc4server -geometry 1024x768 :1

If you want to see exactly same gui with gnome follow this

1.stop vncserver
2. open ~.vnc/xstartup
3. uncommnet below 2 lines
 unset SESSION_MANAGER
 exec /etc/X11/xinit/xinitrc
4. change 
 exec /etc/X11/xinit/xinitrc
 to
 exec sh /etc/X11/xinit/xinitrc
5. save and exit
6. restart vnc server

  •  install TFTP server

$ apt-get install xinetd
$ apt-get install tftp
$ apt-get install tftpd

Ubutu dose not create /etc/xinetd.d/tftp automatically , in Fedora case it created automatically.
Create and edit /etc/xinetd.d/tftp
Add below

service tftp
{
    socket_type     = dgram
    protocol        = udp
    wait            = yes
    user            = root
    server          = /usr/sbin/in.tftpd
    server_args     = -s /tftpboot
    disable         = no
    per_source      = 11
    cps             = 100 2
    flags           = IPv4
}

restart xinetd
$ /etc/init.d/xinetd restart

  • install NFS server


$ apt-get install nfs-kernel-server

add export directory , add below in /etc/export
/targetnfs *(rw,no_root_squash,no_all_squash,async)

restart nfs server
$ /etc/init.d/nfs-kernel-server restart

  • install ftp server

$ apt-get install vsftpd

edit /etc/vsftpd.conf, uncomment below

local_enable=YES ==> for local user log in
write_enable=YES ==> allow up-load
anonymous_enable=NO ==> do not allow anonymous log in

restart ftp server
$ /etc/init.d/vsftpd restart

2012년 7월 15일 일요일

Setup Android build enviroment ( ubuntu 10.04, 12.04 )

  • linux version

Android recommand ubuntu 10.04 LTS 64bits.
Actually, android can not be built under 32bits linux version.

  • Check the tool version

$make -v
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
이 프로그램은 자유소프트웨어입니다; 복사조건은 소스를 참고하십시오.
상품성이나 특정 목적에 대한 적합성을 비롯하여, 어떠한 보증도 하지
않습니다
This program built for x86_64-pc-linux-gnu

$ python -V
Python 2.6.5

$ git --version
git version 1.7.0.4

$ java -version
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
Java HotSpot(TM) 64-Bit Server VM (build 17.0-b16, mixed mode)

refer to http://source.android.com/source/initializing.html

  • Intall JDK6


According to http://source.android.com/source/initializing.html

sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk

But it's not works

use below

sudo add-apt-repository ppa:sun-java-community-team/sun-java6
sudo apt-get update
sudo apt-get install sun-java6-jdk

For  ubuntu 12.04 LTS

  •  Install JDK 7

$ sudo apt-get update
$ sudo apt-get install openjdk-7-jdk

  •  Install other packages


sudo apt-get install zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev
$ sudo apt-get install libx11-dev:i386 libreadline6-dev:i386
$ sudo apt-get install libgl1-mesa-glx:i386
 => it might be a problem
 => install libgl1-mesa-dri:i386 instead of this
$ sudo apt-get install libgl1-mesa-dev g++-multilib mingw32 tofrodos
$ sudo apt-get install python-markdown libxml2-utils xsltproc zlib1g-dev:i386
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

  • For ADB debugging

Create /etc/udev/rules.d/51-android.rules
and add which device you have as like below

# adb protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e12", MODE="0600", OWNER="<username>"
# fastboot protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0fff", MODE="0600", OWNER="<username>"
#LG
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666"

2012년 7월 11일 수요일

simple usage of devmem


  • Introduction

/dev/mem represents the phyical memory.
devmem uses /dev/mem and gives convenience for accessing memory io directly on console

Download devmem2.c from anywhere then cross-compile

arm-none-linux-gnueabi-gcc -c devmem2.c -o devmem

  • usage

./devmem [ADDRESS]
./devmem [ADDRESS] w [VALUE]


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