Editing Booting from a flash card

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
-
This article covers the steps you need to follow to boot from a flash card with an [[Nokia N800|N800]] on [[Nokia N810|N810]]. The process is somewhat involved, so some familiarity with the command line is recommended.
+
Here are the links to older pages on which this one is based:
-
Advanced users may wish to read [[advanced booting]] as well, for more advanced booting-related configuration and setup information.
+
*[[How to Boot the root filesystem from MMC]]  
 +
*BootMenu
 +
*ExtendedRootFilesystem
 +
*ModifyingRootImage
 +
*HowTo_GetStartedWithSardine
-
== Why would we want to boot from a flash card? ==
+
=Why would we want to boot from MMC?=
 +
*Because we'll have enough space to INSTALL as MANY applications as may fit in our (GB-size) MMC card.
 +
*Because we'll have an INTACT COPY of the original system. So that if something goes wrong, we'll be able to BACKUP the system without reflashing the device.
 +
*Because we'll still be able to mount our MMC on a Windows-based PC via USB.
 +
*Because the whole system won't be based on a compressed and journalized filesystem (jffs2) so the result may be faster due to lower CPU usage (no (de)compression with each read/write operation) and faster SD/MMC speed (depends on card and may require custom kernel - 770, N800)
 +
 +
=Known working devices=
 +
This procedure has been tested on the following configurations:
 +
{|
 +
| '''Hardware''' || '''Software'''
 +
|-
 +
| Nokia N770 ITOS 2006 || 3.2006.49-2
 +
|-
 +
| Nokia N800 ITOS 2007 || 2.2006.51-6 1
 +
|-
 +
| Nokia N800 ITOS 2007 || 4.2007.26-8
 +
|}
-
* For more space to install applications.
+
1 The first time I tried this on my N800 it led to continuous reboots 30-90 seconds after booting. Trying it a second time on a clean install (directly after flashing and erasing everything already on the device) worked fine.
-
* An easy-to-use bootable backup.
+
-
* To improve performance (note, this is dependent on the quality of your flash card).
+
-
== Gain root access ==
+
This procedure should work with any device listed at http://fanoush.wz.cz/maemo/#initfs
-
First of all you need to be able to gain [[root access]].
+
It is supposed that without any previous knowledge you should be able to accomplish the whole procedure. Ask for help in case something goes wrong. I'll be happy to help you at the following e-mail address: sebastian.maemo{AT}gmail.com
-
== Partition your card ==
+
=='''First of all''': you need to become root==
 +
First of all you need to be able to get ROOT access from an Xterm on your Tablet. If you don't know how to do it, please follow this link, and come back when ready: http://maemo.org/community/wiki/HowTo_EASILY_BecomeRoot/
-
Follow the instructions to [[partitioning a flash card|partition your card]].
+
=='''Second''': you need to partition your MMC! ==
 +
Follow this link to find the instructions to partition the MMC card: http://maemo.org/community/wiki/HowTo_EASILY_Partition_your_MMC_card/
-
== Install the necessary tools ==
+
Once you've partitioned your MMC, come back to this page and go on with the process...
-
First, we need to install wget, so open [[terminal|Xterm]] and, '''as root''', run:
+
==How to install a dual boot menu? ==
 +
Connect your device via the AC/DC power adaptor to the main power supply, or verify the battery is fully charged. It's important not to run out of battery in the middle of this operation.
-
apt-get install wget
+
From your own Tablet use the browser to download this file from Fanoush's webpage: http://fanoush.wz.cz/maemo/initfs_flasher.tgz
-
Then run:
+
Supposing it's been downloaded to the fold named Documents, open an Xterm and type AS ROOT:
-
  mkdir -p /home/user/bin
+
  # cd /home/user/MyDocs/.documents/
-
cd /home/user/bin
+
  # tar zxvf initfs_flasher.tgz
-
  wget <nowiki>http://www.nmacleod.com/nokia/bin/nupgrade.sh</nowiki>
+
  # cd initfs_flasher/
-
  wget <nowiki>http://www.nmacleod.com/nokia/bin/tar</nowiki>
+
  # ./initfs_flash
-
  chmod +x nupgrade.sh tar
+
-
Then, to install the proper filesystem tools, temporarily add [[Extras-devel]] and run:
+
Just follow instructions.
-
apt-get install e2fsprogs
+
Now it's time to clone the whole original system !<br>
 +
Connnect to Internet for apt-get to work below.
-
'''NOTE: Do not upgrade existing packages with Extras-devel enabled as this may break things in new and interesting ways.'''
+
If you are working on an N770, SKIP THIS STEP. If you are working on an N800 running OS2007, you'll have to type as ROOT:
 +
# insmod /mnt/initfs/lib/modules/2.6.18-omap1/mbcache.ko
 +
# insmod /mnt/initfs/lib/modules/2.6.18-omap1/ext2.ko
-
Remove Extras-devel when finished.
+
For Nokia 770 with IT2006 or hacker edition type this instead:
-
== Install bootmenu ==
+
# insmod /mnt/initfs/lib/modules/current/ext2.ko
-
Now we need to download and install fanoush's [http://fanoush.wz.cz/maemo/#initfs initfs flasher], so, '''as root''', run:<br />
+
NOW FOR ALL DEVICES, continue by typing as ROOT:
-
<small>''Note, although putting initfs_flasher in the directory given is not required, it ''cannot'' be placed on a FAT partition (i.e., one of the cards).''</small>
+
-
  cd /home/user/bin
+
  # mkdir /opt/
-
  wget <nowiki>http://fanoush.wz.cz/maemo/initfs_flasher.tgz</nowiki>
+
  # mount /dev/mmcblk0p2 /opt
-
  tar zxvf initfs_flasher.tgz
+
# mkdir /floppy/
-
cd /home/user/bin/initfs_flasher/
+
  # mount -t jffs2 -o ro /dev/mtdblock4 /floppy
-
=== Configuration ===
+
The following command will generate dire warnings and prompts, requiring you to type YES. However, -d tells apt-get to only download the package and not install it, so it's safe to ignore those warnings and type YES... You need to be connected to internet for apt-get to work.
-
This is an optional step, but if you want to customize the bootmenu to properly reflect your partitioning setup, change the partition labels, and a number of other options, then you'll need to rename the appropriate <code>bootmenu.conf.''device''.example</code> file to <code>bootmenu.conf</code> and edit it to your liking. The README included with flasher and the comments in the configuration file should be enough to tell you what everything is.
+
# apt-get -d install tar
 +
# cd /var/cache/apt/archives/
 +
# mkdir /tar-temp/
 +
# dpkg -x tar*.deb /tar-temp/
-
The [[flasher]] will ask you if you want to include your <code>bootmenu.conf</code> file if you renamed it properly.
+
Before continuing it is better to close internet connection...
-
=== Flash the initfs ===
+
# cd /tar-temp/bin/
 +
# cp tar targnu
 +
# ./targnu cf - -C /floppy . | ./targnu xvf - -C /opt
-
cd /home/user/bin/initfs_flasher/
+
I have repeated this process many times in my little Nokia 770 without experiencing any problem... Nevertheless, here follow some warnings from other users: For Nokia 770 make sure you have installed bugfix for memory corruption bug, details also here. Also in newer ITOS releases, apt-get will simply say "selecting busybox instead of tar" and refuse to do anything. The tar program in the bora SDK is actually an x86 binary, so it will not work. You will have to download the tar package directly from http://repository.maemo.org/pool/maemo3.2/free/binary/tar_1.14-2.1osso_armel.deb, after which you can basically follow the instructions above, replacing /var/cache/apt/archives with wherever you put the .deb file.
-
./initfs_flash
+
-
 
+
-
Follow the onscreen instructions. You can answer yes to all of these questions if you don't understand what they mean.
+
-
 
+
-
=== Set the default boot device ===
+
-
 
+
-
Once the initfs is flashed, you may wish to change to default boot device so the tablet will boot into your preferred partition without intervention. To do this, '''as root''', run:
+
-
 
+
-
chroot /mnt/initfs cal-tool --set-root-device ask:mmc2
+
-
 
+
-
To set the default to partition 2 on the internal card. If you would like to set the default to something else, the device is <code>mmc''#''</code> (where # is the partition number) for the internal card, and <code>mmc1''#''</code> for the external card. To set it back the default behavior of booting from the built-in flash, use <code>flash</code>.
+
-
 
+
-
On the [[Nokia N810|N810]] with latest [[Open development/Maemo roadmap/Diablo|Diablo]] version (5.2008.43-7), the device name is slightly different: <code>immc''#''</code> for the internal card and <code>mmc''#''</code> for the external one. For details see inside bootmenu.conf (or bootmenu.sh). The name is customizable and corresponds to the MENU_x_ID="name" line of the item x you want to select.
+
-
 
+
-
== Clone to the card ==
+
-
 
+
-
<small>''Many thanks to milhouse for writing and maintaining this script.''</small>
+
-
 
+
-
Now it's time to clone your install over to partition 2 of the internal card. The script works in stages to allow better control and error detection, and should take about 10 minutes to complete:
+
-
 
+
-
* 0 - Create ext2 filesystem on partition 2 of the Internal memory card
+
-
* 1 - Mount partition 2 as /opt
+
-
* 2 - Mount rootfs as /floppy
+
-
* 3 - Perform cloning process
+
-
* 4 - Commit filesystem updates and unmount /floppy and /opt
+
-
 
+
-
So, '''as root''', run:
+
-
 
+
-
cd /home/user/bin
+
-
./nupgrade.sh 0
+
-
 
+
-
If the following error occurs: "''Unable to locate mbcache.ko - aborting''"
+
-
follow the instructions per this link:  [http://www.internettablettalk.com/forums/showpost.php?p=174911&postcount=336]
+
-
+
-
./nupgrade.sh 1
+
-
If the following error occurs:
+
-
<br>"Installing ext2.ko module and mounting Internal Flash card, second partition...
+
-
insmod: can't open '/mnt/initfs/lib/modules/current/ext2.ko': No such file or directory
+
-
mount: mounting /dev/mmcblk0p2 on /opt failed''"<br>
+
-
do the following (similar to the above remedy during error of "./nupgrade.sh 0") <br>cp /mnt/initfs/lib/modules/$(uname -r)/ext2.ko /lib/modules/$(uname -r)/ <br>and repeat "./nupgrade.sh 1"
+
-
./nupgrade.sh 2
+
It will take a while to finish last command, but do not worry about it. In the end you may see tar warning about implausible time stamp which is OK. Then you will be ready to go on with the procedure:
-
./nupgrade.sh 3
+
-
./nupgrade.sh 4
+
-
reboot
+
-
Your device will reboot when done, and you can select the partition you want to boot from from the bootmenu.
+
# umount /opt
 +
# umount /floppy
 +
# chroot /mnt/initfs cal-tool --set-root-device ask:mmc2
 +
# shutdown -r now
-
== Remove the menu ==
+
And the process is complete. After rebooting the Tablet, you should be able to boot from the MMC card. You'll then be able to install as many applications as fit into the card. And if there's any problem in the future, you can always boot from the flash and recover the original system and start again ;)
-
If you decide you do not wish to see the bootmenu any longer, you can uninstall it by either [[updating the firmware|reflashing the whole OS image]], or just flashing the initfs (in Linux and OS X) by running:
+
==Removing the menu==
 +
If you decide you do not wish to see the menu on each boot or you do not wish to boot from mmc anymore and go back to using internal flash only, type this (as root):
-
  sudo ./flasher-3.0 -F <FIASCO image> --flash-only=initfs -R
+
  # chroot /mnt/initfs cal-tool --set-root-device flash
-
== Advanced booting ==
+
To remove the (harmless) 'Press menu key ..." message early on boot you need to restore your initfs backup (if you decided to create one)
-
For more advanced configuration and setup information for booting-related stuff, please see [[advanced booting]].
+
# cd /home/user/MyDocs/.documents/initfs_flasher/
 +
# ./initfs_flash initfs.orig.jffs2
-
[[Category:Power users]]
+
or you can reflash whole firmware (Windows) or restore just initfs part (Linux). Both initfs restoration steps are a bit risky and can cause data loss if something goes wrong so it may be good idea to simply live with the message until you decide to upgrade to next firmware or want to reflash whole device anyway. It does not slow down device booting or do any other harm.
-
[[Category:N8x0]]
+
[[Category:HowTos]]

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)