View Single Post
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: