View Single Post
qwazix's Avatar
Moderator | Posts: 2,622 | Thanked: 5,447 times | Joined on Jan 2010
#14
Tutorial Time

First things first.


1. The N900 rootfs is not redistributable, so the only thing I can do is write how to obtain it (if you have a N900).
2. You need a linux box for this procedure, either virtual or real. It is possible that those steps that require linux could be done on a N900 with kernel-power but this is not certain
3. These are early stages, I've got many problems to solve, hopefully with some help from the community this project can be made usable day to day
4. Requires open mode, I don't know if inception can be used alternatively


How to get fremantle image.

Create a working directory N900root

Go here http://tablets-dev.nokia.com/nokia_N900.php, enter your IMEI and download
RX-51_2009SE_20.2010.36-2_PR_COMBINED_MR0_ARM.bin (latest global N900 firmware)
michaelmhk says that if you haven't got a N900 you can download the firmware from NaviFirm
Go here http://tablets-dev.nokia.com/maemo-d...-downloads.php and download maemo_flasher-3.5_2.5.2.2.tar.gz, or maemo_flasher-3.5_2.5.2.2_i386.deb if you have 32bit ubuntu/debian.

Install the flasher or extract the binary from the tar.gz in your working directory

Unpack the .bin file you just downloaded
Code:
flasher-3.5 -u -F RX-51_2009SE_20.2010.36-2_PR_COMBINED_MR0_ARM.bin
if you installed or otherwise
Code:
./flasher-3.5 -u -F RX-51_2009SE_20.2010.36-2_PR_COMBINED_MR0_ARM.bin
You'll end up with a bunch of files in the working directory

Using a root prompt (sudo su) execute the following commands to mount the rootfs file to your system. Some commands are there just for checking if you've done well (cat and ls commands should produce similar output). You may need to create /mnt/n900 directory
Code:
# modprobe mtdblock

# modprobe ubi

# modprobe nandsim first_id_byte=0x20 second_id_byte=0xaa third_id_byte=0x00 fourth_id_byte=0x15

# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 10000000 00020000 "NAND simulator partition 0"

# ls -la /dev/mtd*
brw-r--r-- 1 root root 31, 0 2009-12-01 18:50 /dev/mtd0
brw-rw---- 1 root disk 31, 0 2009-12-01 19:06 /dev/mtdblock0

# dd if=rootfs.jffs2 of=/dev/mtdblock0 bs=2048
74688+0 records in
74688+0 records out
152961024 bytes (153 MB) copied, 5.87334 s, 26.0 MB/s

# ubiattach /dev/ubi_ctrl -m 0
UBI device number 0, total 2048 LEBs (264241152 bytes, 252.0 MiB), available 0 LEBs (0 bytes), LEB size 129024 bytes (126.0 KiB)

# ls -la /dev/ubi*
crw-rw---- 1 root root 252,  0 2009-12-01 19:06 /dev/ubi0
crw-rw---- 1 root root 252,  1 2009-12-01 19:06 /dev/ubi0_0
crw-rw---- 1 root root  10, 58 2009-12-01 19:05 /dev/ubi_ctrl
# mount -t ubifs ubi0_0 /mnt/n900/

# ls -la /mnt/n900 | head
total 4
drwxr-xr-x 22 root root 1504 2009-10-30 14:36 .
drwxr-xr-x  9 root root 4096 2009-10-25 20:02 ..
drwxr-xr-x  2 root root 3920 2009-10-30 14:31 bin
drwxr-xr-x  2 root root  232 2009-10-30 14:48 boot
drwxr-xr-x  2 root root  160 2009-10-30 14:28 cdrom
drwxr-xr-x  3 root root 3808 2009-10-30 14:37 dev
drwxr-xr-x  2 root root  160 2009-10-30 14:28 .dev
drwxr-xr-x 72 root root 7488 2009-10-30 14:48 etc
drwxr-xr-x  2 root root  160 2009-10-30 14:28 floppy

#
These instructions are courtesy of x86 from this post http://talk.maemo.org/showthread.php?p=403015

Now you have a maemo rootfs mounted on /mnt/n900. Let's create an image of that node. This website has a very nice explanation of what's happening http://www.debuntu.org/how-to-create...rtition-s-file
We need to execute (change the working dir and the size to one of your liking, bigger than 800mb)
Code:
dd if=/dev/zero of=/path/to/N900root/rootfs.img bs=1M count=1024
mkfs.ext2 /path/to/N900root/rootfs.img
mkdir /tmp/maemoroot
mount -o loop /path/to/N900root/rootfs.img /tmp/maemoroot
Now we can copy all files from the one image to the other
Code:
cp /mnt/n900/* /tmp/maemoroot/
After this command finishes unmount the ext2 image
Code:
umount /tmp/maemoroot
and copy rootfs.img to your N9/50 mass storage (MyDocs)
Now we have to use qole's scripts to get the chroot up and running (http://talk.maemo.org/showthread.php?t=82114)

Download the scripts http://qole.org/files/harmattan/HarmChom.tgz as well as coderus' sudo http://talk.maemo.org/attachment.php...9&d=1332087322 and install sudo.

Code:
AEGIS_FIXED_ORIGIN=com.nokia.maemo dpkg -i sudo_1.6.8p12-4osso28\+0m6_armel.deb
You have to change user password by doing
Code:
passwd user
while root or edit your /etc/sudoers file to look like this

Code:
### Automatically added by update-sudoers start ###
Defaults env_check+="HOME DISPLAY"
Defaults env_keep+="HOME DISPLAY"
Defaults env_reset
user ALL = (ALL) NOPASSWD: ALL
developer ALL = (ALL) ALL
### Automatically added by update-sudoers end ###
Then open the tgz and copy the files in /src/bin except sudo to your device's /bin folder via ssh. Do not copy /etc/ folder, it will mess with your ssh configuration and it is not needed since you just installed sudo. Also do create a /.debian folder in the root of your device.

You should be ready to go, launch a user terminal and
Code:
sudo qchroot MyDocs/rootfs.img /.debian
Now you should be greeted by a maemo 5 busybox
Code:
BusyBox v1.10.2 (Debian 3:1.10.2.legal-1osso30+0m5) built-in shell (ash)
You can install WordPress and run it
Code:
apt-get update
apt-get install wordpress
run-standalone.sh WordPress

Experiments

You can also install gnumeric and run it, but it misses the menu bar, and it doesn't run with a maemo5 theme. It segfaults if you try to run-standalone it.
If you do
Code:
/etc/rc1.d/K20hildon-desktop start #and maybe something else, I tried various rc files
run-standalone.sh gnumeric
it runs with maemo theme but still without a menu. We also need to get rid of harmattan's bottom toolbar.

I suppose we need a fully running hildon-desktop to see the menu, but we are missing xephyr. One solution is to use xephyr from another chroot running debian.

Another thought that if is true it would allow this project to take off is this:

What do we need to run hildon applications in harmattan? Of course drivers, firmware and other blobs are not needed, neither the stock fremantle applications. Hildon-desktop is open and most of the other libs. So theoretically we could create a stripped fremantle image that could be redistributable. Please anybody who can help with this task speak up.

Thanks to all testers for the corrections
__________________
Proud coding competition 2012 winner: ρcam
My other apps: speedcrunch N9 N900 Jolla –– contactlaunch –– timenow

Nemo UX blog: Grog
My website: qwazix.com
My job: oob

Last edited by qwazix; 2012-06-21 at 13:54.
 

The Following 23 Users Say Thank You to qwazix For This Useful Post: