Reply
Thread Tools
Posts: 22 | Thanked: 11 times | Joined on Aug 2007
#1
I wrote a complete noobie guide for booting the Nokia 770 from MMC since I never found one while doing my own research. Please check it for correctness.

-----------------
REV.2:
1. Removed reboot commands for formatting in step 8 per fanoush's suggestion.
2. Revised explanation of EXT3.
3. Linked WLAN hotfix to thread on the topic.
-----------------

This guide will take you step-by-step through hacking your Nokia 770 to make it better and faster. I had a hard time finding all the information I needed to hack my 770 in one place. Instructions I found were also meant more for seasoned developers and Linux-savvy people. So I decided to write my own guide, for the complete noob!

The Plan:
1. Patch the operating system to fix a bug that can corrupt data and cause crashes.
2. Partition the RS-MMC into a Linux partition for the OS and a Windows compatible partition to access the card via USB.
3. Clone the operating system from the internal flash memory to the RS-MMC memory card. This will increase the space available to install program and slightly increase the speed as well. At the same time, the original operating system on the internal memory will be kept intact for backup or recovery mode if the memory card dies.

fanoush says: cloning without using kernel with faster mmc wil not give massive speedups, it will take off some load from CPU due to no jffs2 compression and may make your device more responsive under load but the average read/write speed is about the same (slow mmc vs compressed jffs2). So yes it may speed it up a bit but not significantly so...

4. Install a boot screen to allow you to choose which operating system (OS) to load - the original OS backup on the internal memory, or the OS on the RS-MMC memory card.

// to be added later...
5. Install hack that will increase read/write speed on the memory card which will increase the speed of your 770.

Warning:
1. This guide is a work-in-progress. It has not been thoroughly checked yet.
2. Make sure the 770 is hooked up to AC power, or the battery is full. You don't want it to die in the middle of something critical.
3. This guide has only been tested with OS 3.2006.49-2 and a Kingston 2GB MMCMobile RS-MMC (the fastest you can buy).


Procedure:

1. Get bug hotfix:
Download the WLAN hotfix to your computer and transfer it to a RS-MMC memory card (either the original 64MB card or your new one will do). You don't want to do this on the 770 because using the WiFi may corrupt the OS or the hotfix - the very same thing you are trying to fix. If you don't have a MMC card reader for your computer, you can take a chance by using the 770. If you flash the OS, then there's only the remote chance the hotfix on the memory card is corrupted, and not the OS as well.

2. Flash your 770:
Install OS2006 3.2006.49-2 by running the Nokia update wizard and following the onscreen instructions (hold down 'Home' key while powering on the device). Even if you have the newest OS, it's a good idea to reflash in case you have corrupted data. It is important not to use WiFi before the hotfix is applied!

3. Install bug hotfix:
Pop in the RS-MMC with the hotfix. Install the hotfix by going to Tools->Application manager->Package->Install from file... Select the hotfix on the memory card and install.

4. Become root:
Connect to the internet. Install Xterm and Becomeroot using the following two repositories:
Web address: http://eko.one.pl/maemo/
Distribution: mistral
Components: user

Web address: http://repository.maemo.org/
Distribution: mistral
Components: free non-free

Then go into Xterm and type using your stylus:
sudo gainroot
You now have administrative rights. This would be a good time to assign your root password. To do this, type:
passwd root
5. Install SSH:
Now, we want to install the SSH protocol to communicate wirelessly with the 770 using your computer. This will allow us to issue commands using the keyboard instead of the stylus (very tedious). You have to make sure your wireless connection is reliable though. If not, you have to resort to using Xterm with a stylus, or use a Bluetooth keyboard (which will require a bluetooth hack).
To install the SSH protocol, type in xterm:
apt-get install ssh
6. Install remote XTerm:
To emulate XTerm on Windows after SSH is installed, you'll need to use Putty. Open the program and input your Nokia 770's IP address. You can find the IP address by going to Connection manager menu->Internet connection->IP Address. You can also find out by going into your router config. While you are there, it's not a bad idea to assign a static IP to your 770 MAC address so that the router's DHCP always assigns the same IP to the 770.

7. Partition RS-MMC:
We will now partition the memory card into two partitions. One is for the Linux operating system, and the other will be for transfering files to the card via USB.

Launch putty and log in as root. Now type:
apt-get install e2fsprogs
umount /media/mmc1
sfdisk /dev/mmcblk0
After running the sfdisk command, it will prompt you for the size of the partitions. You can enter something like this:
/dev/mmcblk0p1:1,15000,6
/dev/mmcblk0p2:15001,,
/dev/mmcblk0p3:
/dev/mmcblk0p4:
In the above example, we are assigning the first partition to use 1 through 15000 of cylinders (memory chunks) with type 6 (A.K.A. FAT16, VFAT, or USB compatible). Each cylinder represents 32KB of information with type 6. Hence, we just assigned 15000x32KB = 480MB of space for USB storage/transfer.

The second partition (for Linux OS) is assigned cylinders 15001 to whatever the memory card has left. So on a 2GB memory card, it's approximately 1520MB.

Now will be a good time to talk about the memory allocation - how do you choose how much to use for the OS, and how much is for the USB? The answer is it depends on what you want to do. If you foresee yourself installing a lot of programs, then a larger Linux partition may make sense. If you want the convenience of transfering large size files through USB, then you may want to increase the FAT16 partition. But beware, FAT16 isn't very efficient at storing small files (around 32KB or the chunk size). To overcome this problem, you can format using FAT32 which is also compatible, but I'll leave you to tackle that problem by yourself.

8. Format partitions:
The next step is to format the partitions. Type the following to format the 1st partition to FAT16:
mkdosfs /dev/mmcblk0p1
Format the second partition to a Linux EXT2 partition.
mke2fs /dev/mmcblk0p2
Why are we using EXT2 instead of the more popular EXT3 format? The reason is memory cards will eventually die after a certain amount of writes. EXT3 features a journal system which writes metadata (file system and time keeping information - i.e. filenames, attributes, etc...) twice. Hence, using EXT2 will prolong the life of your memory card.

fanoush says: Yes it it slightly slower and yes it wears the card slightly more but still it may make sense, depends on you, if you use ext2 don't forget to boot from flash and fsck it when device crashes (fsck -fy /dev/mmcblk0p2). --Fsck is a file system checking utility.

9. Install boot menu:
Mount the Linux partition:
insmod /mnt/initfs/lib/modules/current/ext2.ko
mount /dev/mmcblk0p2 /media/mmc2
Download fanoush's boot menu to your Documents folder on your 770 (it's at /home/user/MyDocs/.documents if you want to move it there using WinSCP). Now, type the following:
cd /home/user/MyDocs/.documents/
tar zxvf initfs_flasher.tgz
cd initfs_flasher/
./initfs_flash
Follow the on-screen instructions.

10. Clone OS:
We are now ready to copy the OS to the memory card. First, we need to mount the partitions. Type the following:
insmod /mnt/initfs/lib/modules/current/ext2.ko
mkdir /opt/
mount /dev/mmcblk0p2 /opt
mkdir /floppy/
mount -t jffs2 /dev/mtdblock4 /floppy
I don't know why but we need a new version of tar for the next step. Apt-get the tar debian package and extract the files. It will tell you it will delete some files. Ignore the warning since we told apt-get to only download the package, not install it using the -d parameter. Then rename the executable tar to targnu to avoid evoking the system tar.
apt-get -d install tar
cd /var/cache/apt/archives/
mkdir /tar-temp/
dpkg -x tar*.deb /tar-temp/
cd /tar-temp/bin/
cp tar targnu
We are now ready to start copying over the OS. Type the following command to clone everything including retaining the directory hierarchy. Note, the '|' not the letter 'l'. It's shift-backslash on the keyboard.
./targnu cf - -C /floppy . | ./targnu xvf - -C /opt
11. Almost there:
Unmount the partitions and set the default OS to the one on the RS-MMC:
umount /opt
umount /floppy
chroot /mnt/initfs cal-tool --set-root-device ask:mmc2
shutdown -r now
You are done!

Last edited by brian911; 2007-12-11 at 04:04.
 

The Following 5 Users Say Thank You to brian911 For This Useful Post:
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#2
Just few random comments
- wlan fix - maybe it is better to link the bug in bugzilla or the thread here in case my site goes down

- cloning without using kernel with faster mmc wil not give massive speedups, it will take off some load from CPU due to no jffs2 compression and may make your device more responsive under load but the average read/write speed is about the same (slow mmc vs compressed jffs2). So yes it may speed it up a bit but not significantly so I wouldn't put it on first place when mentioning advantages. Having backup and more room is bigger reason. You can still have it worded like above but someone may complain (after long and frustrating cloning process) that there is no speedup.

-partitioning - sfdisk has -uM argument which takes all units in megabytes, this may be more intuitive when selecting partition size

- rebooting - I think it is not needed to reboot after formatting partition, you can regroup it to make only one reboot after optionally flashing kernel and installing boot menu

