Updating uBoot for Pogoplug V2

I’ve decided the unlock the capabilities of my pogoplug, and explore other firmware options like Arch Linux ARM. So I had to update the version of uBoot (universal boot loader) installed on pogoplug to be able to boot from external USB drive. My pogoplug is v2, based on Marvel Krikwood SoC, which is the same architecutre used in Seagate GoFlex Net/Home, and Seagate Dockstar.

Updating uBoot is a bit risky action, because if anything went wrong during the update (e.g. power outage), the device could be rendered unusable. And in such case, it will need an advanced lengthy process to recover it – if possible!

Anyway, I took the decision to proceed with the update, which went very smooth using the installation script on Jef Doozan web site.

First, I logged to the pogoplug using ssh, downloaded the installation script from Jeff web site, and changed permissions to make it executable.

-bash-3.2# cd /tmp
-bash-3.2#
-bash-3.2#
-bash-3.2# wget http://jeff.doozan.com/debian/uboot/install_uboot_mtd0.sh
Connecting to jeff.doozan.com (69.163.187.226:80)
install_uboot_mtd0.s 100% |***********************************************************************| 17281 --:--:-- ETA
-bash-3.2# chmod +x ./install_uboot_mtd0.sh

Then I ran the script.
(I “tee” the output to a log file to keep it for reference)

-bash-3.2#
-bash-3.2# ./install_uboot_mtd0.sh | tee install_uboot_mtd0.120402.log

It warns us of course! I typed OK to proceed.

!!!!!!  DANGER DANGER DANGER DANGER DANGER DANGER  !!!!!!

If you lose power to your device while running this script,
it could be left in an unusable state.

This script will replace the bootloader on /dev/mtd0.

This installer will only work on the following devices:
 Seagate GoFlex Net
 Seagate Dockstar
 Pogoplug v1
 Pogoplug Pink
Do not run this installer on any other device.

By typing ok, you agree to assume all liabilities and risks
associated with running this installer.

If you agree, type 'ok' and press ENTER to continue: ok

The script starts by downloading and installing some utilities to be used during installation, as well as to manage uBoot environment later on.

# checking for /usr/sbin/nandwrite...

# Installing /usr/sbin/nandwrite...
Connecting to jeff.doozan.com (69.163.187.226:80)
nandwrite.md5        100% |***********************************************************************|    44  --:--:-- ETA
Connecting to jeff.doozan.com (69.163.187.226:80)
nandwrite            100% |***********************************************************************| 11500  --:--:-- ETA
# Successfully installed /usr/sbin/nandwrite.
# checking for /usr/sbin/nanddump...

# Installing /usr/sbin/nanddump...
Connecting to jeff.doozan.com (69.163.187.226:80)
nanddump.md5         100% |***********************************************************************|    43  --:--:-- ETA
Connecting to jeff.doozan.com (69.163.187.226:80)
nanddump             100% |***********************************************************************| 21286  00:00:00 ETA
# Successfully installed /usr/sbin/nanddump.
# checking for /usr/sbin/flash_erase...

# Installing /usr/sbin/flash_erase...
Connecting to jeff.doozan.com (69.163.187.226:80)
flash_erase.md5      100% |***********************************************************************|    46  --:--:-- ETA
Connecting to jeff.doozan.com (69.163.187.226:80)
flash_erase          100% |***********************************************************************| 12819  00:00:00 ETA
# Successfully installed /usr/sbin/flash_erase.
# checking for /usr/sbin/fw_printenv...

# Installing /usr/sbin/fw_printenv...
Connecting to jeff.doozan.com (69.163.187.226:80)
fw_printenv.md5      100% |***********************************************************************|    46  --:--:-- ETA
Connecting to jeff.doozan.com (69.163.187.226:80)
fw_printenv          100% |***********************************************************************|   652k 00:00:00 ETA
# Successfully installed /usr/sbin/fw_printenv.
# checking for /etc/fw_env.config...

# Installing /etc/fw_env.config...
Connecting to jeff.doozan.com (69.163.187.226:80)
fw_env.config.md5    100% |***********************************************************************|    48  --:--:-- ETA
Connecting to jeff.doozan.com (69.163.187.226:80)
fw_env.config        100% |***********************************************************************|   329  --:--:-- ETA
# Successfully installed /etc/fw_env.config.

Then it validates the current installed uBoot, to make sure it’s one of the supported versions. I wouldn’t proceed if it was not supported!

# Validating existing uBoot...
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x00000000 and ending at 0x00080000...
Connecting to jeff.doozan.com (69.163.187.226:80)
valid-uboot.md5      100% |***********************************************************************|   756  --:--:-- ETA
## Valid uBoot detected: [pinkpogo original]

The script then asks if the Pogoplug Services should be disabled.
It recommends to disable it.
But I preferred to keep it. So that when I boot to original firmware, I can just use my.pogoplug.com service as normal.

DISABLE POGOPLUG SERVICES

The pogoplug service includes an auto-update feature which could
be used to cripple or disable your device.  It is recommended
that you disable this service.

NOTE: The pogoplug service is proprietary software
created by Cloud Engines.  It is not available for use
in other distributions and will not be available in
your new linux installation even if you choose not to disable it.

