ReferencePlatforms/Imaging/Nokia N810: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
 
(62 intermediate revisions by 4 users not shown)
Line 1: Line 1:
==Requirements==
==Step 1: Reset Hardware==
You will need the following things:
'''NOTE: You should be in the RF Shielded room with the door *CLOSED* to ensure machines connect to correct network'''
*Nokia N810
*Nokia USB Cable
*Nokia Charger
*PC running Linux
**Nokia's Scratchbox to compile mkfs.jffs2
**Nokia's flasher-3.0 program
**Nokia Official firmware image


==Creating image==
For each session:
This process is designed to generate a JFFS2 file system image which flasher-3.0 can use to write a root filesystem for the n810 unit.  The Nokia firmware image (.bin) uses an archiving format called FIASCO.  Luckily, we are able to use flasher-3.0 to unpack this image (<code>sudo ./flasher-3.0 -u -F RX44-*.bin</code>).  To create an image, we need to copy the root filesystem of the configured device to the PC then generate a JFFS2 filesystem image.
*Ensure USB A end of Nokia MicroUSB cable is in computer
 
*Remove batteries and backplates from all devices to be imaged
===Set up device===
The first step is to set up the device exactly the way you wish the imaged devices set up.  It seems that everything down to which wifi connection is selected gets stored in the image. 
 
===Clone filesystem===
To clone the filesystem, you need to remount the filesystem then rsync the contents to the PC.  I did this by running '''ON N810'''
<pre>
<pre>
mkdir /media/mmc2/rootfs
cd ~/n810-imaging
sudo mount -t jffs2 /dev/mtdblock4 /media/mmc2/rootfs
sudo ./moz-prep.sh
#Follow onscreen prompts
#once all devices are prepped press CTRL+C to quit moz-prep.sh
</pre>
</pre>
'''ON PC'''
 
==Step 2: Image multiple cards==
<pre>
<pre>
mkdir rootfs-configured
#Detach all MicroSD card readers from computer
sudo rsync -a root@${N810-IP}:/media/mmc2/rootfs/. rootfs-configured
#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
</pre>
</pre>
===Modify files===
 
At this stage, any nessecary modifications to the filesystem can be made.  This includes /etc/hostname, /media/mmc1/buildbot/buildbot.tac and /media/mmc1/buildbot/info/host
==Step 3: Verify card and power on device==
===Generate image===
You will need your distributions 'mtd-utils' package which will include mkfs.jffs2 (<code>sudo apt-get install mtd-utils</code>). 
Create an image:
<pre>
<pre>
sudo mkfs.jffs2 -r rootfs-configured -o rootfs-moz-v1.jffs2 -e 128 -l -n
#Run and follow on screen instructions
cd ~/n810-imaging
sudo ./bulk-verify.sh
</pre>
</pre>


==Flashing manually==
==Step 4: Boot device==
A manual flash is done with the generated root filesystem imageIt is a good idea to flash the complete and official firmware before our custome image as it ensures that we have a working kernel, bootloader, init filesystem and other critical images.
*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 solutionOur 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.


<pre>
===Resetting hardware===
echo "Turn device completely off, remove battery if needed"
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
echo "Plug in USB cable"
sudo ./flasher-3.0 --fiasco RX-44*.bin --flash
sudo ./flasher-3.0 --rootfs rootfs-moz-v1.jffs2 --flash
echo "Plug in Power Cable"
echo "Unplug USB Cable"
echo "Turn on device"
</pre>


==Flashing automatically==
===Potential issues===
This is a WIP.
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.