-ext3 vs ext2 - ext3 will write only metadata twice, not data, metadata is filesystem timekeeping information (file name, attributes, location of blocks belonging to files), yes it it slightly slower and yes it wears the card slightly more but still it may make sense, depends on you, if you use ext2 don't forget to reboot to flash and fsck it when device crashes

I'm not sure where you will publish this guide but it may be better to improve existing guides, the last 'rewrite targeted for newbies' is here http://maemo.org/community/wiki/howt...from_mmc_card/
__________________
Newbies click here before posting. Thanks.

If you really need to PM me with troubleshooting question please consider posting it to the forum instead. It is OK to PM me a link to such post then. Thank you.
 
Posts: 22 | Thanked: 11 times | Joined on Aug 2007
#3
Thanks for the comments. I will correct them the first chance I get.

As to where to publish the guide, I was thinking of making it a sticky here since the forum is flooded with people asking the same questions.
 
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#4
Originally Posted by brian911 View Post
As to where to publish the guide, I was thinking of making it a sticky here since the forum is flooded with people asking the same questions.
Might be a good idea and won't hurt, thanks. In that case you may also link the guide in wiki and thread with step by step script by Milhouse.
__________________
Newbies click here before posting. Thanks.

If you really need to PM me with troubleshooting question please consider posting it to the forum instead. It is OK to PM me a link to such post then. Thank you.
 
Posts: 22 | Thanked: 11 times | Joined on Aug 2007
#5
Updated guide according to fanoush's comments.

I did not modify the sfdisk command to use -uM as I am unsure how to properly give each partition start and end values.
 
rogue_ronin's Avatar
Posts: 24 | Thanked: 0 times | Joined on Jul 2007 @ Honolulu, HI
#6
Could you flesh out how to reflash the device, and how to install fanoush's kernel?
 
Posts: 133 | Thanked: 8 times | Joined on Aug 2007 @ SF, CA
#7
Hmm.. so if you don't have wi-fi at home, you either:
1) have to type all on the onscreen keyboard, which someone wrote was very long, or
2) could use a blue tooth keyboard?
I was juts wondering, can you reflash without a BT keyboard or wifi? or is it pretty hard.
Also, apt get needs wifi connection? so I have to modify the instructions if I don't use wifi?
I am a complete linux newbie (except I know dos - so understand basic xterm commands), and I need to reflash my 770. I wonder if I can do this without having wifi at home.
[Edit: I realize I need to spend more time reading all the posts about reflashing, so you don't have to explain any basic stuff I can find on my own. Very short answer is OK]

Last edited by nosam; 2007-12-13 at 20:34.
 
Posts: 22 | Thanked: 11 times | Joined on Aug 2007
#8
nosam:
Reflashing the device is relatively simple. You need to install Nokia Internet Tablet Software Update Wizard and follow the prompts. The device connects to your computer with internet via USB so no wifi required.

If you don't have wifi, then you will have to manually download everything needed in the guide on your desktop computer, then transfer the files to your Nokia via the USB cable.

You don't need a BT keyboard to follow the above guide. The first time I hacked my Nokia, I used my stylus. Took about 3 times longer but it still worked.
 

The Following User Says Thank You to brian911 For This Useful Post:
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#9
Originally Posted by nosam View Post
Hmm.. so if you don't have wi-fi at home, you either:
1) have to type all on the onscreen keyboard, which someone wrote was very long, or
2) could use a blue tooth keyboard?
Or you can log into the device via ssh over usbnet (network over usb cable) or over bluetooth PAN (network over bluetooth). Both works with Linux and Windows XP. Both need some searching here or in maemo wiki.
__________________
Newbies click here before posting. Thanks.

If you really need to PM me with troubleshooting question please consider posting it to the forum instead. It is OK to PM me a link to such post then. Thank you.
 
Posts: 22 | Thanked: 11 times | Joined on Aug 2007
#10
Originally Posted by rogue_ronin View Post
Could you flesh out how to reflash the device, and how to install fanoush's kernel?
I am doing further research into which instances this modified kernel is safe. There are two: one that increases read speed - in which my understanding is that it will work with newer cards based on the MMC4.1 standard (not the included 64MB card), and another one that adds to the first hack, but also increases write speed via multiblock writing. This multiblock kernel is what I am using now and it has dramatically increased the speed of my Nokia. However, I have only tested the multiblock kernel with a Kingston 2GB MMCMobile card.
 
Reply


 
Forum Jump


All times are GMT. The time now is 21:11.