ReferencePlatforms/Imaging/Nokia N810 Background

From MozillaWiki
Jump to: navigation, search

Creating the images

write me please

Cloning an N810

There are two distinct parts of the N810 cloning process: device prep and card cloning.


IMPORTANT WARNING

For some reason if you use rsync >= 3 this whole thing goes haywire. I have a custom compile of rsync 2 that is used for all imaging tasks. If in doubt, run 'rsync --version' or './moz-rsync --version' to ensure you are on RSYNC 2. Any image processed by rsync is garbage and should be deleted immediately so as not to contaminate our collection of images.

IMPORTANT WARNING 2

Since all commands must be run as root, you can destroy not only the images that we have, but also the entire filesystem of the computer. Please be extremely careful to not do this.

Nokia Imaging

We run lots of Nokia N810s in support of Fennec development. In order to efficiently manage these devices and improve their reliability we have developed a process to clone and boot from an SD card.

Device Prep

We currently erase the root filesystem and prepare for SD card booting by running the moz-prep.sh. For this step you need the following things:

  • Nokia N810
  • Nokia N810 Charger
  • Nokia N810 MicroUSB Cable
  • PC running linux
  • Empty JFFS2 filesystem
  • moz-prep.sh
  • flasher-3.0
  • official Nokia firmware FIASCO image (RX-44_DIABLO_5.2008.43-7_PR_COMBINED_MR0_ARM.bin)

Detailed Instructions

To run the moz-prep.sh script successfully, you will need to make sure your device is off. I do this by removing the battery because there are a number of not-off states that look like off states with the N810. Once you have verified that the device is off, plug in the USB cable and put the battery in the device. Start the script

su -
cd /flashing-hg/production-sd
./moz-prep.sh

You will see versioning information about the FIASCO image's sub-images which can safely be ignored. When you see the last line of output "Suitable USB device not found, waiting" you will plug the charger into the device. This will turn the device on and will cause a USB icon to show up in the top right of the Nokia screen. This means you have entered firmware update mode. In firmware update mode, you will see a green (maybe brown) progress bar. Because we are flashing an empty filesystem, it will be instantaneous. On the PC you will see "The device root device is now 'mmc'" which is an indication that the script is finished Unplug the device from USB and power. It will turn off. Remove the SD card for imaging.

SD Clone

To get the filesystem onto the SD card we use moz-image.sh. This script only knows how to do a single SD card at a time. As a result, we have another simple script to drive moz-image.sh called bulk-image.sh.

You will need the following things:

  • Linux PC
  • N MicroSD Cards
  • N USB ports (we have hubs)
  • N MicroSD Card Readers
  • Root filesystem directory
  • rsync2 (moz-rsync on our imaging pc is this)

moz-image.sh

This script uses the syntax:

Usage: moz-image.sh <rootfsdir> <sd card dev> <unit name>
  • <rootfsdir> specifies the directory that contains the whole filesystem.
    • Example listing of a valid directory:
$ su -
$ cd /flashing-hg/production-sd
$ ls moz-ref-sd-v4/ 
bin     cdrom  floppy  initrd      media  proc  srv  tools
boot    dev    home    lib         mnt    root  sys  usr
builds  etc    INFO    lost+found  opt    sbin  tmp  var
  • <sd card dev> is a device file node (/dev/sdb) that represents the SD card to image. When there are partitions, you will see /dev/sdb1, /dev/sdb2, etc. Sometimes there are device files which do not map to an SD card or reader. If this is the case, reboot the computer.
  • <unit name> is the name of the device. This will be echoed into <rootfsdir>/etc/hostname which is picked up by buildbot.tac
Example
su -
cd /flashing-hg/production-sd
./moz-image moz-ref-sd-v4 /dev/sdb maemo-n810-ref

bulk-image.sh

This script uses moz-image.sh to do bulk updates of many SD cards. It sets the same hostname of 'maemo-n810-ref' to all cards as there is no known way to map a device file to a physical sd card reader. If run without parameters, you will be presented with a list of valid choices. Beware, you could erase the entire hard drive. Make sure you do not select the computer's hard drive as a target. I have special cased /dev/sda to not be useable, but there is no guarantee that the hard drive of the computer is /dev/sda. While the imaging is happening, the bash prompt will be blocked on the moz-image.sh scripts. When each script is finished it will print out "All done on /dev/sdb" and when the whole process is complete, bulk-image.sh will print out "BULK IMAGING COMPLETED". Because this script is a hack, you set the rootfsdir parameter by editing the script.

Example
$ su -
$ cd /flashing/production-sd
$ ./bulk-image.sh 
Please specify devices from this list
/dev/sdg1
/dev/sdc1
/dev/sdb1
$ ./bulk-image.sh b c g
<tons of interleaved dd, mke2fs, rsync, info output>
INFO: Copying data to card
INFO: Copying data to card
INFO: Copying data to card
INFO: Modifying Image
INFO: Unmounting
INFO: Modifying Image
INFO: Unmounting
INFO: Modifying Image
INFO: Unmounting
All done on /dev/sdb
All done on /dev/sdc
All done on /dev/sdg
BULK IMAGING COMPLETED

Random Notes

  • The start up has these phases:
    • Nokia screen (Big blue lettering)
      • Happens even if there is a corrupt FS
      • Beginning of Firmware Update Mode
    • Nokia loading screen
      • This screen has a blue progress bar
      • Sign that the SD/RootFS are booting
    • Handshake screen
      • OS Load
    • Maemo Desktop