[How-To] update DStar/PP/GFlex to new uBoot for kernel>3.2

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

[How-To] update DStar/PP/GFlex to new uBoot for kernel>3.2

Postby moonman » Mon Aug 13, 2012 7:29 am

_______________________________________________________________________________
THIS GUIDE (AND UBOOT ITSELF) IS DEPRECATED. READ HERE TO UPDATE U-BOOT.
_______________________________________________________________________________



I am basically copying this from doozan's forum and collecting things from a multiple page thread into one post here. (I've changed/added many things since) Doing what is described here may (soft) brick your device (still recoverable with a serial). So stop and think twice. Read the whole guide first before attempting to upgrade and make sure you understand everything and won't miss a step. ACTIVATE NETCONSOLE before rebooting or be stuck waiting for a USB->TTL adapter if something goes wrong. On the bright side you will be able to run kernels past version 3.2 and currently archlinuxarm has kernel version 3.10.10 in the repos (as of this writing).

Dockstar/Pogoplug V1/V2:
Keep in mind that if you just installed alarm then you already have the new U-Boot, so there's no need to do this, except to use a workaround for the arcNumber bug if you have a Pogoplug V2.

Upgrade is very simple:
$this->bbcode_second_pass_code('', 'cd /tmp
wget http://projects.doozan.com/uboot/install_uboot_mtd0.sh
chmod +x install_uboot_mtd0.sh
./install_uboot_mtd0.sh')

There seems to be a bug in this version of the uBoot for Pogoplug V2 (don't know if other devices exhibit the same behavior - reports are welcome) as arcNumber doesn't get passed to the kernel and kernel seems to think it is a sheeva plug. Thanks to bodhi, the workaround is to set machid in hex. (3542 = hex(dd6))
$this->bbcode_second_pass_code('', '/usr/sbin/fw_setenv machid dd6')

This is it. It is highly recommended to enable netconsole for troubleshooting, especially if you don't have a serial - jump to the Enabling netconsole section.
------------------------------------------------------------------------

GoFlex Home/Net:
I do not own GoFlex Net myself so I do not know how well this will work with booting off of the sata drive. Probably only one sata port will work for booting:

$this->bbcode_second_pass_code('', 'cd /tmp
wget http://projects.doozan.com/uboot/install_uboot_mtd0.sh
chmod +x install_uboot_mtd0.sh
./install_uboot_mtd0.sh --no-uboot-check')

It will say that it can't recognize your device. Choose the one that you have from the list. If you choose wrong model you will probably brick your device.

After it is done DO NOT REBOOT!!!

Make sure you have the correct arcNumber set for your device, or you won't be able to boot from sata!
Home: "/usr/sbin/fw_setenv arcNumber 3338"
Net: "/usr/sbin/fw_setenv arcNumber 3089"

Now, depending if you have rootfs on USB or SATA you need to set up U-Boot environemnt differently.

SATA then USB:
The following will allow USB boot, but SATA will be tried first
$this->bbcode_second_pass_code('', '/usr/sbin/fw_setenv sata_device '0:1'
/usr/sbin/fw_setenv sata_root '/dev/sda1'
/usr/sbin/fw_setenv sata_rootfstype 'ext3'
/usr/sbin/fw_setenv sata_rootdelay '10'
/usr/sbin/fw_setenv sata_set_bootargs 'setenv bootargs console=$console root=$sata_root rootdelay=$sata_rootdelay rootfstype=$sata_rootfstype $mtdparts $sata_custom_params'
/usr/sbin/fw_setenv sata_boot 'ide reset; mw 0x800000 0 1; ext2load ide $sata_device 0x800000 /boot/uImage; if ext2load ide $sata_device 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi'
/usr/sbin/fw_setenv sata_bootcmd 'run sata_set_bootargs; run sata_boot'
/usr/sbin/fw_setenv bootcmd 'run sata_bootcmd; usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run rescue_bootcmd; run pogo_bootcmd; reset'')

OR

USB then SATA:
The following will allow SATA boot, but USB will be tried first
$this->bbcode_second_pass_code('', '/usr/sbin/fw_setenv sata_device '0:1'
/usr/sbin/fw_setenv sata_root '/dev/sda1'
/usr/sbin/fw_setenv sata_rootfstype 'ext3'
/usr/sbin/fw_setenv sata_rootdelay '10'
/usr/sbin/fw_setenv sata_set_bootargs 'setenv bootargs console=$console root=$sata_root rootdelay=$sata_rootdelay rootfstype=$sata_rootfstype $mtdparts $sata_custom_params'
/usr/sbin/fw_setenv sata_boot 'ide reset; mw 0x800000 0 1; ext2load ide $sata_device 0x800000 /boot/uImage; if ext2load ide $sata_device 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi'
/usr/sbin/fw_setenv sata_bootcmd 'run sata_set_bootargs; run sata_boot'
/usr/sbin/fw_setenv bootcmd 'usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run sata_bootcmd; run rescue_bootcmd; run pogo_bootcmd; reset'')

----------------------------------------------------------------------------------------------

Note: There are some reports that USB booting does not work while sata drive is in. So there are 2 ways to resolve this:
(Edit: try this first: the solution by mlitke)
1. Remove sata drive before (re)booting and insert it when system has booted up.
2. Create an initial ramdisk which will let you choose the root drive by label instead of /dev/sd[a,b,c,d]1 (the instructions below assume that you've removed the SATA drive and booted off of the flash drive that you will always boot from later)
(a) Download (or create your own) this uInitrd I created (it should survive kernel upgrades as I didn't include any kernel-specific modules in it):
$this->bbcode_second_pass_code('', 'cd /boot
wget http://goo.gl/GFbtn -O uInitrd')
It is also available here: http://www.mediafire.com/file/e6mwdz6bw3nxmjj/uInitrd in case my pogo is down.
(b) $this->bbcode_second_pass_code('', 'chmod 644 /boot/uInitrd')
(c) change the default usb_set_bootargs to this:
$this->bbcode_second_pass_code('', '/usr/sbin/fw_setenv usb_set_bootargs 'setenv bootargs console=$console root=/dev/disk/by-label/urootfs rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts $usb_custom_params'')
Another Note: Your usb drive needs to have a label "urootfs" whcih can be done with "tune2fs -L urootfs /dev/sda1" while booted into archlinux without the sata drive. You may change it to whatever you want, but then be sure to change root=/dev/disk/by-label/urootfs to the name you want.
Another Note 2: If you are using the new systemd rootfs tarball then rootfs will be mounted read only unless you add an entry into fstab:
$this->bbcode_second_pass_code('', 'LABEL=urootfs / ext3 rw,noatime 0 1')

Activating netconsole (works for all devices)(optional, but recommended to troubleshoot - just do it!):
For all devices: Please refer to this gude on how to use netconsole (not just GoFlex Home users)
$this->bbcode_second_pass_code('', '#U-BOOT Netconsole
/usr/sbin/fw_setenv ipaddr '10.10.10.6'
/usr/sbin/fw_setenv ncip '10.10.10.5'
/usr/sbin/fw_setenv ncipk '10.10.10.4'
/usr/sbin/fw_setenv serverip '10.10.10.3'
/usr/sbin/fw_setenv preboot 'run nc_test nc_start'
/usr/sbin/fw_setenv nc_test 'ping $ncip'
/usr/sbin/fw_setenv nc_start 'setenv stdin nc; setenv stdout nc; setenv stderr nc; version'
#Kernel Netconsole:
#When booting from USB
/usr/sbin/fw_setenv usb_custom_params 'ignore_loglevel netconsole=6665@10.10.10.3/eth0,6666@10.10.10.4/'
#When booting from SATA
/usr/sbin/fw_setenv sata_custom_params 'ignore_loglevel netconsole=6665@10.10.10.3/eth0,6666@10.10.10.4/'')


Setting BFQ as the default I/O scheduler
Since kernel version 3.1.10-15 and 3.6.10-1 this is the default I/O scheduler. No need to do this anymore!
Since kernel version 3.5.4-0 there is a BFQ I/O scheduler compiled in. It is not activated by default. You can either activate it selectively for different drives or activate it globally and make it the default I/O scheduler.
Please note even though that you may see some benefit of using BFQ with a flash drive, the results will be better with a spinning hard drive. SSD/Flash Drives should benefit more from using 'noop' scheduler. This is all theory so do some tests and see what works the best for the workload that you have. Allso note that hdd speed tests will show the same result. The difference is noticeable under some sort of load and multiple applications accessing the same hard drive.

To activate it selectively, read here.

To activate it globally, modification to bootargs u-boot variable is required.

If you had activated netconsole in the previous step:
$this->bbcode_second_pass_code('', '/usr/sbin/fw_setenv usb_custom_params 'ignore_loglevel netconsole=6665@10.10.10.3/eth0,6666@10.10.10.4/ elevator=bfq'
/usr/sbin/fw_setenv sata_custom_params 'ignore_loglevel netconsole=6665@10.10.10.3/eth0,6666@10.10.10.4/ elevator=bfq'')

OR

If you did not activate netconsole:
$this->bbcode_second_pass_code('', '/usr/sbin/fw_setenv usb_custom_params 'elevator=bfq'
/usr/sbin/fw_setenv sata_custom_params 'elevator=bfq'')
----------------------------------------------------------------------------------------------
Reboot now :)

Now you can install the new kernel, which is at version 3.6.4 as of this wring.
$this->bbcode_second_pass_code('', 'pacman -Sy linux-kirkwood linux-headers-kirkwood')

Thanks to Mr. Doozan and Davygravy for this new UBoot, Vlad for netconsole, Sagittarius for SATA Boot and Kurlon for the kernel.
Last edited by moonman on Wed May 08, 2013 3:33 am, edited 85 times in total.
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: How to update DStar/PPlug/GFlex to new uBoot for kernel>

Postby pepedog » Thu Aug 16, 2012 9:13 pm

Found you have to have path in, ie
/usr/sbin/fw_setenv usb_rootfstype ext3
Good work though by you all
New kirkwood kernel has stuff missing for ipv4, shorewall fails, reported
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: How to update DStar/PPlug/GFlex to new uBoot for kernel>

Postby Kurlon » Thu Aug 16, 2012 10:10 pm

If you can dig up more details on the shorewall issue I'll try to fix linux-kirkwood. AFAIK there isn't anything turned off from the normal ALARM linux kernel config.
Kurlon
 
Posts: 132
Joined: Fri Jan 06, 2012 10:05 pm

Re: How to update DStar/PPlug/GFlex to new uBoot for kernel>

Postby moonman » Thu Aug 16, 2012 10:37 pm

$this->bbcode_second_pass_quote('pepedog', 'F')ound you have to have path in, ie
/usr/sbin/fw_setenv usb_rootfstype ext3
Good work though by you all
New kirkwood kernel has stuff missing for ipv4, shorewall fails, reported


It worked fine for me without the path.Thanks, I'll add it to the guide.
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: How to update DStar/PPlug/GFlex to new uBoot for kernel>

Postby moonman » Fri Aug 17, 2012 1:59 am

I don't think current shorewall is compatible with 3.5 http://www.shorewall.net/Helpers.html. Maybe version 4.5.7 will support it?
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: How to update DStar/PPlug/GFlex to new uBoot for kernel>

Postby pepedog » Fri Aug 17, 2012 8:53 am

Drifting off track of uBoot a little,
$this->bbcode_second_pass_code('', 'shorewall version
4.5.6.2')
The module is identified so when in repo I will test that kernel. It looked like log changed from 2 items to 1 differently named item.
https://github.com/archlinuxarm/PKGBUILDs/issues/240
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: How to update DStar/PPlug/GFlex to new uBoot for kernel>

Postby Snerler » Mon Aug 27, 2012 7:41 pm

I followed these instructi$this->bbcode_second_pass_code('', '')ons with my Goflex Home and something went wrong.

The GFH can't boot into my SATA installation anymore (I did use the SATA boot first commands). I can only boot into an installation on a flash drive. But when I run fw_printenv now, I am getting:

$this->bbcode_second_pass_code('', 'Too few good blocks within range')

I tried reverting to the original u-boot but when I run ./ubit_start I get:

$this->bbcode_second_pass_code('', '# ubit_start
No installed UBIT ramdisk could be found.
'ubit_start' needs to be run from the directory containing the UBIT ramdisk
or on a system with a UBIT ramdisk installed either at '/boot/uInitrd' or in
echo a UBIFS partition named 'fast', 'silent' or 'ramdisk'
#')

How can i get back to booting off my SATA drive?
Snerler
 
Posts: 21
Joined: Fri May 11, 2012 2:52 am

Re: How to update DStar/PPlug/GFlex to new uBoot for kernel>

Postby moonman » Mon Aug 27, 2012 10:29 pm

What kernel are you running? I know some people had this problem with older kernels
$this->bbcode_second_pass_code('', 'uname -a')
Update to the latest (be it 3.1.12 or 3.5.2)
http://forum.doozan.com/read.php?2,7451

Did you activate netconsole? If you did, you can use netconsole to change the environment.

To reinstall old u-boot you need two pieces: the script and uInitrd
$this->bbcode_second_pass_code('', 'cd /tmp
wget http://jeff.doozan.com/debian/goflex/v0.6/uInitrd
wget http://jeff.doozan.com/debian/goflex/v0.6/ubit_start
chmod +x ubit_start
./ubit_start')
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: How to update DStar/PPlug/GFlex to new uBoot for kernel>

Postby moonman » Wed Aug 29, 2012 8:51 am

Can somebody with GoFlex Net confirm booting from Left Sata port by setting
$this->bbcode_second_pass_code('', '/usr/sbin/fw_setenv sata_device '1:1'')

if it doesn't work you'll need to revert by booting from USB and setting sata_device back to 0:1
$this->bbcode_second_pass_code('', '/usr/sbin/fw_setenv sata_device '0:1'')

If it works I'll try to write a similar to usb_scan u-boot environment script so that it is possible to boot from either left or right sata port.
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: [How-To] update DStar/PP/GFlex to new uBoot for kernel>3

Postby sambul13 » Tue Oct 02, 2012 10:28 pm

I configured and started as root Netconsole module to watch GFN boot on a PC with ArchLinux 3.5.4-1 installed, but when running nc command, bash gives error:

$this->bbcode_second_pass_code('', 'nc -u -l -p 6666
bash: nc: command not found')
Any ideas? There is no nc in /sbin dir or anywhere in FS.
sambul13
 
Posts: 258
Joined: Sat Aug 18, 2012 10:32 pm

Next

Return to Marvell Kirkwood

Who is online

Users browsing this forum: No registered users and 7 guests