2011/01/28

dvd+rw-tools-7.1 on Trident pnx84xx



0. Trident pnx84xx build environment is req'd !


1. Get latest dvd+rw-tools from its officical website.


# wget http://fy.chalmers.se/~appro/linux/DVD+RW/tools/dvd+rw-tools-7.1.tar.gz
# tar -zxvf dvd+rw-tools-7.1.tar.gz
# cd dvd+rw-tools-7.1


2. Modify the Makefile.m4 to meet our needs.


# vi Makefile.m4


Search Linux section ...
   :

ifelse(OS,Linux,[
#
# Linux section
#
CC      =arm-linux-gcc
CFLAGS  +=$(WARN) -O2 -D_REENTRANT --sysroot=$(_TMSYSROOT)
CXX     =arm-linux-g++
CXXFLAGS+=$(WARN) -O2 -fno-exceptions -D_REENTRANT --sysroot=$(_TMSYSROOT)
LDLIBS  =-lpthread
LINK.o  =$(LINK.cc)
   :


# make
In file included from growisofs_mmc.cpp:17:
transport.hxx: In member function 'int Scsi_Command::is_reload_needed(int)':
transport.hxx:366: error: 'INT_MAX' was not declared in this scope
gmake[1]: *** [growisofs_mmc.o] Error 1

3. Fix INT_MAX issue.

# vi transport.hxx
   :
#if defined(__unix) || defined(__unix__)
#include <stdio.h>
#include <stdlib.h>
#include <limits.h> /// include for INT_MAX
#include <unistd.h>
#include <string.h>
   :

# make

# file growisofs dvd+rw-format dvd+rw-mediainfo dvd+rw-booktype dvd-ram-control
growisofs:        ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), not stripped
dvd+rw-format:    ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), not stripped
dvd+rw-mediainfo: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), not stripped
dvd+rw-booktype:  ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), not stripped
dvd-ram-control:  ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), not stripped

DONE :)
------
REF: NONE!

live555 on Trident pnx84xx

A modified openRTSP is used to stream IPCAM video streams. Therefore, we need to port openRTSP on the new platform pnx84xx.


0. Prepare build environment for Trident pnx84xx.


cd /PATH/TO/TRIDENT/SRC
source pnx8400_MP_env.sh



1. Download live555 source from official website.
Always get the latest version, and read document for installation first. 
# wget http://www.live555.com/liveMedia/public/live555-latest.tar.gz
# tar -zxvf live555-latest.tar.gz

See "How to configure and build the code on Unix" http://www.live555.com/liveMedia/#config-unix

cd /PATH/TO/LIVE555/SRC

Select config.armlinux as a sample.


# cp config.armlinux config.trident
# vi config.trident
CROSS_COMPILE=         arm-linux-
COMPILE_OPTS =         $(INCLUDES) -I. --sysroot=$(_TMSYSROOT) -O2 -DSOCKLEN_T=socklen_t -DNO_STRSTREAM=1 -DLARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64
C =                    c
C_COMPILER =           $(CROSS_COMPILE)gcc
C_FLAGS =              $(COMPILE_OPTS)
CPP =                  cpp
CPLUSPLUS_COMPILER =   $(CROSS_COMPILE)g++
CPLUSPLUS_FLAGS =      $(COMPILE_OPTS) -Wall -DBSD=1
OBJ =                  o
LINK =                 $(CROSS_COMPILE)g++ -o
LINK_OPTS =            -L. --sysroot=$(_TMSYSROOT)
CONSOLE_LINK_OPTS =    $(LINK_OPTS)
LIBRARY_LINK =         $(CROSS_COMPILE)ld -o
LIBRARY_LINK_OPTS =    $(LINK_OPTS) -r -Bstatic
LIB_SUFFIX =                   a
LIBS_FOR_CONSOLE_APPLICATION =
LIBS_FOR_GUI_APPLICATION =
EXE =

# ./genMakefiel trident
# make

# file mediaServer/live555MediaServer
mediaServer/live555MediaServer: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), not stripped
# file testProgs/openRTSP
testProgs/openRTSP: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), not stripped

DONE :)

------
REF:(--sysroot issue, from google)

ntpclient on Trident pnx84xx

0. Prepare trident build environment
# cd /PATH/TO/TRIDENT/SRC
# source pnx8400_MP_env.sh


1. Download latest ntpclient source codes from official website.



# wget http://doolittle.icarus.com/ntpclient/ntpclient_2010_365.tar.gz
# tar -zxvf ntpclient_2010_365.tar.gz
# cd ntpclient-2010

2. Modify the Makefile for Trident pnx84xx.

# vi Makefile

# A long time ago, far, far away, under Solaris, you needed to
#    CFLAGS += -xO2 -Xc
#    LDLIBS += -lnsl -lsocket
# To cross-compile
CC = arm-linux-gcc
CFLAGS += --sysroot=$(_TMSYSROOT)
LDFLAGS+= --sysroot=$(_TMSYSROOT)

# To check for lint
#    CFLAGS += -Wpointer-arith -Wcast-align -Wcast-qual -Wshadow -Wundef \
#     -Waggregate-return -Wnested-externs -Winline -Wwrite-strings -Wstrict-prototypes

# This is old-school networking code, making the traditional cast between
# struct sockaddr* and struct sockaddr_in*.  Thus a modern gcc needs:
CFLAGS += -fno-strict-aliasing

CFLAGS += -std=c89
CFLAGS += -W -Wall
CFLAGS += -O2
# CFLAGS += -DPRECISION_SIOCGSTAMP
CFLAGS += -DENABLE_DEBUG
CFLAGS += -DENABLE_REPLAY
# CFLAGS += -DUSE_OBSOLETE_GETTIMEOFDAY

LDFLAGS += -lrt

all: ntpclient

test: ntpclient
        ./ntpclient -d -r <test.dat

ntpclient: ntpclient.o phaselock.o

ntpclient.o phaselock.o: ntpclient.h

adjtimex: adjtimex.o

clean:
        rm -f ntpclient adjtimex *.o

# make
arm-linux-gcc --sysroot=/usr/local/apollo/SRC/open_source_archive/linux/toolchains/gnu_cortex-a9_tools -fno-strict-aliasing -std=c89 -W -Wall -O2 -DENABLE_DEBUG -DENABLE_REPLAY   -c -o ntpclient.o ntpclient.c
arm-linux-gcc --sysroot=/usr/local/apollo/SRC/open_source_archive/linux/toolchains/gnu_cortex-a9_tools -fno-strict-aliasing -std=c89 -W -Wall -O2 -DENABLE_DEBUG -DENABLE_REPLAY   -c -o phaselock.o phaselock.c
arm-linux-gcc --sysroot=/usr/local/apollo/SRC/open_source_archive/linux/toolchains/gnu_cortex-a9_tools -lrt  ntpclient.o phaselock.o   -o ntpclient
/usr/local/apollo/SRC/open_source_archive/linux/toolchains/gnu_cortex-a9_tools/lib/libpthread.so.0: warning: the use of `mktemp' is dangerous, better use `mkstemp'

# file ntpclient
ntpclient: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), not stripped

DONE !

PS.
In case you have to use some earlier version, you may have below issue.

ntpclient.o: In function `set_freq':
ntpclient.c:(.text+0x18): undefined reference to `__adjtimex'
ntpclient.o: In function `main':
ntpclient.c:(.text+0xc58): undefined reference to `__adjtimex'
collect2: ld returned 1 exit status
make: *** [ntpclient] Error 1

Try to replace __adjtimex by adjtimex in ntpclient.c

-----

2011/01/08

SVN on CentOS 5.5 i386

Ref:


1. Subvision on CentOS http://wiki.centos.org/HowTos/Subversion
2. http://www.ichiayi.com/wiki/tech/centosinstall


Quick Guide


=== My Guest OS (CentOS 5.5 i386)===


1. Install SVN



# yum install mod_dav_svn subversion
# vim /etc/httpd/conf.d/subversion.conf


---subversion.conf---
      :
LoadModule dav_svn_module     modules/mod_dav_svn.so

LoadModule authz_svn_module   modules/mod_authz_svn.so


<Location /svn>
   DAV svn
   SVNParentPath /var/www/svn


   # Limit write permission to list of valid users.
#   <LimitExcept GET PROPFIND OPTIONS REPORT>
      # Require SSL connection for password protection.
      # SSLRequireSSL


      AuthType Basic
      AuthName "Authorization Realm"
      AuthUserFile /etc/svn-auth-conf
      Require valid-user
#   </LimitExcept>
</Location>
      :
---------------------



Notes:
1. http://server/svn/ will link to your /var/www/svn/
2. user shall be authorized 




2. Add users for svn


*** create AuthUserFile file (-c)