Would you like to disable the pogoplug services? [Y/n] n

It then installs a copy of the original uBoot as a file stored on the root filesystem. The new installed uBoot will load this original copy on booting if it doesn’t detect any bootable USB drives, which in turns boots the original firmware.

# checking for /uboot-original-mtd0.kwb...

# Installing /uboot-original-mtd0.kwb...
Connecting to jeff.doozan.com (69.163.187.226:80)
uboot-original-mtd0. 100% |***********************************************************************|    67  --:--:-- ETA
Connecting to jeff.doozan.com (69.163.187.226:80)
uboot-original-mtd0. 100% |***********************************************************************|   512k 00:00:00 ETA
# Successfully installed /uboot-original-mtd0.kwb.

Next it installs another utility to set the new uBoot environment variables.

# checking for /usr/sbin/blparam...

# Installing /usr/sbin/blparam...
Connecting to jeff.doozan.com (69.163.187.226:80)
blparam.md5          100% |***********************************************************************|    42  --:--:-- ETA
Connecting to jeff.doozan.com (69.163.187.226:80)
blparam              100% |***********************************************************************| 14168  00:00:00 ETA
# Successfully installed /usr/sbin/blparam.

Then, it install and verify the new uBoot

# Installing uBoot
## Installing pinkpogo jeff-2010-10-23
Connecting to jeff.doozan.com (69.163.187.226:80)
uboot.mtd0.kwb.md5   100% |***********************************************************************|    74  --:--:-- ETA
Connecting to jeff.doozan.com (69.163.187.226:80)
uboot.mtd0.kwb       100% |***********************************************************************|   512k 00:00:00 ETA
Erase Total 4 Units
Performing Flash Erase of length 131072 at offset 0x60000 done
Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x20000
Writing data to block 2 at offset 0x40000
Writing data to block 3 at offset 0x60000
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x00000000 and ending at 0x00080000...
## Verifying new uBoot...
Connecting to jeff.doozan.com (69.163.187.226:80)
uboot.mtd0.kwb.md5   100% |***********************************************************************|    74  --:--:-- ETA
# Verified successfully!

Finally, it installs and verifies the new uBoot environment.

# Installing uBoot environment
Connecting to jeff.doozan.com (69.163.187.226:80)
uboot.environment.md 100% |***********************************************************************|    52  --:--:-- ETA
Connecting to jeff.doozan.com (69.163.187.226:80)
uboot.environment    100% |***********************************************************************|   128k 00:00:00 ETA
Erase Total 1 Units
Performing Flash Erase of length 131072 at offset 0xc0000 done
Writing data to block 6 at offset 0xc0000

# Verifying uBoot environment
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x000c0000 and ending at 0x000e0000...
Connecting to jeff.doozan.com (69.163.187.226:80)
uboot.environment.md 100% |***********************************************************************|    52  --:--:-- ETA

# Setting arcNumber to 2097 (SheevaPlug)
# Note: if you have a kernel that supports your platform, you should use the proper arcNumber.
# You can set the correct arcNumber by running the following command:
/usr/sbin/fw_setenv arcNumber 2998

# uBoot installation has completed successfully.

Before rebooting, I copied all the files in /tmp for my reference later, which contain the dump of the original uBoot that was installed (uboot-mtd0-dump)

Finally I have updated uBoot.
Now I have the option to boot another firmware on my pogoplug, and yet able to boot the original firmware if needed.

3 thoughts on “Updating uBoot for Pogoplug V2

  1. I did this about a year ago with this same process on a pink Pogoplug, however, when the Arch rootfs drive is not connected, the unit doesn’t boot. I’ve searched all over the net and haven’t found a way to reverse the above process. Do you know how to reverse this? I would like to return to the original firmware so that I can install Debian. I haven’t been able to find a tutorial explaining how to switch from Arch to Debian…they all require starting with the original firmware.

    Any info you have would be greatly appreciated! Thanks!

    • apologies for my late response. Updating uboot using Jeff script disables Pogoplug Services by default (see above the prompt: “Would you like to disable the pogoplug services? [Y/n]“). It does so by commenting out the line that has “/etc/init.d/hbmgr.sh start” in /etc/init.d/rcS startup script.

      So we need a way to mount the internal flash containing pogoplug firmware, and then uncomment out that line. Fortunately, we can do that from within Arch Linux ARM using something like below …

      # mkdir /tmp/pogo
      # mount -o noatime -t jffs2 /dev/mtdblock2 /tmp/pogo/
      # cd /tmp/pogo/etc/init.d/
      # vi rcS
      (delete the “#” in front of line containing: /etc/init.d/hbmgr.sh start, and save the file)
      # cd /tmp
      # umount /tmp/pogo

      we can then power off pogoplug, remove arch linux flash, and power it back on. It should boot into pogoplug original firmware, and we should see this pogoplug on my.pogoplug.com

      Please let me know if this really help.

      here is a good reference for such technique:
      http://archlinuxarm.org/forum/viewtopic.php?f=18&t=3490&start=10

  2. Pingback: Configuring Netconsole on Pogoplug V2 | Moustafa Hassan

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Current day month ye@r *