PlugPBX Forums
May 19, 2012, 02:00:26 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Dockstar Debian Direct USB Boot in the works???  (Read 2987 times)
mattmc97
Administrator
Full Member
*****
Posts: 144


« on: August 09, 2010, 11:56:58 AM »

Jeff Doozan over at http://jeff.doozan.com/debian/ has made tremendous progress on fixing the dual boot issue with the dockstar.

Here is some info from our conversation over on his forum. http://forum.doozan.com.


The first step would be to update to Jeff's new Uboot.

http://jeff.doozan.com/debian/uboot/ top of page, under 'Updating the Plugbox uBoot on your Dockstar'


Then, see commands below.


From this conversation: http://forum.doozan.com/read.php?3,9


Boot only from USB:  

blparam "bootcmd=run bootcmd_usb"


To switch back to the "back and forth" booting, do:

blparam 'bootcmd=run bootcmd1'


To switch to 'always boot from NAND':  (I would not recommend this unless you are using it just for Pogo for obvious reasons)

blparam 'bootcmd=run bootcmd_original'


Main issue with this is if your USB drive dies, you have to have a serial cable to switch back. So I would definitely make a backup SD card and/or image once everything is perfect.


Can one of you with a serial cable try this please? (ehem.. klingon  Grin )


I don't have one yet and am hoping I don't have to ebay one if you guys can help me out.


Post your config and any issues here and I will update the procedure in this post.
« Last Edit: August 11, 2010, 07:42:37 PM by mattmc97 » Logged
klingon
Newbie
*
Posts: 41


« Reply #1 on: August 09, 2010, 04:07:22 PM »

Since you so graciously volunteered me........

I can vouch that these 3 options work, even with the previous uboot.  I've been using the first option to only boot from USB for a while now and its been flawless.  The dual boot option is std from the start and has its bootup weirdness as we've all grown so fond off!  And like Matt says, dont do option 1 (always from USB) unless you have serial connection set up. I see a coupla folks over at plugapps already trying to get JTAG working, so this will solve a lot of these funky boot workarounds once we can program the chip. Already bought myself a JTAG, so patiently waiting for someone to get this working  Smiley
Logged
mattmc97
Administrator
Full Member
*****
Posts: 144


« Reply #2 on: August 10, 2010, 06:26:39 AM »

Guys...

Check this post out. This is the way to go I believe. Jeff does it again!


http://forum.doozan.com/read.php?3,34,34#msg-34


From link above:
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


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.
Logged
jjoshua
Newbie
*
Posts: 13


« Reply #3 on: August 10, 2010, 10:47:37 AM »

I was thinking of the following...

1.  Within plug linux, create a shell script that waits for 30 seconds, checks for the presence of a file in /tmp, and reboots is the file is not there.
2.  Start the shell script in #1 as part of the plug linux init.
3.  Modify the plug linux root shell startup to touch the file that the script in #1 is looking for.

So, if the dockstar boots to plug linux, you have 30 seconds to log into it as root before it reboots itself.  If you login within 30 seconds, the root shell startup script will touch the file in /tmp and the script won't reboot the box.  Otherwise the script won't see the file in /tmp and the box will reboot.
Logged
mattmc97
Administrator
Full Member
*****
Posts: 144


« Reply #4 on: August 10, 2010, 11:08:18 AM »

That would definitely work. Several guys on plugapps have had a script start with rc-local which will wait two minutes and then reboot.

You don't really have to create the file. You can just have the script run and then if you want to kill the reboot, just use 'ps aux | grep reboot_script' , get the PID, and then 'kill -9 reboot_script_PID' which would prevent it from rebooting.


I think the solution above is pretty cool as well. Still seems like you should be able to do something like this:

DON"T ISSUE THESE COMMANDS, THEY DON'T WORK

setenv if_exists '/dev/sda'
setenv bootcmd 'run if_exists bootcmd_usb; run bootcmd_original'

I don't have a serial cable available, so I don't know if there is a command to check and see if a USB drive is present.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Install SimpleMachinesForum web hosting Valid XHTML 1.0! Valid CSS!