Changes between Version 2 and Version 3 of SettingUpDevelopmentEnvironmentForN9


Ignore:
Timestamp:
Jan 27, 2012 5:40:32 AM (12 years ago)
Author:
zarvai@inf.u-szeged.hu
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SettingUpDevelopmentEnvironmentForN9

    v2 v3  
     1[[PageOutline]]
     2= Setting up development environment for Nokia N9 =
     3
    14under construction
    25
    3 = Setting up development environment for Nokia N9 =
    4 
    56Build Qt5 and WebKit2 for N9 on Ubuntu 11.10 x64. Running MiniBrowser on the device.
    67
    7 == I. Scratchbox Instructions ==
     8= 1. Scratchbox Instructions =
    89
    910This section based on
     
    1314Follow the instructions exactly!
    1415
    15 === 1. Install and configure Scratchbox for Harmattan: ===
     16== 1.1. Install and configure Scratchbox for Harmattan ==
    1617(run@host)
    1718{{{
     
    5354
    5455
    55 === 2. Prepare your environment ===
     56== 1.2. Prepare your environment ==
    5657(run@host)
    5758{{{
     
    127128}}}
    128129
    129 === 3. Create ICECC toolchain (optional) ===
     130== 1.3. Create ICECC toolchain (optional) ==
    130131
    131132If you have multiple workstations configured to use [http://en.opensuse.org/Icecream ICECC], you can speed up building process significantly.
     
    156157Make the script runnable and execute it before building inside scratchbox when you need speedup.
    157158
    158 === 4. Build QtWebKit ===
     159== 1.4. Build QtWebKit ==
    159160
    160161Login to scratchbox and optionally execute script for icecc (run@host):
     
    227228}}}
    228229
    229 == II.  ==
     230== 1.5. Updating build environment ==
     231If you need to update browser-scripts, run on host:
     232{{{
     233  $ cd ~/swork/browser-scripts
     234  $ git reset --hard HEAD
     235  $ git pull
     236  $ patch -p1 < ../browser-script.patch
     237}}}
     238
     239If you neet to update Qt5 and WebKit, run on host:
     240{{{
     241  $ cd ~/swork/qt5
     242  $ git submodule foreach --recursive git clean -fdx
     243  $ git clean -fdx
     244  $ git reset --hard HEAD
     245  $ cd ~/swork/webkit
     246  $ git clean -fdx
     247  $ git reset --hard HEAD
     248  $ cd ~/swork
     249  $ browser-scripts/update-sources.sh
     250}}}
     251Than rebuild binaries inside scratchbox:
     252{{{
     253  [sbox-HARMATTAN_ARMEL: ~] > cd ~/swork
     254  [sbox-HARMATTAN_ARMEL: ~] > browser-scripts/build-sources.sh
     255}}}
     256
     257
     258
     259= 2. Configuring N9 =
     260
     261== 2.1. Turn on developer mode ==
     262
     263== 2.2. Enable root access over ssh ==
     264
     265== 2.3. Install missing packages ==
     266
     267
     268= 3. How you get things running on the N9 =
     269
     270== 3.1.a Moving files to N9 with rsync ==
     271
     272== 3.1.b Mounting NFS on retail N9 ==
     273
     274
     275The retail N9 has a very stricky security system, called AEGIS. You can read about this at: [http://harmattan-dev.nokia.com/docs/library/html/guide/html/Developer_Library_Developing_for_Harmattan_Harmattan_security_Security_guide.html Harmattan Security Guide]
     276
     277The only known way to disable AEGIS restrictions is flashing an alternate kernel onto N9.
     278
     279=== 3.1.b.1 Flashing pached kernel to get open mode ===
     280
     281Prerequisite (all of this can be found in /common/projects/WebKit/N9-!FirmWare)
     282  * Pached kernel: [http://maemo.cloud-7.de/HARM/N9/openmode_kernel_PR1.1/zImage-2.6.32.39-dfl61-20113701 zImage-2.6.32.39-dfl61-20113701]
     283  * Original firmware 20.2011.40-4
     284  * Nokia flasher: [http://tablets-dev.nokia.com/maemo-dev-env-downloads.php flasher_3.12.1_amd64.deb]
     285
     286It is recommended to flash back the device to factory state. If you have any importand data on the device, back it up first or you will lose it!
     287
     288Install Nokia flasher utility and download the firmware and pached kernel file to a directory.
     289
     290Turn off the device and disconnect it from usb. Flash the original firmware to the device:
     291{{{
     292  sudo flasher -F DFL61_HARMATTAN_20.2011.40-4_PR_LEGACY_001-OEM1-958_ARM.bin -F DFL61_HARMATTAN_20.2011.40-4.CENTRALEUROPE_EMMC_CENTRALEUROPE.bin -f
     293}}}
     294
     295Do NOT disconnect usb cable. Do NOT restart the phone. Now, flash the pached kernel onto it:
     296{{{
     297  sudo flasher -f -a DFL61_HARMATTAN_20.2011.40-4_PR_LEGACY_001-OEM1-958_ARM.bin -k zImage-2.6.32.39-dfl61-20113701
     298}}}
     299
     300Now, your N9 is ready. Disconnect it from usb. It will start booting.
     301
     302=== 3.1.b.2. Developer mode and required libraries ===
     303
     304Enable developer mode: Settings / Security / Developer mode. After installation the device will do a reboot.
     305
     306Change usb connection mode: Settings / Accessories / USB to "SDK" or "Always ask".
     307
     308Set up wifi internet connection. Connect usb cable.
     309
     310On N9 menu, select SDK Connectivity / USB. It will show your password for user developer. Leave it open.
     311
     312Install required libs for NFS mount and add static password for 'user' user (run@host):
     313{{{
     314ssh developer@192.168.2.15
     315
     316echo 'rootme' | devel-su
     317cd /root
     318apt-get install wget
     319wget http://maemo.cloud-7.de/HARM/N9/openmode_kernel_PR1.1/opensh/opensh.deb
     320wget http://repo.pub.meego.com/home:/rzr:/harmattan/MeeGo_1.2_Harmattan_Maemo.org_MeeGo_1.2_Harmattan_standard/armel/libwrap0_7.6.dbs-maemo6.1_armel.deb
     321wget http://repo.pub.meego.com/home:/rzr:/debian/harmattan/armel/portmap_6.0.0-2_armel.deb
     322
     323dpkg -i opensh.deb
     324dpkg -i libwrap0_7.6.dbs-maemo6.1_armel.deb
     325dpkg -i portmap_6.0.0-2_armel.deb
     326
     327passwd user
     328
     329exit
     330exit
     331}}}
     332
     333Create public key for ssh connection, if you don't have it already (run@host):
     334{{{
     335ssh-keygen -t rsa
     336}}}
     337
     338Copy public key to N9 (run@host):
     339{{{
     340ssh user@device "mkdir .ssh"
     341scp ~/.ssh/id_rsa.pub user@device:./.ssh/authorized_keys
     342}}}
     343Now, you don't have to enter password for 'user' when you connect to N9.
     344
     345
     346=== 3.1.b.3. Setup NFS on host computer (Ubuntu): ===
     347
     348Install the required packages and share swork (run@host):
     349{{{
     350sudo apt-get install nfs-kernel-server portmap
     351sudo echo "/home/$USER/swork 192.168.2.15(rw,sync,no_root_squash)" >> /etc/exports
     352sudo /etc/init.d/nfs-kernel-server restart
     353}}}
     354
     355=== 3.1.b.4. Setup NFS on N9 ===
     356
     357Create script for mounting NFS (run@host):
     358{{{
     359ssh user@192.168.2.15 "mkdir /home/user/swork; \
     360echo 'opensh -c \"/sbin/portmap; /sbin/modprobe nfs; mount -t nfs 192.168.2.14:/home/$USER/swork /home/user/swork\"' > nfsmount.sh; \
     361chmod +x nfsmount.sh "
     362}}}
     363
     364Connect to N9 (run@host)
     365{{{
     366ssh user@192.168.2.15
     367}}}
     368
     369Mount NFS if you didn't do it (run@n9).
     370{{{
     371. nfsmount.sh
     372}}}
     373
     374
     375== 3.2. Running MiniBrowser ==
     376
     377=== 3.2.1. Environment variables ===
     378Now create script for setting environment variables (run@host):
     379
     380{{{
     381ssh user@192.168.2.15 "echo 'export QTDIR=/home/user/swork/qt5/qtbase' > nfsenv.sh; \
     382echo 'export QT_IMPORT_PATH=/home/user/swork/qt5/qtbase/imports' >> nfsenv.sh; \
     383echo 'export QML_IMPORT_PATH=/home/user/swork/qt5/qtbase/imports' >> nfsenv.sh; \
     384echo 'export LD_LIBRARY_PATH=/home/user/swork/qt5/qtbase/lib:/home/user/swork/qtwebkit-webkit2-dev-builddir-armel-m6/Release/lib' >> nfsenv.sh; \
     385echo 'export QT_PLUGIN_PATH=/home/user/swork/qt5/qtbase/plugins' >> nfsenv.sh; \
     386echo 'export QT_QPA_PLATFORM_PLUGIN_PATH=/home/user/swork/qt5/qtbase/plugins/platforms' >> nfsenv.sh; \
     387echo 'export QT_QPA_PLATFORM=xcb' >> nfsenv.sh; \
     388echo 'export WEBKIT_TESTFONTS=/home/user/swork/testfonts' >> nfsenv.sh; \
     389echo '# export TZ=/usr/share/zoneinfo/America/Los_Angeles' >> nfsenv.sh; \
     390echo 'export PATH=/home/user/swork/qt5/qtbase/bin:$PATH' >> nfsenv.sh"
     391}}}
     392
     393
     394Load environment variables (run@n9):
     395{{{
     396. nfsenv.sh
     397}}}
     398
     399=== 3.2.2. Launch browser ===
     400(run@n9)
     401{{{
     402~/swork/qtwebkit-webkit2-dev-builddir-armel-m6/Release/bin/MiniBrowser
     403}}}
     404
     405== IV. Flash back N9 to factory state ==
     406
     407