2011년 6월 7일 화요일

Qt-Extendded-4.4.3 (Qtopia Phone Edition) 포팅 가이드

       
 
이 매뉴얼은 JK전자(JK Electronics) 에 의해서 번역, 수정, 작성 되었고 소유권 또한
JK전자(JK Electronics)
의 것입니다. 소유권자의 허가를 받지 않고 무단으로 수정, 삭제하거나 배포 할 수 없습니다.

제품 구매 : http://www.toolparts.co.kr
 

S3C6410 Start Kit Qt-Extendded-4.4.3 (Qtopia Phone Edition) Porting Guide


 

* Update history

- 2011.4.18 : 초기 Release


  이 메뉴얼은 Qtopia-2.2.0, Qt-Extendded-4.4.3 (Qtopia Phone Edition), Qt 4.7.0를 S3C6410 Start Kit 개발보드에 포팅하는 일반적인 방법에 대한 내용을 설명하는 메뉴얼 입니다.

1. Qt-Extended 4.4.3

Qt-Extended4.4.3 를 PC버젼과 ARM버젼으로 컴파일 하는 방법과 ARM개발보드에서 실행하는 방법에 대해서 설명 합니다. 참고로 Qt-Etended는 4.4.3에서 더이상 노키아에서 지원을 하지 않을 예정이고 Qt SDK 라이브러리에 통합 된다고 합니다.

qt-extended-opensource-src-4.4.3.tar.gz : Qt-Extended4.4.3 source code


1.1 Installs Qt-Extended4.4.3 source code

qt-extended-opensource-src-4.4.3.tar.gz 파일을 "/opt" 디렉토리에 복사 합니다. "/opt/mini6410/qt-extended4.4.3" 디렉토리를 생성하고 이동한 후에 압축을 해제 합니다.

# mkdir -p /opt/mini6410/qt-extended4.4.3
# cd /opt/mini6410/qt-extended4.4.3
# tar xvzf /opt/qt-extended-opensource-src-4.4.3.tar.gz

1.2 Compile Qt-Extended4.4.3 for X86

X86에디션을 위한 빌드디렉토리를 생성 합니다.

# mkdir -p /opt/mini6410/qt-extended4.4.3/buildx86


컴파일을 수행하기 전에 먼저 아래와 같이 컨피규레이션을 수행 합니다.

# export LC_CTYPE="en_US"
# export LANG="en_US"
# export LANGUAGE="en_US"

# cd /opt/mini6410/qt-extended4.4.3/buildx86
# echo yes | ../qt-extended-4.4.3/configure \
-ui-type mobile \
-release \
-clean \
-sound-system alsa \
-build-qt \
-no-sxe \
-no-ssl \
-no-v4l2 \
-no-vpn \
-no-phonon \
-no-libamr \
-dynamic-rotation \
-mediaengines cruxus \
-remove-mediaengine gstreamer,helix \
-pictureflow \
-remove-module bluetooth,drm \
-no-dbus \
-no-dbusipc \
-add-displaysize 240x320 \
-extra-qt-embedded-config "-qt-freetype -no-webkit -no-dbus -qt-gfx-transformed -qt-gfx-linuxfb" \
-extra-qt-config "-no-webkit" \
2>&1 | tee ../qtopiaconfig.log

컨피규레이션을 수행할때 처음에는 언어 설정을 "en_US" 로 합니다. 왜냐하면 Fedora9 의 기본 인코딩 설정이 "en_US.UTF-8" 로 되어 있기 때문 입니다. 언어 설정은 나중에 Qt-Extended4.4.3 compile script 에서 다시 설정 할 수 있습니다. 명령행 인자의 더 자세한 설명은 "../qt-extended-4.4.3/configure -help" 로 확인 하시기 바랍니다. 아래 명령으로 실제로 컴파일을 하고 설치 합니다.

# bin/qbuild 2>&1 | tee ../qtopiamake.log
# bin/qbuild image


"2>&1 | tee ../XXX.log" 의 의미는 컴파일 결과믜 모든 내용을 파일로 저장 한다는 의미 입니다.

1.3 Run Qt-Extended4.4.3 for X86

컴파일이 완료된 Qt-Extended4.4.3는 "runqtopia" 스크립트로 실행 할 수 있습니다.


# cd /opt/mini6410/qt-extended4.4.3/buildx86
# bin/runqtopia


