Welcome! Log In Create A New Profile

Advanced

2 usb sticks with rootfs on it?

Posted by Almaz 
2 usb sticks with rootfs on it?
October 13, 2014 02:57AM
I'm using Bodhi rootfs for pogoplug. 1st USB with my standard OS and 2nd rootfs USB just for compiling apps. Is it possible to have both USB's plugged in and switch boot order by restarting? What I did I plugged in both usb's and changed the label on the first one to rootfsORIG. Rebooted the system but the first usb still booted up instead of the second one. The reason I'm doing this so I don't have to physically switch USB's when I need to compile something fast.
Re: 2 usb sticks with rootfs on it?
October 13, 2014 09:28AM
the boot order AFAIK unless you tell uboot to specifically look for a device with a label of rootfs will boot from the first usb "stick" it finds

#set rootfs file system type
/tmp/fw_setenv usb_rootfstype ext3


try bodhis suggestion from yesterday to another forum member

http://forum.doozan.com/read.php?3,12381,18003#msg-18003
Re: 2 usb sticks with rootfs on it?
October 13, 2014 04:24PM
@Almaz,

If both USB drives have rootfs, then u-boot env will need more than rootfs label change. uImage detection also needed to change.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: 2 usb sticks with rootfs on it?
October 13, 2014 08:35PM
Problem solved by switching

from
fw_setenv usb_scan_list 1 2 3 4

to
fw_setenv usb_scan_list 4 3 2 1
Re: 2 usb sticks with rootfs on it?
October 14, 2014 12:04AM
Almaz,

> Problem solved by switching
>
> from
> fw_setenv usb_scan_list 1 2 3 4
>
> to
> fw_setenv usb_scan_list 4 3 2 1

Not a sure thing. It might work for current USB drives and the way you plug them in. As soon as you change the order or brand of USB drives, you might find it get out of wack again :)

I will release the next version of u-boot images that has loading uEnv.txt capability, which will help the boot drive kernel/rootfs selection a lot easier to implement.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: 2 usb sticks with rootfs on it?
October 14, 2014 12:15AM
thanks Bodhi
Re: 2 usb sticks with rootfs on it?
October 14, 2014 02:05AM
Almaz,

I gave it a second thought! Actually you don't have to wait until new u-boot release to do this. Do you have netconsole or serial console? if you do, try:

1. In Debian,
cd  /boot
touch boot.txt

2. Reboot, interrupt serial/net console, and execute

> setenv test_boot_drive 'if test -e usb 0:1 /boot/boot.txt; then echo Found boot.txt; fi'
> run test_boot_drive


3. or if your boot drive is the other one

> setenv test_boot_drive 'if test -e usb 1:1 /boot/boot.txt; then echo Found boot.txt; fi'
> run test_boot_drive


Tell me if it found your boot drive.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 10/14/2014 02:07AM by bodhi.
Re: 2 usb sticks with rootfs on it?
October 14, 2014 02:13AM
I don't have setenv option. I can only use fw_setenv if it makes any difference.

U-Boot 2011.12 (Feb 20 2012 - 21:21:59)
Pogoplug E02U-Boot
Re: 2 usb sticks with rootfs on it?
October 14, 2014 03:34AM
Almaz Wrote:
-------------------------------------------------------
> I don't have setenv option. I can only use
> fw_setenv if it makes any difference.
>
> U-Boot 2011.12 (Feb 20 2012 - 21:21:59)
> Pogoplug E02U-Boot

test -e won't work in this u-boot version (too old).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Author:

Your Email:


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: