ReferencePlatforms/Imaging/Nokia N810: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(59 intermediate revisions by 4 users not shown)
Line 1: Line 1:
='''SUPER MEGA IMPORTANT WARNING'''=
==Step 1: Reset Hardware==
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.
'''NOTE: You should be in the RF Shielded room with the door *CLOSED* to ensure machines connect to correct network'''
='''SUPER MEGA 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.
==Creating the images==
write me please
==Cloning an N810==
There are two distinct parts of the N810 cloning process: device prep and card cloning.
===Device Prep===
We currently erase the root filesystem and prepare for SD card booting by running the [[http://hg.mozilla.org/build/tools/file/tip/buildfarm/mobile/production-sd/moz-prep.sh|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====
For each session:
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
*Ensure USB A end of Nokia MicroUSB cable is in computer
./moz-prep.sh
*Remove batteries and backplates from all devices to be imaged
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.
<pre>
====Suggested routine====
cd ~/n810-imaging
*Remove all batteries and reinsert them
sudo ./moz-prep.sh  
*Remove all SD cards
#Follow onscreen prompts
*for n810 in dead_pile:
#once all devices are prepped press CTRL+C to quit moz-prep.sh
**start moz-prep.sh
</pre>
**plug in USB
**plug in Charger
**wait for "The device root device is now 'mmc'"
**unplug USB
**unplug power


===SD Clone===
==Step 2: Image multiple cards==
To get the filesystem onto the SD card we use [[http://hg.mozilla.org/build/tools/file/tip/buildfarm/mobile/production-sd/moz-image.sh|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 [[http://hg.mozilla.org/build/tools/file/tip/buildfarm/mobile/production-sd/bulk-image.sh|bulk-image.sh]].
<pre>
====moz-image.sh====
#Detach all MicroSD card readers from computer
This script uses the syntax:
#Insert MicroSD cards to be imaged into MicroSD card readers
Usage: moz-image.sh <rootfsdir> <sd card dev> <unit name>
#Plug in MicroSD card readers with MicroSD cards into computer
*<rootfsdir> specifies the directory that contains the whole filesystem.
#then run
**Example listing of a valid directory:
cd ~/n810-imaging
$ ls moz-ref-sd-v4/
sudo ./bulk-image.sh
bin    cdrom  floppy  initrd      media  proc  srv  tools
#This will take approx 5-7 minutes per card; computer will beep when all cards are imaged.
boot    dev    home    lib        mnt    root  sys  usr
# JHFORD will paste sample output here
builds  etc    INFO    lost+found  opt    sbin  tmp  var
#Remove all MicroSD card readers
*<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.
#Remove MicroSD cards from MicroSD card readers
*<unit name> is the name of the device.  This will be echoed into <rootfsdir>/etc/hostname which is picked up by buildbot.tac
#Final output will tell you how many cards were successful,
#this for your information and is not critical to the imaging process
</pre>


=====Example=====
==Step 3: Verify card and power on device==
cd /flashing/production-sd
<pre>
./moz-image moz-ref-sd-v4 /dev/sdb maemo-n810-ref
#Run and follow on screen instructions
====bulk-image.sh====
cd ~/n810-imaging
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.
sudo ./bulk-verify.sh
=====Example=====
</pre>
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 dd, mke2fs, rsync output>


==Step 4: Boot device==
*This step assumes that the MicroSD card has been inserted into the correct device
*Press the power button on the top of the device '''then''' plug the charger into the device (NOTE: order is important).
*Verify the device comes turns on successfully with the blue geometry-themed desktop.
*Verify that the grey Wifi logo in top right of screen turns to solid white
** may take 5 minutes


==Random Notes==
==Troubleshooting Tips==
*The start up has these phases:
IGNORE BELOW HERE UNLESS YOU ARE *REALLY* CURIOUS
**Nokia screen (Big blue lettering)
 
***Happens even if there is a corrupt FS
===N810 Imaging===
***Beginning of Firmware Update Mode
We use N810s to do on-device testing of our maemo4 builds of our mobile browser.  In order to deal with maintaining 80 of these devices we have developed an imaging solution.  Our initial attempt was to create a custom firmware image but file corruption became an issue.  We eventually figured out how to boot these devices from MiniSD cards.  We have special tools for creating and maintaining the filesystems on these cards.
**Nokia loading screen
 
***This screen has a blue progress bar
===Resetting hardware===
***Sign that the SD/RootFS are booting
The purpose of this step is to zero out the root mtd device as well as reflashing the linux kernel and bootloader.  We want to make sure that any possible corruption in these critical subsystems is repaired
**Handshake screen
 
***OS Load
===Potential issues===
**Maemo Desktop
If you see
ERROR! Lost USB Connection while flashing RX-44_DIABLO_5.2008.43-7_PR_COMBINED_MR0_ARM.bin.  Dead battery?
this is a sign that moz-prep encountered an error.  This is a sign that for some reason, the nokia flashing program lost connection to the device.  This is often caused by trying to flash with a dead battery.  We mitigate this by flashing with the charger connected.  This has also been caused by issues with the linux kernel on the imaging host.  If you encounter this error on multiple devices using different batteries reboot the imaging machine.  If you still have issues, someone has broken the imaging machine.

Latest revision as of 21:39, 20 May 2010

Step 1: Reset Hardware

NOTE: You should be in the RF Shielded room with the door *CLOSED* to ensure machines connect to correct network

For each session:

  • Ensure USB A end of Nokia MicroUSB cable is in computer
  • Remove batteries and backplates from all devices to be imaged
cd ~/n810-imaging
sudo ./moz-prep.sh 
#Follow onscreen prompts
#once all devices are prepped press CTRL+C to quit moz-prep.sh

Step 2: Image multiple cards

#Detach all MicroSD card readers from computer 
#Insert MicroSD cards to be imaged into MicroSD card readers
#Plug in MicroSD card readers with MicroSD cards into computer
#then run
cd ~/n810-imaging
sudo ./bulk-image.sh
#This will take approx 5-7 minutes per card; computer will beep when all cards are imaged.
# JHFORD will paste sample output here
#Remove all MicroSD card readers
#Remove MicroSD cards from MicroSD card readers
#Final output will tell you how many cards were successful, 
#this for your information and is not critical to the imaging process

Step 3: Verify card and power on device

#Run and follow on screen instructions
cd ~/n810-imaging
sudo ./bulk-verify.sh

Step 4: Boot device

  • This step assumes that the MicroSD card has been inserted into the correct device
  • Press the power button on the top of the device then plug the charger into the device (NOTE: order is important).
  • Verify the device comes turns on successfully with the blue geometry-themed desktop.
  • Verify that the grey Wifi logo in top right of screen turns to solid white
    • may take 5 minutes

Troubleshooting Tips

IGNORE BELOW HERE UNLESS YOU ARE *REALLY* CURIOUS

N810 Imaging

We use N810s to do on-device testing of our maemo4 builds of our mobile browser. In order to deal with maintaining 80 of these devices we have developed an imaging solution. Our initial attempt was to create a custom firmware image but file corruption became an issue. We eventually figured out how to boot these devices from MiniSD cards. We have special tools for creating and maintaining the filesystems on these cards.

Resetting hardware

The purpose of this step is to zero out the root mtd device as well as reflashing the linux kernel and bootloader. We want to make sure that any possible corruption in these critical subsystems is repaired

Potential issues

If you see

ERROR! Lost USB Connection while flashing RX-44_DIABLO_5.2008.43-7_PR_COMBINED_MR0_ARM.bin.  Dead battery?

this is a sign that moz-prep encountered an error. This is a sign that for some reason, the nokia flashing program lost connection to the device. This is often caused by trying to flash with a dead battery. We mitigate this by flashing with the charger connected. This has also been caused by issues with the linux kernel on the imaging host. If you encounter this error on multiple devices using different batteries reboot the imaging machine. If you still have issues, someone has broken the imaging machine.