Qt-Extended4.4.3가 PC에서 실행된 화면 입니다.

qtopiaqtopia

1.4 Compile Qt-Extended4.4.3 for ARM

ARM 개발보드용 컴파일을 위한 빌드디렉토리를 생성 합니다.

# mkdir -p /opt/mini6410/qt-extended4.4.3/buildarm


컴파일을 수행하기 전에 먼저 아래와 같이 컨피규레이션을 수행 합니다.

# export LC_CTYPE="en_US"
# export LANG="en_US"
# export LANGUAGE="en_US"

# cd /opt/mini6410/qt-extended4.4.3/buildarm
# echo yes | ../qt-extended-4.4.3/configure \
-ui-type mobile \
-xplatform linux-arm-g++ \
-arch arm \
-release \
-clean \
-prefix /opt/Qtopia4.4.3 \
-sound-system oss \
-build-qt \
-no-sxe \
-no-ssl \
-no-v4l2 \
-no-vpn \
-no-phonon \
-no-libamr \
-dynamic-rotation \
-mediaengines cruxus \
-remove-mediaengine gstreamer,helix \
-pictureflow \
-remove-module bluetooth,drm \
-no-dbus \
-no-dbusipc \
-add-displaysize 240x320 \
-extra-qt-embedded-config "-embedded arm -xplatform qws/linux-arm-g++ -no-cups -nomake examples -nomake demos -qt-libjpeg -qt-libmng -qt-libpng -no-dbus -depths 16,32 -qt-gfx-linuxfb -qt-gfx-transformed -no-gfx-qvfb -no-gfx-vnc -no-gfx-multiscreen -qt-kbd-tty -no-kbd-usb -no-kbd-sl5000 -no-kbd-yopy -no-kbd-vr41xx -no-kbd-qvfb -qt-mouse-tslib -no-webkit -no-openssl -no-phonon -no-phonon-backend -no-nas-sound -no-exceptions -svg" \
-extra-qt-config "-no-webkit" \
2>&1 | tee ../qtopiaconfig.log

컨피규레이션을 수행할때 처음에는 언어 설정을 "en_US" 로 합니다. 왜냐하면 Fedora9 의 기본 인코딩 설정이 "en_US.UTF-8" 로 되어 있기 때문 입니다. 언어 설정은 나중에 Qt-Extended4.4.3 compile script 에서 다시 설정 할 수 있습니다. 명령행 인자의 더 자세한 설명은 "../qt-extended-3.4.3/configure -help" 로 확인 하시기 바랍니다. 아래 명령으로 실제로 컴파일을 하고 설치 합니다.

컴파일을 수행하기 전에 최신이 컴파일러를 사용하기 위해서 몇가지 소스 코드를 수정해야 합니다. 그렇지 않고 그냥 컴파일을 하면 아래와 같이 Syntax 에러가 발행 합니다.

/opt/mini6410/qt-extended4.4.3/qt-extended-4.4.3/src/libraries/qtopia/qphoneprofile.cpp:1026:1: error: 'QPhoneProfile::Schedule::Schedule' names the constructor, not the type

컴파일 에러를 해결하기 위해서 qphoneprofile.cpp 파일의 1026 라인을

QPhoneProfile::Schedule::Schedule &QPhoneProfile::Schedule::operator=(const Schedule &other)

아래와 같이 수정 합니다.

QPhoneProfile:: Schedule &QPhoneProfile::Schedule::operator=(const Schedule &other)

그리고 나서 컴파일을 합니다.

# bin/qbuild 2>&1 | tee ../qtopiamake.log
# bin/qbuild image

컴파일이 성공적ㅇ로 완료되면 "/opt/mini6410/qt-extended4.4.3/buildarm/image" 디렉토리에 바이너리 파일이 생성 됩니다.

1.5 Run Qt-Extended4.4.3 for ARM

위에헛 컴파일한 이미지 파일을 압축 하고 SD 메모리 카드에 복사 합니다.


# cd /opt/mini6410/qt-extended4.4.3/buildarm/
# tar cvzf image.tgz image


SD메모리 카드를 개발보드에 삽입하고 개발보드에 압축을 해제해서 설치 합니다.

# rm /opt/Qtopia4.4.3 -rf
# cd /opt
# tar xvzf /sdcard/image.tgz
# mv /opt/image /opt/Qtopia4.4.3


qt-extended4.4.3을 실행하기 위해서는 Qtopia2.2.0 or Qt4.7의 실행을 종료 하고 실행 해야 합니다. Qt 2.2.0을 종료하는 방법은 "3.4.4 Qt4.7.0을 개발보드에서 실행" 절을 참조하시기 바랍니다.

실행을 편하게 하기 위해서 "run_my_qtopia4" 스크립트를 미리 작성해 두었습니다.

# vi /bin/run_my_qtopia4

#!/bin/sh

if [ -e /etc/friendlyarm-ts-input.conf ] ; then
. /etc/friendlyarm-ts-input.conf
fi

true ${TSLIB_TSDEVICE:=/dev/touchscreen}

TSLIB_CONFFILE=/etc/ts.conf

export TSLIB_TSDEVICE
export TSLIB_CONFFILE
export TSLIB_PLUGINDIR=/usr/lib/ts
export TSLIB_CALIBFILE=/etc/pointercal

export QTDIR=/opt/Qtopia4.4.3
export QPEDIR=/opt/Qtopia4.4.3
export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib:/usr/local/lib:$LD_LIBRARY_PATH

if [ -c /dev/touchscreen ]; then
export QWS_MOUSE_PROTO="Tslib:${TSLIB_TSDEVICE}"
if [ -e /etc/pointercal -a ! -s /etc/pointercal ] ; then
rm /etc/pointercal
fi

else

export QWS_MOUSE_PROTO="USB:/dev/input/mice" >/etc/pointercal
fi

export QWS_KEYBOARD="TTY:/dev/tty1"
#export QWS_DISPLAY="Transformed:mmWidth66:mmHeight114:Rot90:0"

FB_SIZE=$(cat /sys/class/graphics/fb0/virtual_size)

case "$FB_SIZE" in 800,480)

export QWS_DISPLAY="LinuxFb:mmWidth91:mmHeight53:1" ;; 480,272)
export QWS_DISPLAY="LinuxFb:mmWidth76:mmHeight44:1" ;; *)
export QWS_DISPLAY="LinuxFb:mmWidth91:mmHeight53:1" ;; esac
export LANG="en_US"
export HOME=/root/Qtopia4Home

if [ ! -e $HOME ]; then
mkdir -p $HOME;
fi
if [ ! -e /usr/share ]; then
mkdir /usr/share;
fi
if [ ! -e /usr/share/zoneinfo ]; then
ln -s /opt/Qtopia/etc/zoneinfo /usr/share/;
fi
if [ ! -e $HOME/Settings/Trolltech/qpe.conf ]; then
mkdir -p $HOME/Settings/Trolltech/
cp $QPEDIR/etc/default/Trolltech/qpe.conf

$HOME/Settings/Trolltech/qpe.conf -f
fi

export QTOPIA_PHONE_DUMMY=1
exec $QPEDIR/bin/qpe



run_my_qtopia4 스크립트 수행 내역 입니다.

a) 터시 스크린 라이브러리 tslib parameters를 설정 합니다.
b) Set Qtopia environment variables
- QTDIR, QPEDIR : Qtopia Image path configuration
- QWS_MOUSE_PROTO : touch screen devices
- QWS_KEYBOARD : Hard Key points to the development board for the tty device.
c) set the environment variable configuration
- QWS_DISPLAY LCD display parameters, according to the different screen resolution, set a different DPI, the text size of the display medium.
d) GSM Modem을 사용하지 않는 경우에 QTOPIA_PHONE_DUMMY = 1 설정은 필요하지 않습니다.
e) 마지막으로 Qtopia를 실행 합니다.

"run_my_qtopia4" 파일에 실행 권한을 부여하고 시스템 부팅시 자동으로 시작 되도록 하기 위해서는 "/etc/init.d/rcS" 파일에 등록을 합니다.

# chmod +x /bin/run_my_qtopia4
# vi /etc/init.d/rcS

"/bin/qtopia &" 의 내용(Qtopia 2.2.0 실행) 부분을 "/bin/run_my_qtopia4 &" 로 수정 합니다. 이렇게 하면 시스템 부팅시 자동으로 "Qt-Extended4.4.3" 가 실행 됩니다.


       
       

댓글 없음:

댓글 쓰기