Difference between revisions of "Nokia N810"

From ThorstensHome
Jump to: navigation, search
m (1 revision(s))
 
(47 intermediate revisions by one user not shown)
Line 1: Line 1:
 
This article describes how to compile software for the ARM-based Nokia N810 tablet PC. We use mainly scratchbox on an Intel-based computer. Scratchbox is a cross-compiling environment.  
 
This article describes how to compile software for the ARM-based Nokia N810 tablet PC. We use mainly scratchbox on an Intel-based computer. Scratchbox is a cross-compiling environment.  
  
= On the Nokia itself =
+
Better see http://techbase.kde.org/Projects/Maemo/kdepim
 +
Also look at Xephyr.
  
== install subversion ==
+
= Warning =
* to install openssh on a nokia 810
+
Do not follow
* activate the maemo repository in the package manager
+
http://talk.maemo.org/showthread.php?t=6737
 +
with the latest firmware or you will have to re-setup your device.
 +
 
 +
= Firmware =
 +
I do not know how to find out the firmware of the device, here is a hint:
 +
Nokia-N810-43-7:~# cat /etc/*ersio*
 +
testing/unstable
 +
RX-34+RX-44+RX-48_DIABLO_5.2008.43-7_PR_MR0
 +
 
 +
= Install wget =
 +
Make sure you have the latest firmware installed, this example is from 2009-12-28.
 +
 
 +
Get wget from http://repository.maemo.org/pool/maemo5.0/free/w/wget/wget_1.10.2-2osso3_armel.deb
 +
 
 +
Install it using
 +
dpkg -i wget_1.10.2-2osso3_armel.deb
 +
 
 +
= Update the firmware =
 +
