Changes between Version 21 and Version 22 of SettingUpDevelopmentEnvironmentForN9


Ignore:
Timestamp:
Feb 16, 2012 2:50:39 AM (10 years ago)
Author:
vestbo@webkit.org
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SettingUpDevelopmentEnvironmentForN9

    v21 v22  
    128128}}}
    129129
    130 = 2. Configuring N9 =
     130= 2. Configuring your device (N9/N950) =
     131
     132''Note:'' It's highly encouraged that you enable open mode on your device. This disables the security system on the device (AEGIS), which lets you mount (SSHF/NFS), making development a lot easier.
     133
     134== 2.1 Enabling open mode ==
     135
     136The 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]
     137
     138The only known way to disable AEGIS restrictions is flashing an alternate kernel onto N9.
     139
     140Notice: This could void the warranty! After flashing the device will show a warranty void message while booting.
     141
     142This section based on
     143  - http://maemo.cloud-7.de/HARM/N9/openmode_kernel_PR1.1/
     144  - http://talk.maemo.org/showthread.php?t=81579
     145  - http://forum.meego.com/showthread.php?t=4575&page=22
     146
     147Prerequisite
     148  * 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]
     149  * Original firmware 20.2011.40-4 (you can download it with [http://www.symbian-toys.com/navifirm.aspx NaviFirm+], or using [https://gist.github.com/1636192 this script] on non-Windows machines.)
     150  * Nokia flasher: [http://tablets-dev.nokia.com/maemo-dev-env-downloads.php flasher_3.12.1_amd64.deb]
     151
     152It 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!
     153
     154Install Nokia flasher utility and download the firmware and pached kernel file to a directory.
     155
     156Turn off the device and disconnect it from usb. Flash the original firmware to the device:
     157{{{
     158  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
     159}}}
     160
     161Do NOT disconnect usb cable. Do NOT restart the phone. Now, flash the pached kernel onto it:
     162{{{
     163  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
     164}}}
     165
     166Now, your N9 is ready. Disconnect it from usb. It will start booting.
     167
    131168
    132169== 2.1. Turn on developer mode ==
    133170
    134 Notice: If you want to use NFS with retail N9, please read section [#a3.1.b.1Flashingpachedkerneltogetopenmode 3.1.b.1] first.
    135 
    136171There is a tutorial for this at http://paazio.nanbudo.fi/tutorials/qt-quick/developer-mode-in-nokia-n9
    137172
     
    142177Set up wifi internet connection. Connect usb cable.
    143178
    144 
    145 == 2.2. Enable root access over ssh ==
    146 
    147 Login as 'developer' (run@host):
     179== 2.2. Set up device ==
     180
     181{{{
     182  $ browser-scripts/setup-device.sh
     183}}}
     184
     185This will set up password-less login, install missing packages, and set up SSHFS if you're running in open-mode.
     186
     187From this point on you should be able to refer to the device as 'device', and the default user should be 'developer'.
     188
     189== 2.3. Enable root login (optional) ==
     190
     191Login as 'developer':
    148192{{{
    149193  $ ssh developer@192.168.2.15
     
    184228Maybe you should change default root password, too.
    185229
    186 
    187 == 2.3. Install missing packages ==
    188 
    189 Resworb scripts has a solution for this.
    190 
    191 This script uses name 'device' for N9. You can add this to your /etc/hosts file (run@host):
    192 {{{
    193   $ sudo su
    194   $ echo -e '192.168.2.15\tdevice' >> /etc/hosts
    195   $ exit
    196 }}}
    197 
    198 Scrachbox should be configured to armel target befor running this script (run@host):
    199 
    200 Run
    201 {{{
    202   $ cd ~/swork
    203   $ browser-scripts/device-install-packages-n9.sh
    204 }}}
    205 It will ask for root password of the device.
    206 
    207 = 3. How you get things running on the N9 =
    208 
    209 == 3.1.a Transfer files to N9 with rsync ==
     230= 3.Running things on device =
     231
     232The best option is to mount your host on the device using either NFS or SSHFS (the latter is preferred). The alternative is to rsync files over.
     233
     234== 3.1a Mounting SSHFS
     235
     236If you ran the `setup-device.sh` script with an open mode kernel, you should now have your host available at `/mnt/host`, as well as your home directory available.
     237
     238== 3.1b Transfer files with rsync ==
    210239
    211240With rsync you can deploy the files to the device.
     
    252281
    253282If you don't want to transfer LayoutTests to N9, then you should use '''./all-rsync.sh --no-layout-tests'''. Without this argument rsync always does re-transfer on LayoutTests because of the vfat filesystem's limitation.
    254 
    255 
    256 == 3.1.b Mounting NFS on retail N9 ==
    257 
    258 The 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]
    259 
    260 The only known way to disable AEGIS restrictions is flashing an alternate kernel onto N9.
    261 
    262 Notice: This could void the warranty! After flashing the device will show a warranty void message while booting.
    263 
    264 === 3.1.b.1 Flashing pached kernel to get open mode ===
    265 
    266 This section based on
    267   - http://maemo.cloud-7.de/HARM/N9/openmode_kernel_PR1.1/
    268   - http://talk.maemo.org/showthread.php?t=81579
    269   - http://forum.meego.com/showthread.php?t=4575&page=22
    270 
    271 Prerequisite
    272   * 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]
    273   * Original firmware 20.2011.40-4 (you can download it with [http://www.symbian-toys.com/navifirm.aspx NaviFirm+], or using [https://gist.github.com/1636192 this script] on non-Windows machines.)
    274   * Nokia flasher: [http://tablets-dev.nokia.com/maemo-dev-env-downloads.php flasher_3.12.1_amd64.deb]
    275 
    276 It 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!
    277 
    278 Install Nokia flasher utility and download the firmware and pached kernel file to a directory.
    279 
    280 Turn off the device and disconnect it from usb. Flash the original firmware to the device:
    281 {{{
    282   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
    283 }}}
    284 
    285 Do NOT disconnect usb cable. Do NOT restart the phone. Now, flash the pached kernel onto it:
    286 {{{
    287   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
    288 }}}
    289 
    290 Now, your N9 is ready. Disconnect it from usb. It will start booting.
    291 
    292 === 3.1.b.2. Developer mode and required libraries ===
    293 
    294 Enable developer mode: Settings / Security / Developer mode. After installation the device will do a reboot.
    295 
    296 Change usb connection mode: Settings / Accessories / USB to "SDK" or "Always ask".
    297 
    298 Set up wifi internet connection. Connect usb cable.
    299 
    300 On N9 menu, select SDK Connectivity / USB. It will show your password for user developer. Leave it open.
    301 
    302 Install required libs for NFS mount and add static password for 'user' user (run@host):
    303 {{{
    304 ssh developer@192.168.2.15
    305 
    306 echo 'rootme' | devel-su
    307 cd /root
    308 apt-get install wget
    309 wget http://maemo.cloud-7.de/HARM/N9/openmode_kernel_PR1.1/opensh/opensh.deb
    310 wget 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
    311 wget http://repo.pub.meego.com/home:/rzr:/debian/harmattan/armel/portmap_6.0.0-2_armel.deb
    312 
    313 dpkg -i opensh.deb
    314 dpkg -i libwrap0_7.6.dbs-maemo6.1_armel.deb
    315 dpkg -i portmap_6.0.0-2_armel.deb
    316 
    317 passwd user
    318 
    319 exit
    320 exit
    321 }}}
    322 
    323 Create public key for ssh connection, if you don't have it already (run@host):
    324 {{{
    325 ssh-keygen -t rsa
    326 }}}
    327 
    328 Copy public key to N9 (run@host):
    329 {{{
    330 ssh user@device "mkdir .ssh"
    331 scp ~/.ssh/id_rsa.pub user@device:./.ssh/authorized_keys
    332 }}}
    333 Now, you don't have to enter password for 'user' when you connect to N9.
    334 
    335 
    336 === 3.1.b.3. Setup NFS on host computer (Ubuntu): ===
    337 
    338 Install the required packages and share swork (run@host):
    339 {{{
    340 sudo apt-get install nfs-kernel-server portmap
    341 sudo echo "/home/$USER/swork 192.168.2.15(rw,sync,no_root_squash)" >> /etc/exports
    342 sudo /etc/init.d/nfs-kernel-server restart
    343 }}}
    344 
    345 === 3.1.b.4. Setup NFS on N9 ===
    346 
    347 Create script for mounting NFS (run@host):
    348 {{{
    349 ssh user@192.168.2.15 "mkdir /home/user/swork; \
    350 echo 'opensh -c \"/sbin/portmap; /sbin/modprobe nfs; mount -t nfs 192.168.2.14:/home/$USER/swork /home/user/swork\"' > nfsmount.sh; \
    351 chmod +x nfsmount.sh "
    352 }}}
    353 
    354 Connect to N9 (run@host)
    355 {{{
    356 ssh user@192.168.2.15
    357 }}}
    358 
    359 Mount NFS if you didn't do it (run@n9).
    360 {{{
    361 opensh
    362 . nfsmount.sh
    363 }}}
    364 
    365283
    366284== 3.2. Running MiniBrowser ==