User:Maartenweyn

From Openmoko

Jump to: navigation, search

Contents

Flashing your phone

My current configuration:
boot: http://people.openmoko.org/andy/qi-s3c2442-master-hist_3b8513d8b3d9615e.udfu
kernel: uImage-gta02-mwester-stable-d6f9fd270943fb22.bin
rootfs: http://dashi-x02.karadog.net/~lihouyu/qtextended/4.4.3/qt-extended-4.4.3-rootfs.jffs2

for info how to flash your device go to http://wiki.openmoko.org/wiki/Dfu-util#Phrasebook


Building QtExtended 4.4.1 SDK From Scratch

Install Ubuntu 8.10, then in console:

sudo aptitude update
sudo aptitude upgrade
sudo aptitude install kde-devel
sudo aptitude install kde-devel-extras
sudo aptitude install qt4-dev-tools
sudo aptitude install g++
sudo aptitude install thttpd
sudo aptitude install patch
cd /opt
wget http://qtextended.org/downloads/toolchains/arm920t-eabi.tgz
tar xzvf arm920t-eabi.tgz /
mkdir /opt/Qtopia
cd /opt/Qtopia
wget http://qtextended.org/downloads/release/qt-extended-opensource-src-4.4.1.tar.gz
tar xvzf qt-extended-opensource-src-4.4.1.tar.gz
mkdir build
cd build
export QTOPIA_DEPOT_PATH=/opt/Qtopia/qt-extended-4.4.1
$QTOPIA_DEPOT_PATH/configure  -device neo

export PATH+=:/opt/toolchans/arm920t-eabi/bin/

apply ubuntu8.10 patch:

Index: qt-extended-4.4.1/src/libraries/qtopiabase/qmemoryfile_unix.cpp
===================================================================
--- qt-extended-4.4.1/src/libraries/qtopiabase/qmemoryfile_unix.cpp~ 2009-02-16 16:52:12.000000000 +0100
+++ qt-extended-4.4.1/src/libraries/qtopiabase/qmemoryfile_unix.cpp 2009-02-16 16:52:12.000000000 +0100
@@ -127,7 +127,7 @@
         int f = ::open(tmpFile.toLatin1(), O_WRONLY);
 
         if (!f)
