Difference between revisions of "Last Resort Emergency BootLoader Recovery"

From WebOS Internals
Jump to navigation Jump to search
m
(added recovery techniques using installer boot image)
Line 13: Line 13:
  
 
Now extract the bootie binary from a WebOS Doctor image:
 
Now extract the bootie binary from a WebOS Doctor image:
 
+
<pre>
+
mkdir doctor; cd doctor; unzip ../webosdoctorp100eww-wro2-1.1.3.jar; cd resources
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
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
tar xvzf ../nova-cust-image-castle.rootfs.tar.gz ./boot/boot.bin; cd boot
 
</pre>
 
  
 
Booting bootie over USB:
 
Booting bootie over USB:
Line 26: Line 24:
 
On your Linux system, run:
 
On your Linux system, run:
  
<pre>sudo omap3_usbload boot.bin</pre>
+
sudo omap3_usbload boot.bin
  
 
This should return:
 
This should return:
  
<pre>
+
TI OMAP3 USB boot ROM tool, version 0.1
TI OMAP3 USB boot ROM tool, version 0.1
+
......
......
 
</pre>
 
  
 
and a series of dots while it looks for an OMAP3 to send boot code to.
 
and a series of dots while it looks for an OMAP3 to send boot code to.
Line 41: Line 37:
 
If all works as it should, the usbload program should return:
 
If all works as it should, the usbload program should return:
  
<pre>
+
found device!
found device!
+
download ok
download ok
 
</pre>
 
  
 
And your Pre will now show a USB logo. (this is bootie's "Recovery mode")
 
And your Pre will now show a USB logo. (this is bootie's "Recovery mode")
Line 54: Line 48:
 
One way to do this is to launch the doctor from the command line like:   
 
One way to do this is to launch the doctor from the command line like:   
  
<pre>sudo java -jar webosdoctorp100eww-wro2-1.1.3.jar</pre>
+
sudo java -jar webosdoctorp100eww-wro2-1.1.3.jar
  
 
And follow the usual steps to recover your pre's operating system from here.
 
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
 
The MacOS X version of the SDK provides a pre-built executable /opt/nova/bin/cpuboot and a recovery image. You can simply run
  
<pre>
+
/opt/nova/bin/cpuboot  -o -v -d usb -f /opt/nova/bin/recovery-castle.bin
/opt/nova/bin/cpuboot  -o -v -d usb -f /opt/nova/bin/recovery-castle.bin  
 
</pre>
 

Revision as of 23:28, 30 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.

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