* follow the [http://wiki.maemo.org/Updating_the_tablet_firmware instructions]
 +
* re-connect to WLAN (password needed)
 +
* re-install openSSH
 
** settings->application manager
 
** settings->application manager
 
** tools -> application catalog
 
** tools -> application catalog
Line 14: Line 35:
 
** openssh
 
** openssh
 
** install
 
** install
ssh root@localhost
 
apt-get install subversion
 
  
= In scratchbox =
+
= compile =
You cannot install scratchbox on an X64 computer, so, install an i386 into a VMWare virtual machine. This example uses SUSE 11, but it might work on any distribution. The following describes how to install scratchbox into that SUSE 11 32bit.
+
Do not follow http://talk.maemo.org/showthread.php?t=6737, it will install packages that are so old that you will have to flush your N810.
  
== Hello world ==
+
* [[#install openssh on the N810]]
First, we want to compile a "hello world" program for the Nokia. Here is how.
+
* Find out what maemo version you have. Choose Settings -> Control Panel -> About. If you get "Product maemo Linux based OS2008 Version:5.2008.43-7" this means maemo 4.1. So you have maemo, os2008 and diablo ([http://en.wikipedia.org/wiki/Maemo#Version_history more info] [http://wiki.maemo.org/Codenames and more]).
* Set up scratchbox
+
* download wget from http://repository.maemo.org/pool/maemo4.1.2/free/w/wget/. Copy it to your computer and scp it to your N810.
root@i386 # wget http://repository.maemo.org/stable/diablo/maemo-scratchbox-install_4.1.sh
+
* get glibc
  root@i386 # chmod 777 maemo-scratchbox-install_4.1.sh
+
  wget http://repository.maemo.org/pool/maemo4.1.2/free/g/glibc/libc6-dev_2.5.0-1osso10_armel.deb
  root@i386 # ./maemo-scratchbox-install_4.1.sh -s /scratchbox
+
* get linux kernel headers
root@i386 # /scratchbox/sbin/sbox_adduser myuser
+
  wget http://repository.maemo.org/pool/maemo4.1.2/free/l/linux-kernel-headers/linux-kernel-headers_2.6.16.osso11-1_armel.deb
root@i386 # su - myuser
+
* get libgcc
* set up the SDK
+
  wget http://repository.maemo.org/pool/maemo4.1.2/free/g/gcc-3.4/libgcc1_3.4.4cs2005q3.2-5.osso8_armel.deb
  myuser@i386 $ wget http://repository.maemo.org/stable/diablo/maemo-sdk-install_4.1.sh
+
* install everything
Start the install script and accept all choices:
+
  dpkg -i gcc-3.4_3.4.4cs2005q3.2-5.osso8_armel.deb
  myuser@i386 $ sh maemo-sdk-install_4.1.sh
+
* do the usual test
* start scratchbox
+
  Nokia-N810-43-7:~# cat main.c
  myuser@i386 $ /scratchbox/login
+
#include <stdio.h>
[sbox-DIABLO_ARMEL: ~] > sb-conf select DIABLO_ARMEL
+
   
  [sbox-DIABLO_ARMEL: ~] > gcc main.c
+
int main()
  [sbox-DIABLO_ARMEL: ~] > file a.out
+
{ printf("hello world"); }
  a.out: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.8, dynamically linked (uses shared libs), not stripped
+
* copy the file to your Nokia N810 using scp
+
Nokia-N810-43-7:~# gcc-3.4 -o greeter main.c
 +
  Nokia-N810-43-7:~# ./greeter
 +
  hello worldNokia-N810-43-7:~#
  
=> the file is executable on the Nokia
+
= build Qt4 =
 
+
== Re-login ==
+
To re-login after a reboot of your virtual machine run
+
/scratchbox/sbin/sbox_ctl start
+
/scratchbox/login
+
 
+
== install cmake ==
+
* Here you should better make a snapshot of your virtual machine.
+
* Then create the installation repositories and install cmake:
+
cat >>/etc/apt/sources.list<<EOF
+
# repository with experimental kde packages and dependencies
+
deb http://93.157.1.37/~marijn/maemo binary/
+
deb http://repository.maemo.org/ diablo free non-free
+
deb-src http://repository.maemo.org/ diablo free
+
deb http://repository.maemo.org/extras-devel/ diablo free
+
deb-src http://repository.maemo.org/extras-devel/ diablo free
+
EOF
+
apt-get update
+
apt-get install cmake
+
 
+
== Install kde applications ==
+
cd
+
apt-get install shared-mime-info
+
apt-get install xsltproc
+
apt-get install kdepimlibs5-dev
+
svn co https://svn.kde.org/home/kde/trunk/kdesupport
+
cd kdesupport
+
cmake . && make && make install
+
svn co https://svn.kde.org/home/kde/branches/KDE/4.1/kdepim
+
cd kdepim
+
cmake . && make && make install
+
Here you can get to run singular applications, e.g. ktimetracker.
+
 
+
== re-install kdelibs ==
+
 
+
=== pcre ===
+
curl ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-7.7.tar.gz>pcre-7.7.tar.gz
+
tar xvzf pcre-7.7.tar.gz
+
cd pcre-7.7
+
./configure && make && make install
+
 
+
= Know-how =
+
== manually dpkg ==
+
wget http://93.157.1.37/~marijn/maemo/binary/libqt4-qt3support_4.4.1-1maemo0_armel.deb
+
wget http://93.157.1.37/~marijn/maemo/binary/libqt4-designer_4.4.1-1maemo0_armel.deb
+
wget http://93.157.1.37/~marijn/maemo/binary/libqt4-script_4.4.1-1maemo0_armel.deb
+
wget http://93.157.1.37/~marijn/maemo/binary/libqt4-dbus_4.4.1-1maemo0_armel.deb
+
wget http://93.157.1.37/~marijn/maemo/binary/libqtcore4_4.4.1-1maemo0_armel.deb
+
wget http://93.157.1.37/~marijn/maemo/binary/libqtgui4_4.4.1-1maemo0_armel.deb
+
wget http://93.157.1.37/~marijn/maemo/binary/libqt4-xml_4.4.1-1maemo0_armel.deb
+
wget http://93.157.1.37/~marijn/maemo/binary/libqt4-test_4.4.1-1maemo0_armel.deb
+
wget http://93.157.1.37/~marijn/maemo/binary/libqt4-sql_4.4.1-1maemo0_armel.deb
+
wget http://93.157.1.37/~marijn/maemo/binary/libqt4-webkit_4.4.1-1maemo0_armel.deb
+
wget http://93.157.1.37/~marijn/maemo/binary/libqt4-svg_4.4.1-1maemo0_armel.deb
+
wget http://93.157.1.37/~marijn/maemo/binary/libqt4-assistant_4.4.1-1maemo0_armel.deb
+
wget http://93.157.1.37/~marijn/maemo/binary/libqt4-xmlpatterns_4.4.1-1maemo0_armel.deb
+
 
+
== install QT ==
+
To install QT, do not use the QT packages from www.trolltech.com, but from
+
svn checkout https://garage.maemo.org/svn/qt4/trunk/qt4-x11-4.4.0
+
ln -s /usr/lib/gtk-2.0/include/gdkconfig.h /usr/include
+
cp -r /usr/include/gtk-2.0/gdk-pixbuf /usr/include
+
cp -r /usr/include/atk-1.0/atk/ /usr/include
+
 
+
=== using dpkg-buildpackage ===
+
 
  svn checkout https://garage.maemo.org/svn/qt4/trunk/qt4-x11-4.4.0
 
  svn checkout https://garage.maemo.org/svn/qt4/trunk/qt4-x11-4.4.0
 
  cd qt4-x11-4.4.0
 
  cd qt4-x11-4.4.0
 
  dpkg-buildpackage
 
  dpkg-buildpackage
  
==== Problem ====
+
= clean up =
  : Dependency provided by Scratchbox: quilt
+
* remove mail client
  debian/rules clean
+
  apt-get remove modest
  debian/rules:16: /usr/share/cdbs/1/rules/patchsys-quilt.mk: No such file or directory
+
* remove chat client
make: *** No rule to make target `/usr/share/cdbs/1/rules/patchsys-quilt.mk'. Stop.
+
  apt-get remove osso-chat-ui osso-chat-ui-l10n osso-chat-ui-l10n-mr0
 +
* remove clock
 +
  apt-get remove osso-clock osso-clock-applet osso-clock-data osso-clock-l10n osso-clock-l10n-mr0 osso-clock-ui osso-clock-widget osso-sounds-alarms
 +
* maemoblocks
  
= TroubleShooting =
+
= What fails - what works =
  
== kernel too old ==
+
== Scratchbox ==
If
+
* I cannot install scratchbox on x64 OS
cmake
+
** it breaks and says it is not designed for this
delivers
+
* I cannot install scratchbox on SLES 10
FATAL: kernel too old
+
* I cannot install scratchbox on SUSE 11.2
This happened for me with SLES 10. Better use SUSE 10.3 or SUSE 11.
+
** installation does not end with the wish "happy hacking" because of too many dpkg errors
 +
* I can install scratchbox on SUSE 11.1x32
  
== unable to install maemo-sdk-dev ==
+
try copying /scratcbox/devkits/qemu/bin/qemu-arm-sb from a fremantle installation to /scratchbox/devkits/cputransp/bin and configure your target configuration to use this => this fixed my compile of cmake !!!
On SLES 10, I got
+
Processing was halted because there were too many errors.
+
E: Sub-process /scratchbox/devkits/debian-etch/bin/dpkg returned an error code (1)
+
E: Unable to install maemo-sdk-dev on DIABLO_ARMEL target.
+
E: Please check the sources.list for errors.
+
E: Scratchbox login returned error 100.
+
In this case, change your distribution and start again.
+
  
== ld terminated with signal 9 ==
+
[sbox-DIABLO_ARMEL: ~/cmake-2.6.2] > sb-conf show
Should you get
+
Compiler: cs2005q3.2-glibc2.5-arm
  collect2: ld terminated with signal 9 [Killed]
+
Devkits: perl debian-etch maemo3-tools cputransp
Increase the amount of memory for the virtual machine, 512MB is not always enough.
+
CPU-transparency: /scratchbox/devkits/cputransp/bin/qemu-arm-cvs-m
 +
 
 +
== cmake ==
 +
* [http://www.cmake.org/pipermail/cmake/2009-February/027065.html I cannot install cmake into a scratchbox]
 +
the error msg is
 +
  make[2]: *** No rule to make target `Source/CMakeFiles/CMakeLib.dir/link.txt', needed by `Source/libCMakeLib.a'.  Stop.
 +
'''Workaround:''' I took link.txt from another computer and copied it => cmake is installed on the N810
 +
 
 +
'''Solution:''' try copying /scratcbox/devkits/qemu/bin/qemu-arm-sb from a fremantle installation to /scratchbox/devkits/cputransp/bin and configure your target configuration to use this
 +
 
 +
== kdesupport ==
 +
* cannot install kdesupport from 2009-12-30 into scratchbox, get
 +
  Unknown CMake command "update_xdg_mimetypes".
 +
 
 +
 
 +
  CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
 +
  Please set them or make sure they are set and tested correctly in the CMake files:
 +
  Boost_PROGRAM_OPTIONS_LIBRARY (ADVANCED)
 +
update_xdg_mimetypes is a cmake macro provided by kdesupport/akonadi/cmake/modules/FindSharedMimeInfo.cmake. I took the macro and copied into CMakeLists.txt, then, when I reverted, I could not reproduce the error. Also check
 +
update-mime-database -v
 +
env | grep XDG
 +
/usr/share/mime/packages/kde.xml
 +
export XDG_DATA_DIRS=/usr/local/share
 +
AkonadiConfig.cmake
 +
* cannot install kdesupport, get a message that libboost is missing
  
 
= See also =  
 
= See also =  
* http://www.kdedevelopers.org/node/3624
+
* [[N900]]
* [http://www.kdedevelopers.org/node/3623 How to kompile on the device itself]
+
* [http://wiki.maemo.org/Updating_the_tablet_firmware Updating the firmware]
 +
* [http://www.kdedevelopers.org/node/3624 KDE packages for maemo]
 +
* [http://www.kdedevelopers.org/node/3623 How to kompile on the device itself by richard]
 +
* [http://wiki.maemo.org/User:Tstaerk#Compiling_on_the_N810 Compiling on the N810 by tstaerk]
 
* http://tablets-dev.nokia.com/4.1/INSTALL.txt
 
* http://tablets-dev.nokia.com/4.1/INSTALL.txt
 
* http://blogs.forum.nokia.com//data/blogs/resources/300003/maemo_and_sdk_for_qt.pdf
 
* http://blogs.forum.nokia.com//data/blogs/resources/300003/maemo_and_sdk_for_qt.pdf
 
* http://techbase.kde.org/Projects/Maemo
 
* http://techbase.kde.org/Projects/Maemo
 +
 +
[[Category:Projects]]

Latest revision as of 09:44, 1 May 2011

This article describes how to compile software for the ARM-based Nokia N810 tablet PC. We use mainly scratchbox on an Intel-based computer. Scratchbox is a cross-compiling environment.

Better see http://techbase.kde.org/Projects/Maemo/kdepim Also look at Xephyr.

Contents

Warning

Do not follow http://talk.maemo.org/showthread.php?t=6737 with the latest firmware or you will have to re-setup your device.

Firmware

I do not know how to find out the firmware of the device, here is a hint:

Nokia-N810-43-7:~# cat /etc/*ersio*
testing/unstable
RX-34+RX-44+RX-48_DIABLO_5.2008.43-7_PR_MR0

Install wget

Make sure you have the latest firmware installed, this example is from 2009-12-28.

Get wget from http://repository.maemo.org/pool/maemo5.0/free/w/wget/wget_1.10.2-2osso3_armel.deb

Install it using

dpkg -i wget_1.10.2-2osso3_armel.deb

Update the firmware

  • follow the instructions
  • re-connect to WLAN (password needed)
  • re-install openSSH
    • settings->application manager
    • tools -> application catalog
    • memo extras -> edit -> un-tag "disabled"
    • close
    • browse installable applications
    • all
    • openssh
    • install

compile

Do not follow http://talk.maemo.org/showthread.php?t=6737, it will install packages that are so old that you will have to flush your N810.

wget http://repository.maemo.org/pool/maemo4.1.2/free/g/glibc/libc6-dev_2.5.0-1osso10_armel.deb
  • get linux kernel headers
wget http://repository.maemo.org/pool/maemo4.1.2/free/l/linux-kernel-headers/linux-kernel-headers_2.6.16.osso11-1_armel.deb
  • get libgcc
wget http://repository.maemo.org/pool/maemo4.1.2/free/g/gcc-3.4/libgcc1_3.4.4cs2005q3.2-5.osso8_armel.deb
  • install everything
dpkg -i gcc-3.4_3.4.4cs2005q3.2-5.osso8_armel.deb
  • do the usual test
Nokia-N810-43-7:~# cat main.c
#include <stdio.h>

int main()
{ printf("hello world"); }

Nokia-N810-43-7:~# gcc-3.4 -o greeter main.c
Nokia-N810-43-7:~# ./greeter
hello worldNokia-N810-43-7:~#

build Qt4

svn checkout https://garage.maemo.org/svn/qt4/trunk/qt4-x11-4.4.0
cd qt4-x11-4.4.0
dpkg-buildpackage

clean up

  • remove mail client
apt-get remove modest
  • remove chat client
apt-get remove osso-chat-ui osso-chat-ui-l10n osso-chat-ui-l10n-mr0
  • remove clock
apt-get remove osso-clock osso-clock-applet osso-clock-data osso-clock-l10n osso-clock-l10n-mr0 osso-clock-ui osso-clock-widget osso-sounds-alarms
  • maemoblocks

What fails - what works

Scratchbox

  • I cannot install scratchbox on x64 OS
    • it breaks and says it is not designed for this
  • I cannot install scratchbox on SLES 10
  • I cannot install scratchbox on SUSE 11.2
    • installation does not end with the wish "happy hacking" because of too many dpkg errors
  • I can install scratchbox on SUSE 11.1x32

try copying /scratcbox/devkits/qemu/bin/qemu-arm-sb from a fremantle installation to /scratchbox/devkits/cputransp/bin and configure your target configuration to use this => this fixed my compile of cmake !!!

[sbox-DIABLO_ARMEL: ~/cmake-2.6.2] > sb-conf show
Compiler: cs2005q3.2-glibc2.5-arm
Devkits: perl debian-etch maemo3-tools cputransp
CPU-transparency: /scratchbox/devkits/cputransp/bin/qemu-arm-cvs-m

cmake

the error msg is

make[2]: *** No rule to make target `Source/CMakeFiles/CMakeLib.dir/link.txt', needed by `Source/libCMakeLib.a'.  Stop.

Workaround: I took link.txt from another computer and copied it => cmake is installed on the N810

Solution: try copying /scratcbox/devkits/qemu/bin/qemu-arm-sb from a fremantle installation to /scratchbox/devkits/cputransp/bin and configure your target configuration to use this

kdesupport

  • cannot install kdesupport from 2009-12-30 into scratchbox, get
 Unknown CMake command "update_xdg_mimetypes".
 
 
 CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
 Please set them or make sure they are set and tested correctly in the CMake files:
 Boost_PROGRAM_OPTIONS_LIBRARY (ADVANCED)

update_xdg_mimetypes is a cmake macro provided by kdesupport/akonadi/cmake/modules/FindSharedMimeInfo.cmake. I took the macro and copied into CMakeLists.txt, then, when I reverted, I could not reproduce the error. Also check

update-mime-database -v
env | grep XDG
/usr/share/mime/packages/kde.xml
export XDG_DATA_DIRS=/usr/local/share
AkonadiConfig.cmake
  • cannot install kdesupport, get a message that libboost is missing

See also