This is how I changed the environment of Mainline U-Boot on my GoFlex Home to make it fall back to Pogoplug OS whenever there is no USB or SATA device attached that has /boot/uImage in it's first partition.
1. SSH to Arch Linux ARM. Install the package uboot-tools, edit /etc/fw_env.config, remove the hash at the beginning of the entry for the seagate dockstar.
$this->bbcode_second_pass_code('', '
# segate dockstar:
/dev/mtd0 0xc0000 0x20000 0x20000
')
2. Check your current environment. DO NOT PROCEED IF YOUR OUTPUT IS DIFFERENT.
$this->bbcode_second_pass_code('', '
[root@alarm ~]# fw_printenv bootcmd
bootcmd=ide reset; usb start; setenv letter 9;for type in ide usb; do for disk in 0; do if ${type} part ${disk};then setexpr letter $letter + 1;run load;fi;done;done;
')
3. Correct the mtd partitions settings
$this->bbcode_second_pass_code('', '
[root@alarm ~]# fw_setenv mtdparts 'mtdparts=orion_nand:1M(uboot),6M(uImage),-(root)'
')
4. Reboot
$this->bbcode_second_pass_code('', '
[root@alarm ~]# systemctl reboot
')
5. SSH to Arch Linux ARM. Mount the mtd2 ubi filesystem
$this->bbcode_second_pass_code('', '
[root@alarm ~]# ubiattach /dev/ubi_ctrl -O 2048 -p /dev/mtd2
UBI device number 0, total 1992 LEBs (252936192 bytes, 241.2 MiB), available 0 LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)
[root@alarm ~]# mount -t ubifs ubi0:rootfs /mnt/
')
6. Download the original bootloader of the DockStar (the GoFlex Home kwb from http://goflex.scottn.us/ did not work for me) to the mounted filesystem, check it's md5sum
$this->bbcode_second_pass_code('', '
[root@alarm ~]# cd /mnt/
[root@alarm mnt]# wget http://download.doozan.com/uboot/files/uboot/uboot.mtd0.dockstar.original.kwb
[root@alarm mnt]# md5sum uboot.mtd0.dockstar.original.kwb
b2d9681ef044e9ab6b058ef442b30b6e uboot.mtd0.dockstar.original.kwb
[root@alarm mnt]# cd
[root@alarm ~]# umount /mnt
')
7. Change the U-Boot bootcmd to chainload the original bootloader as a fallback
$this->bbcode_second_pass_code('', '
[root@alarm ~]# fw_setenv bootcmd_alarm 'ide reset; usb start; setenv letter 9;for type in ide usb; do for disk in 0; do if ${type} part ${disk};then setexpr letter $letter + 1;run load;fi;done;done;'
[root@alarm ~]# fw_setenv bootcmd_pogo 'if ubi part root 2048 && ubifsmount ubi:rootfs && ubifsload 0x800000 uboot.mtd0.dockstar.original.kwb ; then go 0x800200; fi'
[root@alarm ~]# fw_setenv bootcmd 'run bootcmd_alarm; run bootcmd_pogo'
')
8. Optionally reboot to check Arch Linux ARM still boots by default. Then shutdown
$this->bbcode_second_pass_code('', '
[root@alarm ~]# systemctl poweroff
')
9. When the SATA drive is halted, switch off the power, remove the drive that contains your Arch Linux ARM system (SATA and/or USB). Turn the power on. The GoFlex Home should now boot to stock Pogoplug OS. Here is a sample netconsole output
$this->bbcode_second_pass_code('', '
U-Boot 2014.04.R4-1 (Jun 28 2014 - 18:29:30) Arch Linux ARM
Seagate GoFlex Home
gcc (GCC) 4.8.2 20131219 (prerelease)
GNU ld (GNU Binutils) 2.24
Hit any key to stop autoboot: 0
Reset IDE: ide_preinit failed
(Re)start USB...
USB0: USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
IDE device 0 not available
no USB devices available
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size: 131072 bytes (128 KiB)
UBI: logical eraseblock size: 126976 bytes
UBI: smallest flash I/O unit: 2048
UBI: sub-page size: 512
UBI: VID header offset: 2048 (aligned 2048)
UBI: data offset: 4096
UBI: attached mtd1 to ubi0
UBI: MTD device name: "mtd=2"
UBI: MTD device size: 249 MiB
UBI: number of good PEBs: 1992
UBI: number of bad PEBs: 0
UBI: max. allowed volumes: 128
UBI: wear-leveling threshold: 4096
UBI: number of internal volumes: 1
UBI: number of user volumes: 1
UBI: available PEBs: 19
UBI: total number of reserved PEBs: 1973
UBI: number of PEBs reserved for bad PEB handling: 19
UBI: max/mean erase counter: 47/4
UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS: mounted read-only
UBIFS: file system size: 239857664 bytes (234236 KiB, 228 MiB, 1889 LEBs)
UBIFS: journal size: 9023488 bytes (8812 KiB, 8 MiB, 72 LEBs)
UBIFS: media format: w4/r0 (latest is w4/r0)
UBIFS: default compressor: zlib
UBIFS: reserved for root: 0 bytes (0 KiB)
Loading file 'uboot.mtd0.dockstar.original.kwb' to addr 0x00800000 with size 524288 (0x00080000)...
Done
## Starting application at 0x00800200 ...
')
10. Mind that Pogo OS will probably receive a different IP from your router. Login and gain root access as described in steps 3 and 4 of the installation guide. To shutdown run /sbin/poweroff.
11. Note that changes to the U-Boot environment will be overwritten by default settings whenever you install or update the package uboot-goflexhome and answer "y" to the question "A new U-Boot version needs to be flashed to NAND. Do you want to do this now? [y|N]".