2012년 10월 31일 수요일

ubuntu svn server install ( over apache )


I installed svn server under ubuntu LTS 10.04 64 bits

SVN Server Setup

1. install essentail packages
#  sudo apt-get install subversion libapache2-svn apache2

2. create repository
 # svnadmin create /home3/swmgr/tmpsvn/sample

3. configure conf file
open  /home3/swmgr/tmpsvn/sample/conf/svnserve.conf
then uncommnet belows
 auth-access = write ==> set permission
 password-db = passwd ==> indicate passward file

open /home3/swmgr/tmpsvn/sample/conf/passwd
then add user and passward

[users]
user = passwd
dokyun = hellscream

4. start svn server
 svnserve -d -r /home3/swmgr/tmpsvn/sample

5. check
# svn checkout svn://192.168.0.4 ./svn
 or
# svn checkout svn://localhost ./svn

if  ,,, /db/txn-current-lock': Permission denied  error happens when svn access
check the directory permission.
$ chmod -R 775 /home3/swmgr/tmpsvn/sample


SVN over Apache


1. set directory owner
 # sudo chown -R www-data /home3/swmgr/tmpsvn/sample/

2. configure
 open /etc/apache2/mods-enabled/dav_svn.conf
 then add

<Location /svn>
  DAV svn
  SVNPath /home3/swmgr/tmpsvn/sample
  AuthType Basic
  AuthName "Subversion Repository"
  AuthUserFile /etc/apache2/dav_svn.passwd
  Require valid-user
</Location>

3. add user
# sudo htpasswd2 -cm /etc/apache2/dav_svn.passwd dokyun
 or
# sudo htpasswd -cm /etc/apache2/dav_svn.passwd dokyun

4. restart apache
 sudo /etc/init.d/apache2 restart
5. check





2012년 9월 18일 화요일

sulogin: no password entry for root


default console device is not set properly in inittab
Set tty device in inittab , for example

if console was set as

::respawn:/sbin/getty 115200 ttyO0

in inittab and you started with ttyO2,  then

sulogin: no password entry for root

message shows

set

::respawn:/sbin/getty 115200 ttyO2

you can log in properly

2012년 8월 26일 일요일

Building Android system


Move to android root directory.

Set up buildenv as below

dokyun@android$
dokyun@android$ source ./build/envsetup.sh
including device/samsung/maguro/vendorsetup.sh
including device/samsung/tuna/vendorsetup.sh
including device/ti/panda/vendorsetup.sh
including sdk/bash_completion/adb.bash
dokyun@android$

Set up build target as below
$ lunch [Build-name]-[build type]

build name is target device name such as panda or maguro
build type is build configuration such as debugging option or limitation.

currently I do not have special target , select emulator for build-name , eng for build-type

dokyun@android$ lunch full-eng
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.0.1
TARGET_PRODUCT=full
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=ITL41D
============================================
dokyun@android$

then build

dokyun@android$ make -j4

It can takes more than 1 hour at first build , it depends on your build system

You can also select manually the target board as like below

dokyun@android$ lunch
You're building on Linux
Lunch menu... pick a combo:
     1. full-eng
     2. full_x86-eng
     3. vbox_x86-eng
     4. full_maguro-userdebug
     5. full_tuna-userdebug
     6. full_panda-eng
Which would you like? [full-eng] 6
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.0.1
TARGET_PRODUCT=full_panda
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=ITL41D
============================================
dokyun@android$ make -j4



2012년 8월 19일 일요일

Adroid Source Code Download


  • Installing repo


Repo is a tool that makes it easier to work with Git in the context of Android.

$ mkdir ~/bin
$ PATH=~/bin:$PATH

$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

As you can see , it just get repository related script form https://dl-ssl.google.com/dl/googlesource/git-repo/repo and make excutable

  • Initializing a Repo client

First make working directory, in my case

$ mkdir ~/android
$ cd ~/android

then initialize repository.

$ repo init -u https://android.googlesource.com/platform/manifest

It shows below error at first time

-----------------------------------------------------------------------
*** Please tell me who you are.
Run
  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: empty ident  <dokyun@redbomb-server.(none)> not allowed-----------------------------------------------------------------------

as you can see on the error message, type your email and name

$ git config --global user.email "dokyun.beon@gmail.com"
$ git config --global user.name "dokyun beon"

then excute again
$ repo init -u https://android.googlesource.com/platform/manifest
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1
$ repo sync

as you can see, down load is done
-----------------------------------------------------------------------
dokyun@android$ ls
Makefile  bionic    build  dalvik       device  external    hardware  ndk       prebuilt  system
abi       bootable  cts    development  docs    frameworks  libcore   packages  sdk
dokyun@android$
-----------------------------------------------------------------------

refer to official home more detail.

http://source.android.com/source/downloading.html

2012년 8월 4일 토요일

exporting kernel headers- headers_install


  • command for exporting kernel headers in user space
make headers_install ARCH=arm INSTALL_HDR_PATH=/usr/include

  • how to include headers for headers_install
Add headers in Kbuild under {kernel_source_dir}/include/
header-y += {header_file_name.h}

For more detail, refer to headers_install.txt





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월 17일 화요일

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

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