Welcome! Log In Create A New Profile

Advanced

Possible fix for 'dual boot' problem with chained bootloaders

Posted by Jeff 
Possible fix for 'dual boot' problem with chained bootloaders
August 10, 2010 12:52AM
Update: An even better solution is to install my new mtd0 uBoot.

Original Message:
------

I've come up with a possible workaround to fix the 'dual boot' issue affecting chained bootloaders.

The trick is to boot from USB when a normal network connection is detected and boot from the Pogoplug install when the network is disconnected.

The setup below assumes that 192.168.1.200 is a free network address that the dockstar can use. It also assumes that 192.168.1.1 is the address of another device on your network that will always respond to ping. You'll want to change these addresses to match your network.

From inside the pogoplug uboot:

setenv ipaddr 192.168.1.200
setenv active_host 192.168.1.1
setenv if_connected 'ping ${active_host}'
setenv bootcmd 'run if_connected bootcmd_usb; run bootcmd_original'

or, from the linux command line:

blparam ipaddr=192.168.1.200
blparam active_host=192.168.1.1
blparam if_connected='ping ${active_host}'
blparam bootcmd='run if_connected bootcmd_usb; run bootcmd_original'


This should work pretty well under normal circumstances. If there's a power outage, the plugbox may boot faster than the device you have configured as 'active_host'. To account for this circumstance, you may want to modify the bootcmd to check the host status multiple times before falling back to the bootcmd_original. You can do this by adding more 'run if_connected bootcmd_usb' statements before the 'run bootcmd_original' command:

setenv bootcmd 'run if_connected bootcmd_usb; run if_connected bootcmd_usb; run bootcmd_original'

Each attempt will take about 15 seconds. The above command will attempt to ping the host, and failing that will try again, and still failing will boot the Pogoplug install. The total execution time of the above command will be about 30 seconds when the network is down or just 1 second when the network is up.

-- Jeff



Edited 2 time(s). Last edit at 08/22/2010 09:35PM by Jeff.
Re: Possible fix for 'dual boot' problem with chained bootloaders
August 10, 2010 08:23AM
Jeff,

Nice work, once again. This is a nice solution especially because if your SD Card dies, all you will have to do is unplug the ethernet and get back into the pogoplug interface to start over or re-image.

Thanks again.
Hi, Jeff:
I am trying to use the method you described but have a few questions.
1. My Pogoplug does not recognize blparam command for some reason. Can you let me know what should I do to make it work?
2. It recognize the fw_setenv, I used it instead. It worked. Is this o.k., i.e., will it remember whet start next time?
3. How I can inside the pogoplug uboot?
Thanks in advance.
Re: Possible fix for 'dual boot' problem with chained bootloaders
August 12, 2010 05:30PM
blparam is in /usr/local/cloudengines/bin on your Pogoplug install. It configures the boot options for the Pogoplug uBoot on mtd0
fw_setenv configures the boot options for the new uBoot on mtd3
They are NOT interchangeable.

-- Jeff



Edited 1 time(s). Last edit at 08/12/2010 05:31PM by Jeff.
Re: Possible fix for 'dual boot' problem with chained bootloaders
August 14, 2010 09:06AM
Thank you very much Jeff! This is working perfectly! :)
Jeff:
Thanks. It works perfectly now.
do you see any chance to change the ping check to a partion check ?
I do not know pogoplug, but seems this workaround reads exit code.
so how about

cat /proc/partitions | grep -q sda

thanks
thorsten
Re: Possible fix for 'dual boot' problem with chained bootloaders
August 19, 2010 09:03PM
I dont get it. If I disconnect the dockstar from the network in order to boot from the pogoplug install than there is no way to ssh in that device.
after it's booted, connect the cable and et voila.
After i set the blparam and i reboot, my device seems not to boot debian. the led flashes for about 10 secs after this my the led is dark. another couple of time it starts again flashing green for 10 secs. is there a logfile i could refer?
I used the "dual boot" approach and it has been worked fine for me. Normally, you will see the LED flashing green and then it becomes dark. After a few seconds, the USB driver start flashing. This means Dockstar is booting from the USB. Depending how you restart your Dockstar (soft reset, hard reset or power cycle) I did notice that it would go flashing green again sometimes. In this case, I just push the hard reset button and it should be boot fine. If you take the Ethernet cable off, the LED will go from flashing green to flashing orange and boot from the internal memory.
Jeff:
I installed your dual boot method a couple of weeks ago. I don't recall I used your uboot/install_uboot_mtd0.sh or uboot/install_uboot_mtd3.sh. Right now looks like you only use the mtd0.sh script. Will the dual approach work on either mtd3 or mtd0, or only on mtd0? (My Asterisk/Freepbx/GV works perfectly right now so I will keep it running and experiment on a new Dockstar I have.) Thanks for your help.
Re: Possible fix for 'dual boot' problem with chained bootloaders
August 24, 2010 08:39PM
I recommend using the mtd0 uBoot.

The new mtd0 uBoot supports booting both USB and the old Pogoplug install. It will try USB first, and if that doesn't work, it will fall back to booting the Pogoplug install.

The mtd3 uBoot will 'dual boot' USB on on boot, then Pogo on the next boot unless you use a 'workaround' like described above.

-- Jeff
Jeff:
Thanks. So far, the mdt3 "workaround" works fine for me. I haven't tried the mdt0 uboot yet.
Jeff:
I installed mdt0 uboot and it works great. Thank you very much for your great work.
Author:

Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: