[HowTo] Boot to Pogo OS on GoFlex Home using Mainline U-Boot

This forum is for Marvell Kirkwood devices such as the GoFlex Home/Net, PogoPlug v1/v2, SheevaPlug, and ZyXEL devices.

[HowTo] Boot to Pogo OS on GoFlex Home using Mainline U-Boot

Postby hydro » Sun Aug 03, 2014 8:39 am

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]".
VDR on DockStar / Pogoplug E02: http://linux.bplaced.net/
hydro
 
Posts: 210
Joined: Wed Jun 15, 2011 2:03 pm
Location: Germany

Re: [HowTo] Boot to Pogo OS on GoFlex Home using Mainline U-

Postby grayman4hire » Mon Aug 04, 2014 6:01 pm

Hi @hydro,

Thanks for posting this.

In an earlier post you mentioned you had to use tftp boot. I assume you managed to resolve that issue?

I'm trying to adapt your solution and apply it to the Pogoplug V4 (Mobile). I'm using the latest mainline uBoot from bodhi and trying to boot into the default Pogoplug OS by chain loading the ArchLinuxARM uBoot (http://archlinuxarm.org/os/ppv4/uboot.bin.gz) which I'm getting from the installation script - http://os.archlinuxarm.org/os/ppv4/ppv4-install.sh.

"uboot.v4.arch.kwb" == "uboot.bin"

I get as far as "## Starting application at 0x00800200 ..." but don't see anything else in my serial console.

Any ideas what's going on? I did notice that I'm using a default compressor of LZO versus zlib in your console log, which I'm not sure makes a difference.

$this->bbcode_second_pass_code('', '
UBI: attached mtd1 to ubi0
UBI: MTD device name: "mtd=4"
UBI: MTD device size: 112 MiB
UBI: number of good PEBs: 896
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: 0
UBI: total number of reserved PEBs: 896
UBI: number of PEBs reserved for bad PEB handling: 8
UBI: max/mean erase counter: 1/0
UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS: mounted read-only
UBIFS: file system size: 110850048 bytes (108252 KiB, 105 MiB, 873 LEBs)
UBIFS: journal size: 9023488 bytes (8812 KiB, 8 MiB, 72 LEBs)
UBIFS: media format: w4/r0 (latest is w4/r0)
UBIFS: default compressor: LZO
UBIFS: reserved for root: 0 bytes (0 KiB)
Loading file 'uboot.v4.arch.kwb' to addr 0x00800000 with size 474380 (0x00073d0c)...
Done
## Starting application at 0x00800200 ...
')
Last edited by grayman4hire on Tue Aug 05, 2014 12:36 am, edited 1 time in total.
grayman4hire
 
Posts: 350
Joined: Sat Sep 29, 2012 12:03 am
Location: SF, CA

Re: [HowTo] Boot to Pogo OS on GoFlex Home using Mainline U-

Postby bodhi » Mon Aug 04, 2014 9:18 pm

$this->bbcode_second_pass_quote('grayman4hire', '
')I get as far as "## Starting application at 0x00800200 ..." but don't see anything else in my serial console.
Any ideas what's going on?
[/code]

As I've mentioned, I don't think chainloading will work, because the new U-Boot and stock U-Boot are too different in structure, memory layout,..etc. But I would be pleasantly surprised if it does :)
bodhi
 
Posts: 225
Joined: Sat Aug 13, 2011 10:06 am

Re: [HowTo] Boot to Pogo OS on GoFlex Home using Mainline U-

Postby grayman4hire » Mon Aug 04, 2014 9:29 pm

$this->bbcode_second_pass_quote('bodhi', '
')As I've mentioned, I don't think chainloading will work, because the new U-Boot and stock U-Boot are too different in structure, memory layout,..etc. But I would be pleasantly surprised if it does :)


Yeah, I know you mentioned that already to me, but since @hydro is successful with using the mainline uBoot and chainloading the older uboot on his GoFlex, why can't we do it on the PP Mobile or E02?

I'm going to update one of my E02 to the mainline uBoot and try it with the known good kwb file provided by Jeff and report back.
grayman4hire
 
Posts: 350
Joined: Sat Sep 29, 2012 12:03 am
Location: SF, CA

Re: [HowTo] Boot to Pogo OS on GoFlex Home using Mainline U-

Postby bodhi » Mon Aug 04, 2014 10:29 pm

It might. I think if it does work, then it means you can chainload back to the original u-boot for that box, because that u-boot version has some settings initialization that made it possible.
bodhi
 
Posts: 225
Joined: Sat Aug 13, 2011 10:06 am

Re: [HowTo] Boot to Pogo OS on GoFlex Home using Mainline U-

Postby grayman4hire » Tue Aug 05, 2014 12:42 am

$this->bbcode_second_pass_quote('bodhi', 'I')t might. I think if it does work, then it means you can chainload back to the original u-boot for that box, because that u-boot version has some settings initialization that made it possible.


You're basically saying I need to use the (original) u-boot for the particular device, correct?

The only "original" uBoot I have for the Pogoplug Mobile is the one provided in the ArchLinuxArm.org Pogoplug V4 installation script (uboot.bin).

From what I read, uboot.bin for the Pogoplug v4 was built by @kmihelich from the same source as the used Cloud Engine with some enhancements/fixes - viewtopic.php?f=23&t=2712
grayman4hire
 
Posts: 350
Joined: Sat Sep 29, 2012 12:03 am
Location: SF, CA
Top

Re: [HowTo] Boot to Pogo OS on GoFlex Home using Mainline U-

Postby grayman4hire » Tue Aug 05, 2014 3:03 am

Is there no "fsload" command in the mainline ubootfor the Pogoplug E02?

The E02 uses jffs2 and I'm trying to execute "fsload uboot-original-mtd0.kwb" but getting a unknown command.
grayman4hire
 
Posts: 350
Joined: Sat Sep 29, 2012 12:03 am
Location: SF, CA

Re: [HowTo] Boot to Pogo OS on GoFlex Home using Mainline U-

Postby hydro » Tue Aug 05, 2014 5:31 pm

$this->bbcode_second_pass_quote('grayman4hire', '
')In an earlier post you mentioned you had to use tftp boot. I assume you managed to resolve that issue?

Yes it's resolved now, took my some time to find the right options for the ubi commands, some by trial and error (e.g. ubi part root vs ubifsmount ubi:rootfs)
$this->bbcode_second_pass_quote('grayman4hire', '
')I get as far as "## Starting application at 0x00800200 ..." but don't see anything else in my serial console.

Well, that's bad. I could only use netconsole and chainloading other U-Boot versions (e.g. uboot.mtd0.pinkpogo.davygravy-2012-02-20.kwb) never succeeded. I thought if I had a serial console, subsequent messages would give me a hint why it fails to continue.
$this->bbcode_second_pass_quote('grayman4hire', '
')Is there no "fsload" command in the mainline ubootfor the Pogoplug E02?

Ouch, I never tried. Now I must confirm it (tested on the GoFlex). Another piece missing in my proposed guide for the E02. Likely U-Boot must be recompiled with CONFIG_JFFS2_NAND.
VDR on DockStar / Pogoplug E02: http://linux.bplaced.net/
hydro
 
Posts: 210
Joined: Wed Jun 15, 2011 2:03 pm
Location: Germany
Top

Re: [HowTo] Boot to Pogo OS on GoFlex Home using Mainline U-

Postby grayman4hire » Tue Aug 05, 2014 8:22 pm

Thanks for the reply.

I'm going to give @bodhi's updated (2014.07) mainline uboot a try tonight - http://forum.doozan.com/read.php?3,12381.

I'm pretty sure he has jffs2/fsload support since it's there on the V4 version.
grayman4hire
 
Posts: 350
Joined: Sat Sep 29, 2012 12:03 am
Location: SF, CA

Re: [HowTo] Boot to Pogo OS on GoFlex Home using Mainline U-

Postby bodhi » Sun Aug 10, 2014 9:52 pm

$this->bbcode_second_pass_quote('grayman4hire', 'Y')ou're basically saying I need to use the (original) u-boot for the particular device, correct?
The only "original" uBoot I have for the Pogoplug Mobile is the one provided in the ArchLinuxArm.org Pogoplug V4 installation script (uboot.bin)


Correct, the Pogo V4 is sighly different from other Kirkwood plugs such as Pogo E02 or Dockstar, so you should use that PogoV4 U-Boot image (it's as good as stock and more).
bodhi
 
Posts: 225
Joined: Sat Aug 13, 2011 10:06 am
Top

Next

Return to Marvell Kirkwood

Who is online

Users browsing this forum: No registered users and 29 guests