Booting from a flash card

(Removing the menu)
(Install bootmenu: Broken it into subsections, added a configuration section and reworked a bit)
Line 17: Line 17:
Connect your device to the charger, as running out of battery power during the flashing process could damage the device.
Connect your device to the charger, as running out of battery power during the flashing process could damage the device.
 +
 +
=== Preparation ===
First, we need to install wget, so open Xterm and, '''as root''', run:
First, we need to install wget, so open Xterm and, '''as root''', run:
Line 35: Line 37:
  wget <nowiki>http://fanoush.wz.cz/maemo/initfs_flasher.tgz</nowiki>
  wget <nowiki>http://fanoush.wz.cz/maemo/initfs_flasher.tgz</nowiki>
  tar zxvf initfs_flasher.tgz
  tar zxvf initfs_flasher.tgz
-
  cd initfs_flasher/
+
  cd /home/user/local/bin/initfs_flasher/
 +
 
 +
=== Confirguration ===
 +
 
 +
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.
 +
 
 +
=== Flash the initfs ===
 +
 
 +
cd /home/user/local/bin/initfs_flasher/
  ./initfs_flash
  ./initfs_flash

Revision as of 10:50, 5 July 2008

Image:Ambox_content.png
This is an article from the old midgard wiki that hasn't yet been fully updated for this wiki, please update it.
Please see the talk page for discussion.


Contents

Why would we want to boot from a flash card?

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

Gain root access

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

Partition your card

Follow the instructions to partition your card.

Install bootmenu

Connect your device to the charger, as running out of battery power during the flashing process could damage the device.

Preparation

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

apt-get install wget

Then run:

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

Now we need to download and install fanoush's initfs flasher, so, as root, run:

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

Confirguration

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.

Flash the initfs

cd /home/user/local/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.

Now we need to load the kernel modules for ext2, so, as root, run:

insmod /mnt/initfs/lib/modules/$(uname -r)/mbcache.ko
insmod /mnt/initfs/lib/modules/$(uname -r)/ext2.ko

Clone to the card

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/local/bin
./nupgrade.sh 0
./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.

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