Sailfish

= Introduction =

Introduction

= Credits =

This guide has been compiled from numerous previous sources and credits are due to lots of individuals for their original work, methods and support to the community, including: rzr, souran, Martin Brook, vgrade, mikecomputing, TMavica, krnlyng/liar, max83, flotron, juiceme, contributors to piratepad, Nemo contributors and anyone else trying to make Sailfish run on the Nokia N9/N950.

Please help by contributing any information or methods you have to help make Nemo and Sailfish run better on the Nokia N9/N950.

=Installation environment=

The guide assumes some basic Linux knowledge although help can be obtained in this thread should the need arise.

A tested environment has been as follows:
 * Windows 7 Host
 * Debian v7.2 x64 as a Virtual Machine Running on VMware. Virtualbox is free-ware and should work fine too. Any Linux distribution shall work but the instructions that follow have been used on Debian with Root Terminal. Live ISO's are also an option however files may not be retained on following reboot therefore it is advised to store everything on a local hard disk or removable drive.

It is strongly recommended to do everything on the Linux installation as it can easily read the EXT3/4 partitions presented by the MOSLO and Ubiboot maintenance modes.

There can be a loss of Internet connectivity (until reboot) on the Linux machine when in MOSLO/Ubiboot maintenance mode therefore a second device with internet capabilities is recommended.

For a Windows only installation, please follow the guide then proceed to Step W when prompted.

= Notes =

If your handset is factory SIM-locked, it may not be possible to install unsigned kernels, thus Sailfish. There is currently no known work-around and unlocking the handset after purchase does not seem to alleviate this issue.

To completely turn off the handset manually, hold the power button for ~8 seconds.

When extracting a tarball ending with .tar, use "tar --numeric-owner -xvf ". If you get a message stating "invalid tar magic", it is probably .tar.bz2 therefore use "tar --numeric-owner -xvjf".

Lack of the package jolla-xt9 means there is no text correction engine in Sailfish. This also manifests as no Pīnyīn to Hanzi conversion for input of the Chinese language.

If you have any installation questions or issues, please ask them in this thread on talk.maemo.org. Please refrain from asking Ubiboot related questions in this thread. Ubiboot related questions should be posted in this thread.

=Downloadable Resources=

These resources are required to get Sailfish working on your Nokia N9/N950.

Firmwares
Obtain Nokia N9 firmwares from skeiron.org or mrcrab.net

Kernels
Obtain the OpenMode kernel from swagman.org

Obtain the MOSLO kernel from: nemomobile.org or multiupload.nl (zip file)

Ubiboot
Obtain Ubiboot from swagman.org Download the latest version available. For more information on Ubiboot, please visit the Maemo Community Wiki article

Sailfish Images
There are numerous images available for download.

SourenAraya's Sailfish images
Available for download from: araya.su The newer images have Terminal pre-installed on Sailfish v1.0.1.10

max83's image
Available from mediafire.com This image has Terminal, Maps and a few third party applications pre-installed on Sailfish v1.0.0.5

vgrade's Kickstarter
Available from https://github.com/martinbrook/jolla-n950-kickstart

This script allows compositions of an image using the MerSDK kit.

Please see Mer Project Platform SDK and Martin Brook's blog for more information about creating your own image.

=Additional Reading Material=

These are not required to be read for installation but many of the latest developments are highlighted here.

rzr's n950club PiratePad IRC - IRC Chat for support and discussion. Monthly meetings on the first Sunday of month at 19:00 UTC.

=Installation Guide=

Step 1 - Backup your N9

 * Backup your Nokia N9 using Nokia Suite for PC or the phone's built-in utility in Setting. Also backup you EMMC (MyDocs) by connecting your Nokia N9 to your PC in "USB Mass Storage Mode".
 * If you have used the built-in tool, connect your phone as "USB Mass Storage Mode" and ensure you have backed up the .backup folder on your PC.
 * Close all your open applications on your Nokia N9. It is recommended that you backup up /home/.config, /home/.local and /home/.whatsup (or/home/.wazapp) too so you have the configurations and settings for your installed applications. This can easily be achieved by using N9QuickTweak. Install it, choose Option "H", and select "Enable SSH for root". Now, use WinSCP or Filezilla to access you phone and copy these folders to your PC.
 * Backup your backups.

Step 2 - Re-flash your Nokia N9 to factory firmware

 * Note: Flashing can permanently damage or brick your Nokia N9. Do so at your own risk.
 * Download the firmware you wish to use Harmattan with from skeiron.org or mrcrab.net. Your factory product code is printed on your SIM tray e.g. 059J245. You want the two files containing "DFL _61" e.g. A6D5F456_DFL61_HARMATTAN_40.2012.21-3_PR_LEGACY_005-OEM1-958_ARM.bin and 59BEC3BC_DFL61_HARMATTAN_40.2012.13-7.SEAP_EMMC_SEAP.bin.
 * Rename your firmware to "main.bin" and "emmc.bin" respectively and copy them to the directory where the flasher program is installed (e.g. "C:\Program Files\Nokia\Flasher"). Check the Maemo Community Wiki Nokia N9 Flashing Guide for further information.
 * Ensure your handset is fully charged. Disconnect from all cables from it and turn off.
 * If you have not already, download the Flasher for your system and install it. You want v3.12.1 from here

cd /d "C:\Program Files\Nokia\Flasher" (for Windows)
 * Open up a Root Terminal (Or Terminal and gain root/use sudo) or an elevated cmd.exe (by running it as Administrator on Windows Vista onwards) and set the directory to where flasher is located:

flasher -i
 * By connecting the USB cable to the computer and the turned off phone, you will initialise the Flashing Mode.
 * This status can be checked with the command:

flasher -F main.bin -F emmc.bin -f
 * Flash your firmware with the command:

flasher -f -F main.bin --erase-user-data=secure -F emmc.bin --erase-mmc=secure This should flash the handset but takes a few hours to complete therefore is best left to run overnight.
 * If flashing fails e.g. due to a Partition Mismatch, Security Code On Status or No Reply from Ping, you can try the following. There is a risk of bricking your phone and no warranty is provided by anyone!
 * Completely turn off the handset.
 * Start flasher with the following command:

Pressing CTRL + Z in a Linux Terminal Opening Task Manager (CTRL+ALT+DEL) and Ending the tasks cmd.exe and flasher.exe in Windows flasher -F main.bin -F emmc.bin -f
 * If you do not wish to wait, you can stop the zeroising task and pull out the USB cable from the handset. This is a risky manoeuvre and could permanatly The task can be stopped by:
 * Now completely turn off the phone.
 * Turn it on and you will get a message asking you to "Install and Authorised Operating System"
 * Turn the phone back off.
 * In flasher, run:
 * The phone should proceed to flash normally.

Step 3 - Flash the OpenMode!
flasher -a main.bin -k zImage_2.6.32.54-openmode_l2fix --flash-only=kernel -f -R"
 * Download the OpenMode kernel from swagman.org and place it in the same directory as flasher and your firmware files.
 * Flash the OpenMode kernel and reboot your phone with:

Step 4 - Prepare Harmattan

 * Let Harmattan load up and run for a few minutes so you have date and time set correctly and the handset is fully functional.
 * Install Developer Mode on Harmattan so Terminal is made available as it is useful later on and required if are do not Linux.
 * (Optional) Install N9QT from here and choose Option "H", and select "Enable SSH for root". This will allow you to run commands on Harmattan from your PC and enables copying and pasting of commands and files to and from your PC easily.

Step 5 - Re-partition your handset

 * Turn off your handset. If you have not already, start up a Linux computer/virtual machine.
 * Download the MOSLO kernel from nemomobile.org or multiupload.nl. Windows users must download from multiupload.nl as it is a .zip file. Extract the files using "Archive Manager" or an unzipping utility and copy them to where flasher and your firmware files are.


 * Flash the MOSLO kernel using:
 * flasher -k zImage-moslo -n initrd-moslo -l -b
 * Allow MOSLO to repartition your handset.


 * If you are a Windows user, please now proceed to Step W - Install Sailfish (Windows only Users).


 * If you are a Linux user, MOSLO will now connect the "Alt_OS" partition to your PC. Disconnect the phone and turn it off completely.

You can now either proceed to installing Sailfish (Step 7) or continue installing Ubiboot for a newer and customisable boot-loader and the future ability to have Nitdroid and Firefox OS on your handset (see the Maemo Community Ubiboot Wiki Page for further details.

Step 6 - Install Ubiboot
flasher -a main.bin -k zImage_2.6.32.54-ubiboot-02_301013 --flash-only=kernel -f -R
 * Download and extract the latest Ubiboot from swagman.org into the directory where flasher, main.bin and emmc.bin reside.
 * Install the ubiboot kernel with:


 * Leave the cable plugged in and allow Ubiboot to enter maintenance mode.

4 Removable Partitions will be visible in Computer. These are "rootfs" (Harmattan root filesystem), "Alt_OS" (where nemo/sailfish lives) "x767x676x7c6" (a random string of letters +/- numbers. This is where you can install Nitdroid and Firefox OS if you wish. It is also the "/home/" directory in Harmattan but NOT "/home/user/MyDocs"). "Nokia N9" is "/home/user/MyDocs" directory on Harmattan [EMMC/USB Mass Storage Mode]).

NB: If you format Alt_OS, it will get a random string of letters and numbers, like the "/home/" directory. It is the 4.2GB file system.


 * Go to "/media/Nokia N9" on your PC (Harmattan's Mass Storage). Make a directory called "boot".
 * Copy "ubiboot.conf" and "ubiboot-02.menus.cpio" from the extracted ubiboot-02_310513.tar into "/media/Nokia N9"/boot".
 * Go to "/media/rootfs" on your PC to access Harmattan's root file system. Go to the "boot" directory ("/media/rootfs/boot"). Copy "zImage_2.6.32.54-openmode_l2fix" (which was flashed earlier) into "/media/rootfs/boot").


 * If you have boot issues, please consult for help in the Ubiboot thread on talk.maemo.org so the Sailfish thread remains for Sailfish issues!

Step 7 - Install Sailfish
tar --numeric-owner -xvjf sailfish.tar.bz2 -C /media/Alt_OS/
 * Now download the Sailfish image of choice, or compile your own using the Mer SDK. Rename it to sailfish.tar.bz2
 * Extract the Sailfish archive to "/media/Alt_OS" on your PC with:

Enable Root Access
After the extraction has finished, this is a good time to enable root access in Sailfish and root login via SSH. This will allow you to remotely access your device after WLAN has been set up and avoid all the chrooting hassle! To get rest root's password (MAX9's method), enter the following into your PC terminal: nano /media/Alt_OS/etc/shadow # Open the shadow file where Alt_OS is mounted

On the first line, you will have (where XXXXX are 5 numbers): root:34.random.letters.numbers.and.symbols:XXXXX:0:99999:7:::

Now, delete the all letters, numbers and symbols after "root:" and before :XXXXX:0:99999:7:::

For example, change: root:$1$00Z6Bfjc$vlIKUOMHIavIABL1gNuy6/:16049:0:99999:7::: into: root::16049:0:99999:7:::

Save and exit the file (CTRL+X, Y to save).

Now, when you boot into Sailfish, you will not have a password for root. To set a root password, open Terminal in Sailfish and enter: passwd root nemo # Enter your password for root nemo # Repeat your password for root

Enable Root SSH Access
This is also a good time to enable root SSH access. In your PC's root terminal, enter the following: nano /media/Alt_OS/etc/ssh/sshd_config

Now, go to an empty line in the file and type in the following: PermitRootLogin yes

Again, save and exit the file (CTRL+X, Y to save).

Step W - Install Sailfish (Windows only Users)

 * Download Sailfish image of choice. Rename it to sailfish.tar.bz2
 * In Harmattan, install Developer Mode if you haven't already. Connect the phone to Windows in "USB Mass Storage Mode ".
 * Copy sailfish.tar.bz2' to the root of your MMC (X:\, where X is the letter of your removable drive).
 * Disconnect the phone from the PC and remove the USB cable.
 * Launch Terminal on Harmattan (or SSH in) any type the following commands:
 * devel-su
 * rootme # Or your root password
 * cd /home/user/MyDocs/
 * ls # Here, you should see all your MyDocs and sailfish.tar.bz2


 * mkdir /sailfish # Mount Alt_OS in Harmattan
 * mount /dev/mmcblk0p4 /sailfish


 * tar --numeric-owner -xvjf sailfish.tar.bz2 -C /sailfish/ # This will take a while as it extracts Sailfish onto the handset
 * sync

You can now exit Terminal and reboot into Sailfish or Enable root SSH access on Sailfish, starting at "mount -o bind /proc /sailfish/proc".

