229 | | == II. == |
| 230 | == 1.5. Updating build environment == |
| 231 | If 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 | |
| 239 | If 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 | }}} |
| 251 | Than 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 | |
| 275 | 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] |
| 276 | |
| 277 | The 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 | |
| 281 | Prerequisite (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 | |
| 286 | 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! |
| 287 | |
| 288 | Install Nokia flasher utility and download the firmware and pached kernel file to a directory. |
| 289 | |
| 290 | Turn 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 | |
| 295 | Do 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 | |
| 300 | Now, your N9 is ready. Disconnect it from usb. It will start booting. |
| 301 | |
| 302 | === 3.1.b.2. Developer mode and required libraries === |
| 303 | |
| 304 | Enable developer mode: Settings / Security / Developer mode. After installation the device will do a reboot. |
| 305 | |
| 306 | Change usb connection mode: Settings / Accessories / USB to "SDK" or "Always ask". |
| 307 | |
| 308 | Set up wifi internet connection. Connect usb cable. |
| 309 | |
| 310 | On N9 menu, select SDK Connectivity / USB. It will show your password for user developer. Leave it open. |
| 311 | |
| 312 | Install required libs for NFS mount and add static password for 'user' user (run@host): |
| 313 | {{{ |
| 314 | ssh developer@192.168.2.15 |
| 315 | |
| 316 | echo 'rootme' | devel-su |
| 317 | cd /root |
| 318 | apt-get install wget |
| 319 | wget http://maemo.cloud-7.de/HARM/N9/openmode_kernel_PR1.1/opensh/opensh.deb |
| 320 | 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 |
| 321 | wget http://repo.pub.meego.com/home:/rzr:/debian/harmattan/armel/portmap_6.0.0-2_armel.deb |
| 322 | |
| 323 | dpkg -i opensh.deb |
| 324 | dpkg -i libwrap0_7.6.dbs-maemo6.1_armel.deb |
| 325 | dpkg -i portmap_6.0.0-2_armel.deb |
| 326 | |
| 327 | passwd user |
| 328 | |
| 329 | exit |
| 330 | exit |
| 331 | }}} |
| 332 | |
| 333 | Create public key for ssh connection, if you don't have it already (run@host): |
| 334 | {{{ |
| 335 | ssh-keygen -t rsa |
| 336 | }}} |
| 337 | |
| 338 | Copy public key to N9 (run@host): |
| 339 | {{{ |
| 340 | ssh user@device "mkdir .ssh" |
| 341 | scp ~/.ssh/id_rsa.pub user@device:./.ssh/authorized_keys |
| 342 | }}} |
| 343 | Now, 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 | |
| 348 | Install the required packages and share swork (run@host): |
| 349 | {{{ |
| 350 | sudo apt-get install nfs-kernel-server portmap |
| 351 | sudo echo "/home/$USER/swork 192.168.2.15(rw,sync,no_root_squash)" >> /etc/exports |
| 352 | sudo /etc/init.d/nfs-kernel-server restart |
| 353 | }}} |
| 354 | |
| 355 | === 3.1.b.4. Setup NFS on N9 === |
| 356 | |
| 357 | Create script for mounting NFS (run@host): |
| 358 | {{{ |
| 359 | ssh user@192.168.2.15 "mkdir /home/user/swork; \ |
| 360 | echo 'opensh -c \"/sbin/portmap; /sbin/modprobe nfs; mount -t nfs 192.168.2.14:/home/$USER/swork /home/user/swork\"' > nfsmount.sh; \ |
| 361 | chmod +x nfsmount.sh " |
| 362 | }}} |
| 363 | |
| 364 | Connect to N9 (run@host) |
| 365 | {{{ |
| 366 | ssh user@192.168.2.15 |
| 367 | }}} |
| 368 | |
| 369 | Mount 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 === |
| 378 | Now create script for setting environment variables (run@host): |
| 379 | |
| 380 | {{{ |
| 381 | ssh user@192.168.2.15 "echo 'export QTDIR=/home/user/swork/qt5/qtbase' > nfsenv.sh; \ |
| 382 | echo 'export QT_IMPORT_PATH=/home/user/swork/qt5/qtbase/imports' >> nfsenv.sh; \ |
| 383 | echo 'export QML_IMPORT_PATH=/home/user/swork/qt5/qtbase/imports' >> nfsenv.sh; \ |
| 384 | echo 'export LD_LIBRARY_PATH=/home/user/swork/qt5/qtbase/lib:/home/user/swork/qtwebkit-webkit2-dev-builddir-armel-m6/Release/lib' >> nfsenv.sh; \ |
| 385 | echo 'export QT_PLUGIN_PATH=/home/user/swork/qt5/qtbase/plugins' >> nfsenv.sh; \ |
| 386 | echo 'export QT_QPA_PLATFORM_PLUGIN_PATH=/home/user/swork/qt5/qtbase/plugins/platforms' >> nfsenv.sh; \ |
| 387 | echo 'export QT_QPA_PLATFORM=xcb' >> nfsenv.sh; \ |
| 388 | echo 'export WEBKIT_TESTFONTS=/home/user/swork/testfonts' >> nfsenv.sh; \ |
| 389 | echo '# export TZ=/usr/share/zoneinfo/America/Los_Angeles' >> nfsenv.sh; \ |
| 390 | echo 'export PATH=/home/user/swork/qt5/qtbase/bin:$PATH' >> nfsenv.sh" |
| 391 | }}} |
| 392 | |
| 393 | |
| 394 | Load 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 | |