Booting from a flash card

(Install bootmenu)
(clarify that article is for N8x0 users)
 
(30 intermediate revisions not shown)
Line 1: Line 1:
-
This article covers the steps you need to follow to boot from a flash card. The process is somewhat involved, so some familiarity with the command line is recommended.
+
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.
Advanced users may wish to read [[advanced booting]] as well, for more advanced booting-related configuration and setup information.
Advanced users may wish to read [[advanced booting]] as well, for more advanced booting-related configuration and setup information.
== Why would we want to boot from a flash card? ==
== Why would we want to boot from a flash card? ==
 +
* For more space to install applications.
* For more space to install applications.
-
* An easy-to-user bootable backup.
+
* An easy-to-use bootable backup.
* To improve performance (note, this is dependent on the quality of your flash card).
* To improve performance (note, this is dependent on the quality of your flash card).
-
+
 
== Gain root access ==
== Gain root access ==
Line 18: Line 19:
== Install the necessary tools ==
== Install the necessary tools ==
-
First, we need to install wget, so open Xterm and, '''as root''', run:
+
First, we need to install wget, so open [[terminal|Xterm]] and, '''as root''', run:
  apt-get install wget
  apt-get install wget
Line 30: Line 31:
  chmod +x nupgrade.sh tar
  chmod +x nupgrade.sh tar
-
Then, to install the proper filesystem tools, run:
+
Then, to install the proper filesystem tools, temporarily add [[Extras-devel]] and run:
  apt-get install e2fsprogs
  apt-get install e2fsprogs
 +
 +
'''NOTE: Do not upgrade existing packages with Extras-devel enabled as this may break things in new and interesting ways.'''
 +
 +
 +
Remove Extras-devel when finished.
== Install bootmenu ==
== Install bootmenu ==
Now we need to download and install fanoush's [http://fanoush.wz.cz/maemo/#initfs initfs flasher], so, '''as root''', run:<br />
Now we need to download and install fanoush's [http://fanoush.wz.cz/maemo/#initfs initfs flasher], so, '''as root''', run:<br />
-
<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>
+
<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
  cd /home/user/bin
  wget <nowiki>http://fanoush.wz.cz/maemo/initfs_flasher.tgz</nowiki>
  wget <nowiki>http://fanoush.wz.cz/maemo/initfs_flasher.tgz</nowiki>
-
((If you have just did the Diablo upgrade (4.2008.30-2, use this one instead, http://www.internettablettalk.com/fo...tfs#post212301, thread #24, dl the file to /home/user/bin))
 
  tar zxvf initfs_flasher.tgz
  tar zxvf initfs_flasher.tgz
  cd /home/user/bin/initfs_flasher/
  cd /home/user/bin/initfs_flasher/
Line 49: Line 54:
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.
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.
-
The flasher will ask you if you want to include your bootmenu.conf file if you renamed it properly.
+
The [[flasher]] will ask you if you want to include your <code>bootmenu.conf</code> file if you renamed it properly.
=== Flash the initfs ===
=== Flash the initfs ===
-
  cd /home/user/local/bin/initfs_flasher/
+
  cd /home/user/bin/initfs_flasher/
  ./initfs_flash
  ./initfs_flash
Follow the onscreen instructions. You can answer yes to all of these questions if you don't understand what they mean.
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 ==
== Clone to the card ==
-
<small>''Many thanks to [[User:Milhouse|milhouse]] for writing and maintaining this script.''</small>
+
 
 +
<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:
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
* 0 - Create ext2 filesystem on partition 2 of the Internal memory card
* 1 - Mount partition 2 as /opt
* 1 - Mount partition 2 as /opt
Line 70: Line 87:
So, '''as root''', run:
So, '''as root''', run:
-
  cd /home/user/local/bin
+
  cd /home/user/bin
  ./nupgrade.sh 0
  ./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
  ./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
  ./nupgrade.sh 2
  ./nupgrade.sh 3
  ./nupgrade.sh 3
Line 82: Line 109:
== Remove the menu ==
== Remove the menu ==
-
If you decide you do not wish to see the bootmenu any longer, you can uninstall it by either [[upgrading tablet OS|reflashing the whole OS image]], or just flashing the initfs (in Linux and OS X) by running:
+
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:
  sudo ./flasher-3.0 -F <FIASCO image> --flash-only=initfs -R
  sudo ./flasher-3.0 -F <FIASCO image> --flash-only=initfs -R
-
== Advance booting ==
+
== Advanced booting ==
 +
 
For more advanced configuration and setup information for booting-related stuff, please see [[advanced booting]].
For more advanced configuration and setup information for booting-related stuff, please see [[advanced booting]].
 +
 +
[[Category:Power users]]
 +
[[Category:N8x0]]

Latest revision as of 13:40, 10 February 2011

This article covers the steps you need to follow to boot from a flash card with an N800 on N810. The process is somewhat involved, so some familiarity with the command line is recommended.

Advanced users may wish to read advanced booting as well, for more advanced booting-related configuration and setup information.

Contents

[edit] Why would we want to boot from a flash card?

  • For more space to install applications.
  • An easy-to-use bootable backup.
  • To improve performance (note, this is dependent on the quality of your flash card).

[edit] Gain root access

First of all you need to be able to gain root access.

[edit] Partition your card

Follow the instructions to partition your card.

[edit] Install the necessary tools

First, we need to install wget, so open Xterm and, as root, run:

apt-get install wget

Then run:

mkdir -p /home/user/bin
cd /home/user/bin
wget http://www.nmacleod.com/nokia/bin/nupgrade.sh
wget http://www.nmacleod.com/nokia/bin/tar
chmod +x nupgrade.sh tar

Then, to install the proper filesystem tools, temporarily add Extras-devel and run:

apt-get install e2fsprogs

NOTE: Do not upgrade existing packages with Extras-devel enabled as this may break things in new and interesting ways.


Remove Extras-devel when finished.

[edit] Install bootmenu

Now we need to download and install fanoush's initfs flasher, so, as root, run:
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).

cd /home/user/bin
wget http://fanoush.wz.cz/maemo/initfs_flasher.tgz
tar zxvf initfs_flasher.tgz
cd /home/user/bin/initfs_flasher/

[edit] Configuration

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 bootmenu.conf.device.example file to bootmenu.conf 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.

The flasher will ask you if you want to include your bootmenu.conf file if you renamed it properly.

[edit] Flash the initfs

cd /home/user/bin/initfs_flasher/
./initfs_flash

Follow the onscreen instructions. You can answer yes to all of these questions if you don't understand what they mean.

[edit] 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 mmc# (where # is the partition number) for the internal card, and mmc1# for the external card. To set it back the default behavior of booting from the built-in flash, use flash.

On the N810 with latest Diablo version (5.2008.43-7), the device name is slightly different: immc# for the internal card and mmc# 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.

[edit] Clone to the card

Many thanks to milhouse for writing and maintaining this script.

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: [1]

./nupgrade.sh 1

If the following error occurs:
"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"
do the following (similar to the above remedy during error of "./nupgrade.sh 0")
cp /mnt/initfs/lib/modules/$(uname -r)/ext2.ko /lib/modules/$(uname -r)/
and repeat "./nupgrade.sh 1"

./nupgrade.sh 2
./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.

[edit] Remove the menu

If you decide you do not wish to see the bootmenu any longer, you can uninstall it by either reflashing the whole OS image, or just flashing the initfs (in Linux and OS X) by running:

sudo ./flasher-3.0 -F <FIASCO image> --flash-only=initfs -R

[edit] Advanced booting

For more advanced configuration and setup information for booting-related stuff, please see advanced booting.