To upgrade to a new image, simply delete everything in /media/Alt_OS ("rm -frv /media/Alt_OS/*") when on a Linux PC or "rm -frv /sailfish/'''*" when you have mounted Alt_OS in Harmattan. You will loose ALL your Sailfish data!'''

Step 8 - Boot into Sailfish
Disconnect your USB cable and turn off the handset completely. Turn it back on. If done correctly, this should present you Ubiboot boot-manager and 6 available operating system logos. Sailfish and Harmattan shall work.

If you do not select an OS, Harmattan will boot by default.

To boot into Sailfish, tap the Nemo icon (3rd one down on the left, looks like a blue padlock) and tap either "latest 2.6.32" or "vmlinuz-2.6.63.20120129.1-n950". For Harmattan, it is "openmode+l2 fix".

On your first boot, select your input and display languages. Next, select a theme colour. After going forward, you may have to go back and select your theme colour again and go forward again before the page that allows you to set the date and time appears.

You can then connect to the Internet if you wish to login or sign up for a Jolla account.

On Step 1 of the tutorial, you will be asked to do a edge left-right or edge right-left swipe to minimise the application. Due to an accelerometer bug, you have to swipe from the edge bottom upwards to minimise. You can then press and hold on the minimised Tutorial application view to close it.

To close an application, swipe from edge right to left. To view Notifications, swipe edge left to right. The phone cannot be turned off when the lock-screen is active.

=Bugs and Known Issues=
 * No text correction engine therefore also no Pīnyīn to Hanzi conversion.
 * No Android capability as of present.
 * Camera does not work.
 * Accelerometer does not work.

=Additional Guidance=

Date/Time Fix
The date/time may not set correctly in Sailfish. To fix this, boot into Harmattan and fire up terminal:

'''devel-su rootme # Or you root password date --set "2013-12-07 22:59"

Enable Root Access (Windows Users)
If you are using Windows or did not enable root access earlier, the following instruction will show you how. The procedure is the same as that which was explained previously in Step 7 but takes place in Harmattan as opposed to on a Linux computer.

Load Harmattan and open Terminal. Type the following: '''devel-su '''cd / '''mkdir sailfish '''mount /dev/mmcblk0p4 /sailfish nano /sailfish/etc/shadow # Open the shadow file where Sailfish is mounted

On the first line, you will have (where XXXXX are 5 numbers): root:34.random.letters.numbers.and.symbols:XXXXX:0:99999:7:::

Now, delete the all letters, numbers and symbols after "root:" and before :XXXXX:0:99999:7:::

For example, change: root:$1$00Z6Bfjc$vlIKUOMHIavIABL1gNuy6/:16049:0:99999:7::: into: root::16049:0:99999:7:::

Save and exit the file (CTRL+X, Y to save).

Now, when you boot into Sailfish, you will not have a password for root. To set a root password, open Terminal in Sailfish and enter: passwd root nemo # Enter your password for root nemo # Repeat your password for root

Enable Root SSH Access
This is also a good time to enable root SSH access. In Harmattan's terminal, enter the following: nano /sailfish/etc/ssh/sshd_config

Now, go to an empty line in the file and type in the following: PermitRootLogin yes

Again, save and exit the file (CTRL+X, Y to save).

Chroot into Sailfish from Harmattan
This is based on krnlyng's (liar) method. It is useful for access to Sailfish to run terminal commands such as updating the OS.

Open terminal in Harmattan and type: '''devel-su '''cd / '''mkdir sailfish '''mount /dev/mmcblk0p4 /sailfish '''mount -o bind /proc /sailfish/proc '''mount -o bind /sys /sailfish/sys '''mount -o bind /dev /sailfish/dev '''/usr/sbin/chroot /sailfish

When you have finished in Sailfish, exit and unmount with the following commands:

exit

'''umount /sailfish/dev '''umount /sailfish/proc '''umount /sailfish/sys umount /sailfish exit # Exit out of devl-su exit # Exit out of Terminal

Developer Mode frame rate issue
When in developer mode, do not enable "Display Framerate". It causes random colour drawings on the screen, making it impossible to disable. To fix (credits to liar), open SSH into your handset and type: nano /home/nemo/.gconf/desktop/jolla/%gconf.xml Ensure that that there is nothing between the stringvalue option, as below:  

Save and exit (CTRL + X, Y to save). Reboot the handset and it should display everything correctly again.

Proximity sensor Fix
To fix the proximity sensor (this must be done at every boot), in Sailfish terminal type: su nemo # Your root password '''echo 1 > /sys/devices/platform/i2c_omap.2/i2c-2/2-0039/prox_enable