-            f = ::open(tmpFile.toLatin1(), O_CREAT | O_WRONLY);
+            f = ::open(tmpFile.toLatin1(), O_CREAT | O_WRONLY, (S_IRUSR|S_IWUSR));
 
         if (f){
             fstat(f, &st);


bin/qbuild
bin/qbuild image
bin/qbuild sdk

mkdir /opt/Qtopia/SDK/4.4.1 -p
/opt/Qtopia/build$ ln -s /opt/Qtopia/build/scripts/sdk/scripts/ /opt/Qtopia/SDK/scripts
cp /opt/Qtopia/SDK/scripts/devel- /opt/Qtopia/SDK/scripts/devel-neo.sh
echo "Device: neo" > /opt/Qtopia/SDK/versioninfo
ln -s /opt/Qtopia/build/ /opt/Qtopia/SDK/4.4.1/neo
ln -s /opt/Qtopia/build/sdk/ /opt/Qtopia/build/sdk/sdk 
cp $QTOPIA_DEPOT_PATH/bin/mkPackages /opt/Qtopia/SDK/scripts

add the following code in front of /opt/QtExtended/build/scripts/sdk/functions:

#!/bin/bash
version()
{
echo "4.4.1"
}
qt_version()
{
echo "4.4.3"
}
#!/bin/sh

Adapt system config to have usb networking ready http://wiki.openmoko.org/wiki/USB_Networking#Debian.2C_Ubuntu_and_others

if after sdk -i your neo says it can't find the ip of the host use the patch:

Index: /opt/Qtopia/SDK/scripts/functions
===================================================================
--- /opt/Qtopia/SDK/scripts/functions~ 2009-02-17 10:57:14.000000000 +0100
+++ /opt/Qtopia/SDK/scripts/functions 2009-02-17 10:57:14.000000000 +0100
@@ -57,7 +57,7 @@
 {
   if [ -n "$HOSTDEVNODE" ] ; then
     # prints host ip address
-    /sbin/ifconfig eth0|grep inet[^6]|awk 'BEGIN{FS=":"}{print $2}'|awk '{print $1}'
+    /sbin/ifconfig usb0|grep inet[^6]|awk 'BEGIN{FS=":"}{print $2}'|awk '{print $1}'
   fi
 }

Buidling QtExtended 4.4.2 SDK From Scratch

Install Ubuntu 8.10, then in console:

sudo aptitude update
sudo aptitude upgrade
sudo aptitude install kde-devel
sudo aptitude install kde-devel-extras
sudo aptitude install qt4-dev-tools
sudo aptitude install g++
sudo aptitude install thttpd
sudo aptitude install patch

Based upon: http://wiki.openmoko.org/wiki/User:Radagast#Qt_Extended_SDK

cd /opt
wget http://qtextended.org/downloads/toolchains/arm920t-eabi.tgz
tar xzvf arm920t-eabi.tgz /
mkdir /opt/QtExtended
mkdir /opt/QtExtended/build
cd /opt/QtExtended
wget http://qtextended.org/downloads/release/qt-extended-opensource-src-4.4.2.tar.gz
tar xvzf qt-extended-opensource-src-4.4.2.tar.gz

export QTOPIA_DEPOT_PATH=/opt/QtExtended/qt-extended-4.4.2
export QPEDIR=/opt/QtExtended/build

Next download a pair of patches from mwester's openmoko stuff: pkg-config-template.patch and qmemoryfile_unix_open_args.patch. Copy these to the qt-extended-4.4.2 source directory:

cd $QTOPIA_DEPOT_PATH
wget http://moko.mwester.net/download/pkg-config-template.patch
wget http://moko.mwester.net/download/qmemoryfile_unix_open_args.patch 

then execute these commands:

patch -p1 < qmemoryfile_unix_open_args.patch
patch -p1 < pkg-config-template.patch


Now change directory to the build directory. Execute the following:

cd $QPEDIR
$QTOPIA_DEPOT_PATH/configure -device neo -D _FORTIFY_SOURCE=0
make
make install
make sdk

Fixing the paths of the SDK:

mkdir /opt/Qtopia/SDK/4.4.2 -p
ln -s /opt/QtExtended/build/scripts/sdk/scripts/ /opt/Qtopia/SDK/scripts
mv /opt/Qtopia/SDK/scripts/devel- /opt/Qtopia/SDK/scripts/devel-neo.sh
echo "Device: neo" > /opt/Qtopia/SDK/versioninfo
ln -s /opt/QtExtended/build/ /opt/Qtopia/SDK/4.4.2/neo
ln -s /opt/QtExtended/build/sdk/ /opt/QtExtended/build/sdk/sdk 
cp $QTOPIA_DEPOT_PATH/bin/mkPackages /opt/Qtopia/SDK/scripts/

add the following code in front of /opt/Qtopia/SDK/scripts/functions

#!/bin/bash
version()
{
echo "4.4.2"
}
qt_version()
{
echo "4.4.3"
}
#!/bin/sh


open /opt/Qtopia/SDK/scrips/sdk and '= "1"' at line 253 to '> "0"' to have sdk -r working again

Adapt system config to have usb networking ready http://wiki.openmoko.org/wiki/USB_Networking#Debian.2C_Ubuntu_and_others

Start developping

To deploy example to Neo

copy the files of the example in a directory, then:

source /opt/Qtopia/SDK/scripts/devel-neo.sh
qtopiamake
make clean
make
sdk -p
sdk -i

Deploy your own program

Make sure your pro file is called qbuild.pro and make sure it contains all necessary data (this changed towards Qtopia, since qbuild.bin is now used). More info can be found on: http://swik.net/Qtopia+qt

Personal tools