Difference between revisions of "Last Resort Emergency BootLoader Recovery"

From WebOS Internals
Jump to navigation Jump to search
(added recovery techniques using installer boot image)
Line 4: Line 4:
  
 
If bootie on the flash disk has been damaged or corrupted in such a way that booting into recovery mode is not possible, the Pre is still not "bricked" as the OMAP3430 processor in the Pre provides for a mechanism to boot code from its USB interface.
 
If bootie on the flash disk has been damaged or corrupted in such a way that booting into recovery mode is not possible, the Pre is still not "bricked" as the OMAP3430 processor in the Pre provides for a mechanism to boot code from its USB interface.
 +
 +
If the NVRAM partition gets trashed too, the token area will be empty and the doctor will refuse to install. If you're in this situation you need to rebuild it. The minimal token set to allow the doctor to start on a GSM Pre is DMCARRIER=ROW, DMMODEL=castle, HWoRev=A, PN=180-10722-03 and PRODoID=P100UEU. You may also want to set BToADDR=00:1D:FE:''xx:yy:zz'', WIFIoADDR=00:1D:FE:''uu:vv:ww'' and PalmSN=''serial''. The addresses can safely be any random number, the serial number is on the box and on a sticker inside the battery compartment.
  
 
First, ensure that the Linux SDK and novacom packages are installed, as you will need to run webOS Doctor as the final step in this process.
 
First, ensure that the Linux SDK and novacom packages are installed, as you will need to run webOS Doctor as the final step in this process.

Revision as of 10:44, 31 January 2010

Typically, any damage to the operating system on the Palm Pre can be recovered by booting into recovery mode.

One situation which cannot be recovered so easily is the extremely unlikely event of corruption of the installed bootloader (bootie) stored on the Pre's flash disk.

If bootie on the flash disk has been damaged or corrupted in such a way that booting into recovery mode is not possible, the Pre is still not "bricked" as the OMAP3430 processor in the Pre provides for a mechanism to boot code from its USB interface.

If the NVRAM partition gets trashed too, the token area will be empty and the doctor will refuse to install. If you're in this situation you need to rebuild it. The minimal token set to allow the doctor to start on a GSM Pre is DMCARRIER=ROW, DMMODEL=castle, HWoRev=A, PN=180-10722-03 and PRODoID=P100UEU. You may also want to set BToADDR=00:1D:FE:xx:yy:zz, WIFIoADDR=00:1D:FE:uu:vv:ww and PalmSN=serial. The addresses can safely be any random number, the serial number is on the box and on a sticker inside the battery compartment.

First, ensure that the Linux SDK and novacom packages are installed, as you will need to run webOS Doctor as the final step in this process. Second, ensure that you have a copy of the webOS doctor jar ready.

Download: omap3_usb.tar.bz2

Compile on Linux system with "make". Optionally install with "sudo cp omap3_usbload /usr/local/bin"

Now extract the bootie binary from a WebOS Doctor image:

mkdir doctor; cd doctor; unzip ../webosdoctorp100eww-wro2-1.1.3.jar; cd resources
mkdir webOS; cd webOS; tar xvf ../webOS.tar; mkdir nova-cust-image-castle.rootfs; cd nova-cust-image-castle.rootfs
tar xvzf ../nova-cust-image-castle.rootfs.tar.gz ./boot/boot.bin; cd boot

Booting bootie over USB:

Ensure USB is unplugged from the Pre, and remove the Pre's battery.

On your Linux system, run:

sudo omap3_usbload boot.bin

This should return:

TI OMAP3 USB boot ROM tool, version 0.1
......

and a series of dots while it looks for an OMAP3 to send boot code to.

Now, plug the pre into USB.

If all works as it should, the usbload program should return:

found device!
download ok

And your Pre will now show a USB logo. (this is bootie's "Recovery mode")

Put the battery back in without unplugging the USB.

Since you are now in USB recovery mode, you should be able to run the webOS doctor on the host Linux box. Remember that the SDK novacom package must be installed for the webOS Doctor to work in Linux.

One way to do this is to launch the doctor from the command line like:

sudo java -jar webosdoctorp100eww-wro2-1.1.3.jar

And follow the usual steps to recover your pre's operating system from here.

Alternatively..


Another available option now that bootie is running is to send bootie a Linux image over USB and perform some kind of recovery work directly on the pre itself. This is not recommended unless you are very familiar with linux systems administration.

First you send bootie the boot image of the doctor's installer. This can be extracted from the WebOS Doctor jar.

novacom boot mem:// < nova-installer-image-castle.uImage

Wait 15 seconds for the system to boot then connect in to a shell on the running linux system with novaterm. (you will see no on-screen indication that the device is booting linux, only a solid Palm logo)

novaterm

You should get a shell prompt

root@palm-webos-device:/# 

Now find and activate the LVM disk voumes with the following two commands:

lvm.static vgscan --ignorelockingfailure
lvm.static vgchange -ay --ignorelockingfailure

Next, mount all disks

for N in root var media log update; do mkdir /mnt/$N; mount /dev/mapper/store-$N /mnt/$N; done

When done with whatever you need to do on the system, shutting it down safely is a good idea

umount -a; tellbootie reboot


For a Mac, the process of running USB booting the OMAP may be much simpler.

The MacOS X version of the SDK provides a pre-built executable /opt/nova/bin/cpuboot and a recovery image. You can simply run

/opt/nova/bin/cpuboot  -o -v -d usb -f /opt/nova/bin/recovery-castle.bin