# htpasswd -c /etc/svn-auth-conf user0
New password: 
Re-type new password: 
Adding password for user user0



# cat /etc/svn-auth-conf 
user0:WAeUIXLH.ucGI



*** add new user

# htpasswd /etc/svn-auth-conf user1
New password: 
Re-type new password: 
Adding password for user user1


*** add new user w/o prompt

# htpasswd -b /etc/svn-auth-conf user4 user2pwd
Adding password for user user2




3. Create repos. 


# cd /var/www/
# mkdir svn
# cd svn
# svnadmin create Prj001
# chown -R apache.apache Prj001
# cd Prj001
# tree

.
|-- README.txt
|-- conf
|   |-- authz
|   |-- passwd
|   `-- svnserve.conf
|-- dav
|-- db
|   |-- current
|   |-- format
|   |-- fs-type
|   |-- revprops
|   |   `-- 0
|   |-- revs
|   |   `-- 0
|   |-- transactions
|   |-- uuid
|   `-- write-lock
|-- format
|-- hooks
|   |-- post-commit.tmpl
|   |-- post-lock.tmpl
|   |-- post-revprop-change.tmpl
|   |-- post-unlock.tmpl
|   |-- pre-commit.tmpl
|   |-- pre-lock.tmpl
|   |-- pre-revprop-change.tmpl
|   |-- pre-unlock.tmpl
|   `-- start-commit.tmpl
`-- locks
    |-- db-logs.lock
    `-- db.lock


8 directories, 23 files



# cd

# pwd
/root

# mkdir workspace
# cd workspace/
# mkdir prj1
# cd prj1/tree
# mkdir scr include lib
# echo "# hello" > main.c
# cd ..
# tree

.
`-- prj1
    |-- include
    |-- lib
    |-- main.c
    `-- scr


4 directories, 1 file

# cd prj1
# svn import . file:///var/www/svn/Prj001/ -m "Prj001 Original"
新增           include
新增           main.c
新增           lib
新增           scr

送交修訂版 1.

X. Don't forget to restart Apache

# /sbin/service httpd restart
# /sbin/chkconfig httpd on




=== My Host OS (Ubuntu 10.10)===



1. Check project from server



yenping@TenTen:~/svnwork$ svn co http://192.168.1.8/svn/Prj001
認證領域: <http://192.168.1.8:80> Authorization Realm
'yenping' 的密碼: ********
A    Prj001/include
A    Prj001/main.c
A    Prj001/lib
A    Prj001/scr
取出修訂版 1.



yenping@TenTen:~/svnwork$ tree
.
`-- Prj001
    |-- include
    |-- lib
    |-- main.c
    `-- scr


4 directories, 1 file


yenping@TenTen:~/svnwork$ cd Prj001/
yenping@TenTen:~/svnwork/Prj001$ svn log
------------------------------------------------------------------------
r1 | root | 2011-01-08 11:21:25 +0800 (六, 08  1月 2011) | 1 line

Prj001 Original
------------------------------------------------------------------------

2. Commit file

yenping@TenTen:~/svnwork/Prj001$ vim main.c 
yenping@TenTen:~/svnwork/Prj001$ svn diff
Index: main.c
===================================================================
--- main.c (revision 1)
+++ main.c (working copy)
@@ -1 +1,10 @@
-# hello
+//# hello
+
+#include <stdio.h>
+
+int main(int argc, char **argv)
+{
+    printf("Hello SVN World.\n");
+
+}
+
yenping@TenTen:~/svnwork/Prj001$ svn ci -m"complete main()"
傳送           main.c
傳送檔案資料 .
送交修訂版 2.
yenping@TenTen:~/svnwork/Prj001$ svn log
------------------------------------------------------------------------
r1 | root | 2011-01-08 11:21:25 +0800 (六, 08  1月 2011) | 1 line

Prj001 Original
------------------------------------------------------------------------
yenping@TenTen:~/svnwork/Prj001$ svn update
於修訂版 2.
yenping@TenTen:~/svnwork/Prj001$ svn log
------------------------------------------------------------------------
r2 | yenping | 2011-01-08 11:43:57 +0800 (六, 08  1月 2011) | 1 line

complete main()
------------------------------------------------------------------------
r1 | root | 2011-01-08 11:21:25 +0800 (六, 08  1月 2011) | 1 line

Prj001 Original
------------------------------------------------------------------------
 :
 :
 :
(to be continued...)