PlugApps:Pogoplug Setboot
From PlugApps
Contents |
Important Notes
My.Pogoplug.com is not available in Plugbox Linux. The Pogoplug service requires proprietary drivers which are not included in Plugbox Linux.
Your device will always try to boot from USB. If a bootable USB device is not found, it will boot into the old Pogoplug installation.
The led will blink green while uBoot is running. With the earlier uBoot replacements (pre 8/30/2010), the LED was off when uBoot was running. Before passing control to the Linux kernel, uBoot will turn off the LED. If you have a kernel that supports the status LED, the kernel may set the LED when it starts.
If the USB drive is removed while running, or if your system crashes, your device may hang the next time it boots. If it does hang, unplug the drive and reboot into the default Pogoplug firmware. Then re-connect the drive and check it by running /sbin/fsck /dev/sda1 to fix any errors. Then reboot again and it should boot into your that will make sure that on the next reboot your USB drive is ready to load Plugbox Linux.
Introduction
This guide will replace the old Pogoplug bootloader on mtd0 with a new bootloader. The old Pogoplug bootloader is required for booting into the old Pogoplug installation, so a copy of it will be saved to the Pogoplug root on mtd2. The new bootloader will look for a USB drive with a kernel and filesystem on it. If a usable USB drive is found, the bootloader will boot from it. If no drive is found, the bootloader will load the old Pogoplug bootloader and run that, which will boot into the old Pogoplug environment.
Supported Hardware
- Pogoplug v1 "Brick"
- Pogoplug v2 "Pink"
- Seagate DockStar
- 512MB or larger USB drive for installation
Connecting via SSH
You must enable SSH access in my.pogoplug.com before SSH will be accessible (unless you never registered your device).
The password below will not work if you activate SSH with a different password. If you activate SSH with a password of your choice, use that password to login instead.
Find your Pogoplug's IP address and SSH in using:
username: root password: ceadmin password (DockStar): stxadmin
Immediately after connecting, stop the Pogoplug service by running the following command:
killall hbwd
You only need to kill the Pogoplug service the first time you connect.
After you run the installers, it will be automatically disabled.
Backup, backup and backup
This is the essence of computing, to store or backup your data. In this case, you want to backup your Dockstar's NAND. Just in case something one day goes wrong. Jeff Doozan's site has a nifty little tool that allows us to backup our NAND.
Connect a USB drive and run the following commands
cd /tmp mkdir usb mount /dev/sda1 /tmp/usb wget http://plugapps.com/os/pogoplug/uboot/nanddump chmod +x nanddump ./nanddump -nf usb/mtd0 /dev/mtd0 ./nanddump -nf usb/mtd1 /dev/mtd1 ./nanddump -nf usb/mtd2 /dev/mtd2 umount /dev/sda1
Take your USB disk and store those NAND dumps in a safe place.
Install the new uBoot on mtd0
Use the following commands to install the new bootloader:
cd /tmp wget http://plugapps.com/os/pogoplug/uboot/install_uboot_mtd0.sh chmod +x install_uboot_mtd0.sh ./install_uboot_mtd0.sh
Read the warning carefully. Type ok at the prompt and press Enter to continue.
The installer will ask if you would like to disable the Pogoplug environment. The default answer is Yes, so press Enter to accept it and continue.
Install Plugbox
After the new bootloader is installed, you will need to use fdisk to partition a storage device, plug in a 512MB or bigger USB drive. REMOVE ALL OTHER DRIVES. Move everything you need off of the drive and back it all up. Everything on the USB drive with be deleted and replaced with Plugbox Linux.
1a. Now run:
/sbin/fdisk /dev/sda
1b. At the fdisk prompt delete the old partitions and create a new one:
* Now type p. This will list any partitions on your disk drive. * Type d 1, d 2, and so on to delete all partitions. * Type p to list partitions. there should be no partitions left. * Now type n, then p for primary, 1 for the first partition on the drive, and then press ENTER, accepting default values. * Exit by typing w.
1c. After you create a new partition create the file system:
wget http://plugapps.com/os/pogoplug/mke2fs chmod 755 mke2fs ./mke2fs /dev/sda1 mkdir usb mount /dev/sda1 usb
2. Download and install Plugbox Linux, a new kernel, and drivers for it:
cd usb wget http://plugapps.com/os/1.1/Plugbox-Linux-1.1-rootfs.tar.gz tar -xzvf Plugbox-Linux-1.1-rootfs.tar.gz # This will take a long time rm Plugbox-Linux-1.1-rootfs.tar.gz
3. Reboot. Cross your fingers and hope for the best.
cd .. umount usb /sbin/reboot
- You will have to "rm ~/.ssh/known_hosts" on Mac OS X and Linux to log back in as new SSH keys are generated.
- Log back in after your Pogoplug reboots using username "root" and password "root".
Things To Do After First Boot
- After the first time you boot Plugbox, you should update the installed packages.
Log in as root using the username and password indicated above. Then update all of the packages:
pacman -Syu
This will make sure that all of the packages (especially openssl, needed for the next step) are up to date.
- You should also follow the OpenNTPD installation guide. This will ensure that the time is set properly. An incorrectly set time will lead to password and authentication problems.
- To set up a static IP address instead of using DHCP, follow these steps to edit the /etc/rc.conf file.
- DockStar only: To control the front LED, follow this guide.
Understanding the Lights (DockStar)
On the DockStar, these are the default LED actions to interpret what your device is doing:
- Off: You are running the new uBoot or you have booted into Plugbox. The device may also be off.
- Flashing Green: The old Pogoplug bootloader is running.
- Flashing Orange: The old Pogoplug firmware is starting up.
- Solid Green: Pogoplug firmware has booted, internet connection is active, firmware can phone home. Or Plugbox with the Dockstar kernel has booted.
- Solid Orange/Flashing Orange: Pogoplug firmware has booted, there is a network connection, but it cannot phone home (the case if you followed above steps to prevent this). Both solid and flashing orange have been observed, and at this step they mean the same thing.
Troubleshooting
blparams CRC32 Errors
If blparam is spitting out a bunch of "ff ff ff ff..." garbage along with giving you a CRC32 error, the space that u-boot uses in mtd0 to store the boot parameters has become corrupted. There are two ways to fix this, depending on your situation:
- Use a serial cable, interrupt the boot, and issue a saveenv command. This will re-save the parameters and fix the CRC32 checksum.
- If you have a Dockstar or Pogoplug V2 Pink, you can simply install Jeff's u-boot to mtd0. It will still spit out a bunch of blparam errors, but this is OK. It will install. The new u-boot will by default boot to USB. There are also a lot of other cool things you can do.
Your MAC address will also need to be saved in u-boot again. Replace the zeros with the address from the sticker on the bottom of your plug. From stock firmware for original u-boot:
blparam 'ethaddr=00:00:00:00:00:00'
From stock firmware for Jeff's new u-boot:
fw_setenv ethaddr 00:00:00:00:00:00
Setting up a Serial Connection
If something would go wrong and your device would stop booting into Plugbox you would need to either:
- Open your Dockstar (voiding warranty!) to install a serial cable
- Or install netcat on a PC and instruct the Dockstar to send boot-time-messages to the netcat server PC. This option is not available if your boot parameters have been corrupted and you are not using the new u-boot.
The 1st option should be used with caution because you will void your product's warranty and because it requires electronics skills and soldering skills. If you want to follow that route, you could probably follow firestorm_v1's instructions down at his site [1]
On the other hand, the 2nd option looks much more appealing because you don't need to open up the device (thus keeping your warranty intact) and because it is supposed to be much easier to setup. At this point you could probably follow Jeff Doozan's instructions [2] [3]. But we'll replicate it here just in case you find it easier to follow this guide.
- One PC will be the server and your Dockstar will be the client.
- We will assume that your "server" PC is running Linux and that it has an IP address 10.0.0.1.
- We will also assume that the IP address 10.0.0.2 is available for the Dockstar.
On the "server" PC:
If the 'nc' (netcat) command is not installed on your machine, you'll need to install it: 'yum install nc' or 'apt-get install netcat' or even on win32 [4] Then make sure you're using IP 10.0.0.1, or whichever you decided you'd use on the PC.
There's no way of telling if the command syntax is the same on all of them. Apparently there are 3 different netcat sources. We sure hope they all share the same syntax.
On the Dockstar set up the IP address for 10.0.0.2, or whichever you decided to use on the Dockstar. Just remember, if you're not using these IP addresses, you will have to adapt and keep it plausible.
If you've upgraded uBoot, use the following commands:
fw_setenv serverip 10.0.0.1 fw_setenv ipaddr 10.0.0.2 fw_setenv if_netconsole 'ping $serverip' fw_setenv start_netconsole 'setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;' fw_setenv preboot 'run if_netconsole start_netconsole'
If you are still using the original uBoot:
blparam serverip=10.0.0.1 blparam ipaddr=10.0.0.2 blparam 'if_netconsole=ping $serverip' blparam 'start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;' blparam 'preboot=run if_netconsole start_netconsole'
Ok, time for a quick trial:
- On the PC run 'netcat -l 6666' or 'nc -l 6666' (depending on the version of netcat installed)
- On the Dockstar run 'nc server_ipaddress port' or in this example 'nc 10.0.0.1 6666'
Both consoles should have gone into monitor mode, which means, all you type on one end followed by cr+lf(enter) will appear on the opposite end. Hopefully you will have passed this test. Next thing you should do is:
- On the PC run 'netcat -lu 6666' or 'nc -lu 6666' (depending on the version of netcat installed)
- Simply restart the Dockstar with '/sbin/reboot'. After a few seconds your PC will start showing your Dockstar's boot messages and hopefully you will realize why you were not being successful in starting Plugbox on it.
Et voilá, you should take time to interpret what you see or ask a more experienced user for help and show him these boot-time-messages.
"Hack" your Dockstar
Note: All of these hacks are included in the uBoot install script.
You do not need to run them again by hand.
These instructions will remain here just in case we might need them again in the future.
This means you are advised not to use the "Hack" your Dockstar instructions but instead using the above Install the new uBoot on mtd0 instructions.
Over time Seagate has issued a number of firmware updates. One day, one of these firmware updates might remove SSH access to the plug computer or change the default 'root' password. To prevent anything like this from happening you should carefully follow these steps that were inspired in Alexander Holler's web site [5]. So, at this moment we have already successfully SSH'ed into our Dockstar. It is time to stop Pogoplug software from calling back home.
Procede like this:
killall hbwd # stops Pogoplug's software mount -o remount,rw / # mounts rootfs with read and write permissions chmod go+w /dev/null # fixes a bug echo "killall hbwd" >> /etc/init.d/rcS
The last line on the procedure will kill hbwd after the /etc/init.d/hbmgr.sh script starts it, preventing the dock from phoning home. Stopping hbmgr.sh outright should not be done, as this script loads required kernel modules for the stock firmware to function. To make sure that this script file now carries our changes just run a:
cat /etc/init.d/rcS | more
- Make sure the # sign is really in front of that whole line.
- When running a cat command piped to the more command, you can use the 'Page Up/Page Down' keys if the file doesn't fit your screen.
In the end, exit the output by pressing 'q' or by getting to the bottom of the text using 'space' or 'enter' as many times as needed.
Now, remount rootfs back as read-only again and shutdown the plug device:
mount -o remount,ro / # remounts in read-only mode /sbin/halt # shuts down the device Wait a couple of minutes before you turn off the device by removing the power plug.

