Welcome! Log In Create A New Profile

Advanced

Problems with Understanding Drive Order

Posted by nat 
nat
Problems with Understanding Drive Order
March 08, 2015 06:57AM
Okay, so I was setting up a new Pink E02 and had everything working great... and then I plugged in a hard disk and the USB drive order changed. Boom, my boot disk became sdb1 and wouldn't boot. I thought I had taken care of problems with changing drive order by using the "LABEL=" syntax with the usb_root variable, but then I realized that the usb_load was directly referencing device 0:1... so I still had a dependency on sda1.

I see that Jeff's old uboot script sets up a scan of all of the USB drives to locate the correct device with the uImage on it and I could incorporate this scan in my variables. Is this the right way to fix this problem under newer versions of uboot by Bodhi? Or is there something I am not understanding? I can generally puzzle out scripting questions, but I'm not at all good with the internals of Linux booting.

root@pinky:~# fw_printenv
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
ethaddr=xx:xx:xx:xx:xx:xx
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
baudrate=115200
bootcmd=run bootcmd_usb; run bootcmd_rescue; reset
bootcmd_rescue=run set_bootargs_rescue; nand read.e 0x800000 0x100000 0x400000; bootm 0x800000
bootcmd_usb=run usb_init; run set_bootargs_usb; run usb_boot;
bootdelay=10
console=ttyS0,115200
device=0:1
ethact=egiga0
led_error=orange blinking
led_exit=green off
led_init=green blinking
mainlineLinux=yes
mtdids=nand0=orion_nand
partition=nand0,2
preboot_nc=run if_netconsole start_netconsole
rescue_installed=1
rootdelay=10
rootfstype=ext3
set_bootargs_rescue=setenv bootargs console=$console ubi.mtd=2 root=ubi0:rootfs ro rootfstype=ubifs $mtdparts
set_bootargs_usb=setenv bootargs console=$console root=$usb_root rootdelay=$rootdelay rootfstype=$rootfstype $mtdparts
stderr=serial
stdin=serial
stdout=serial
usb_boot=mw 0x800000 0 1; run usb_load_uimage; if run usb_load_uinitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
usb_init=usb start
usb_load_uimage=ext2load usb $device 0x800000 /boot/uImage
usb_load_uinitrd=ext2load usb $device 0x1100000 /boot/uInitrd
usb_root=LABEL=rootfs
arcNumber=3542
machid=dd6
ipaddr=192.168.1.70
serverip=192.168.1.50
if_netconsole=ping $serverip
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
preboot=run if_netconsole start_netconsole


Thanks,

Nat
Re: Problems with Understanding Drive Order
March 08, 2015 07:10AM
nat,

> I see that Jeff's old uboot script sets up a scan
> of all of the USB drives to locate the correct
> device with the uImage on it and I could
> incorporate this scan in my variables. Is this
> the right way to fix this problem under newer
> versions of uboot by Bodhi?

Yes. I mentioned it in this thread (in my signature): u-boot & kernel booting process .

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
nat
Re: Problems with Understanding Drive Order
March 08, 2015 08:16AM
Oops, sorry to have missed that. For whatever reason, probably because of the long history of posts in the forum or a lack of imagination in search terms, I have a tough time locating the exact post I am looking for. Thanks again for your help.
Re: Problems with Understanding Drive Order
March 08, 2015 04:06PM
nat Wrote:
-------------------------------------------------------
> Oops, sorry to have missed that. For whatever
> reason, probably because of the long history of
> posts in the forum or a lack of imagination in
> search terms, I have a tough time locating the
> exact post I am looking for. Thanks again for
> your help.

NP. It is indeed hard to search for this topic.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
nat
Re: Problems with Understanding Drive Order
March 08, 2015 09:21PM
I struggled with this a bit, but I think I finally sorted out two things:

- I tried to use the Jeff syntax for searching the USB drives for the boot files with the 2014-07 uboot, but it just wasn't working. It didn't like the "usb=1 dev=sda1" syntax during the usb_scan tests, and issues a series of "** Bad device ** errors. So I dropped back to the Jeff uboot and have it sorted out. Is the Jeff usb_scan syntax supposed to work under 2014-07 uboot, or is it specific to Jeff's uboot?

- A second thing I have had regular problems with is that my pogos seem to have booted normally from the "nc" status and the lights, but then they never are ssh accessible. Now that I finally have a serial connection I see that the DHCP requests were failing during the Linux bootup. This seems to be because I had a different assigned address at the router (192.168.1.20) than I was using for the nc ipaddr variable (192.168.1.70). If I had the nc computer monitoring the boot, the computer would never appear on the network with the assigned lease-- it seems to be because the router wasn't responding to the DHCP requests during the Linux boot. It seems the router wasn't interested in sending a DHCP response to the same MAC address operating under two different IP addresses. I can resolve this by either turning off the nc monitoring or by syncing the ipaddr variable with the assigned lease on the router. This has been driving me craaazy.
Re: Problems with Understanding Drive Order
March 08, 2015 09:27PM
nat,

> - I tried to use the Jeff syntax for searching the
> USB drives for the boot files with the 2014-07
> uboot, but it just wasn't working. It didn't like
> the "usb=1 dev=sda1" syntax during the usb_scan
> tests, and issues a series of "** Bad device **
> errors. So I dropped back to the Jeff uboot and
> have it sorted out. Is the Jeff usb_scan syntax
> supposed to work under 2014-07 uboot, or is it
> specific to Jeff's uboot?

Something is wrong there. One of my boxes still run the same scan envs by Jeff, but with the new u-boot. It does work the same way.

>
> - A second thing I have had regular problems with
> is that my pogos seem to have booted normally from
> the "nc" status and the lights, but then they
> never are ssh accessible. Now that I finally have
> a serial connection I see that the DHCP requests
> were failing during the Linux bootup. This seems
> to be because I had a different assigned address
> at the router (192.168.1.20) than I was using for
> the nc ipaddr variable (192.168.1.70). If I had
> the nc computer monitoring the boot, the computer
> would never appear on the network with the
> assigned lease-- it seems to be because the router
> wasn't responding to the DHCP requests during the
> Linux boot. It seems the router wasn't interested
> in sending a DHCP response to the same MAC address
> operating under two different IP addresses. I can
> resolve this by either turning off the nc
> monitoring or by syncing the ipaddr variable with
> the assigned lease on the router. This has been
> driving me craaazy.

Yes. If you use static IP, or DHCP reserved IP then there should be no problem. That way the netconsole ipaddr is always the same as the IP in Linux.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
nat
Re: Problems with Understanding Drive Order
March 09, 2015 09:40AM
Of course you are right about the problems I was having with the Jeff usb_scan syntax with the 2014.07 uboot-- the syntax works fine when I tried a second time. I'm sure the problem is that I had a slight variation in one of the variables that caused the ** Bad device ** errors the first time I tried. I tried again, and it seems to be fine. I had some problems with having to do cold boots, but this seems to have been corrected with the usb_ready_retry setting.

I think I have my problems solved.
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: