Welcome! Log In Create A New Profile

Advanced

How to let uBoot boot directly according to UUID other than scan all usb devices?

Posted by xfgavin 
How to let uBoot boot directly according to UUID other than scan all usb devices?
July 26, 2013 08:32PM
Hello folks,

Currently I met an uBoot problem: when I connect all my disks(assorted types of partition, from ext3 to ntfs) as well as my wheezy usb stick, uboot will hang up either when loading /rescueme or when it meets the ntfs partition. Can we skip scanning all usb devices and boot directly according to assigned UUID? Thanks.

Outputs from netconsole look like below:

U-Boot 2011.12 (Feb 20 2012 - 21:21:59)
Pogoplug E02
arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2009q3-67) 4.4.1
GNU ld (Sourcery G++ Lite 2009q3-67) 2.19.51.20090709
Hit any key to stop autoboot: 0
(Re)start USB...
USB: Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 5 USB Device(s) found
scanning bus for storage devices... 3 Storage Device(s) found
** Bad partition 1 **
** Partition 1 not valid on device 0 **

** Unable to use usb 0:1 for fatload **

or

U-Boot 2011.12 (Feb 20 2012 - 21:21:59)
Pogoplug E02
arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2009q3-67) 4.4.1
GNU ld (Sourcery G++ Lite 2009q3-67) 2.19.51.20090709
Hit any key to stop autoboot: 0
(Re)start USB...
USB: Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 5 USB Device(s) found
scanning bus for storage devices... r
3 Storage Device(s) found
Loading file "/rescueme" from usb device 0:1 (usbda1)


Below is my uboot parameters:

ethact=egiga0
bootdelay=3
baudrate=115200
mainlineLinux=yes
console=ttyS0,115200
led_init=green blinking
led_exit=green off
led_error=orange blinking
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
mtdids=nand0=orion_nand
partition=nand0,2
stdin=serial
stdout=serial
stderr=serial
rescue_set_bootargs=setenv bootargs console=$console ubi.mtd=2 root=ubi0:rootfs ro rootfstype=ubifs $mtdparts $rescue_custom_params
rescue_bootcmd=if test $rescue_installed -eq 1; then run rescue_set_bootargs; nand read.e 0x800000 0x100000 0x400000; bootm 0x800000; else run pogo_bootcmd; fi
pogo_bootcmd=if fsload uboot-original-mtd0.kwb; then go 0x800200; fi
force_rescue=0
force_rescue_bootcmd=if test $force_rescue -eq 1 || ext2load usb 0:1 0x1700000 /rescueme 1 || fatload usb 0:1 0x1700000 /rescueme.txt 1; then run rescue_bootcmd; fi
ubifs_mtd=3
ubifs_set_bootargs=setenv bootargs console=$console ubi.mtd=$ubifs_mtd root=ubi0:rootfs rootfstype=ubifs $mtdparts $ubifs_custom_params
ubifs_bootcmd=run ubifs_set_bootargs; if ubi part data && ubifsmount rootfs && ubifsload 0x800000 /boot/uImage && ubifsload 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; fi
usb_scan=usb_scan_done=0;for scan in $usb_scan_list; do run usb_scan_$scan; if test $usb_scan_done -eq 0 && ext2load usb $usb 0x800000 /boot/uImage 1; then usb_scan_done=1; echo "Found bootable drive on usb $usb"; setenv usb_device $usb; setenv usb_root /dev/$dev; fi; done
usb_scan_list=1 2 3 4
usb_scan_1=usb=0:1 dev=sda1
usb_scan_2=usb=1:1 dev=sdb1
usb_scan_3=usb=2:1 dev=sdc1
usb_scan_4=usb=3:1 dev=sdd1
usb_init=run usb_scan
usb_device=0:1
usb_root=/dev/sda1
usb_rootdelay=10
usb_bootcmd=run usb_init; run usb_set_bootargs; run usb_boot
usb_boot=mw 0x800000 0 1; ext2load usb $usb_device 0x800000 /boot/uImage; if ext2load usb $usb_device 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
bootcmd=usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run rescue_bootcmd; run pogo_bootcmd; reset
ethaddr=00:25:31:02:20:7E
arcNumber=2097
rescue_installed=1
usb_root_label=pogoarch
ipaddr=192.168.1.10
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
serverip=192.168.1.3
usb_rootfstype=ext3
usb_set_bootargs=setenv bootargs console=$console root=UUID=$usb_root_uuid rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts $usb_custom_params
usb_root_uuid=22ec7f65-b855-4860-b38b-2a3ab1f58905



Edited 1 time(s). Last edit at 07/27/2013 12:12PM by xfgavin.
im looking for the same thing man its frustrating as hell

*edit*

My pogoplug v4 has this issue, my GoFlex Home does not



Edited 1 time(s). Last edit at 10/21/2013 12:23PM by dbstrand24.
Re: How to let uBoot boot directly according to UUID other than scan all usb devices?
October 21, 2013 02:22PM
I'm curious: How can the uBoot find the UUID from which it is desired to boot from unless it scans the USB devices first?
well i wasnt actually looking for a uboot solution lol good point i actually want to solve the issue with kernel/ramdisk from nand if you make uboot boot a kernel from nand and have rootfs as usb it should solve the issue if im not mistaken...

*edit*

Then again i have not see anyone talking about this kidb of boot method......



Edited 1 time(s). Last edit at 10/21/2013 02:40PM by dbstrand24.
Re: How to let uBoot boot directly according to UUID other than scan all usb devices?
October 22, 2013 01:05AM
restamp Wrote:
-------------------------------------------------------
> I'm curious: How can the uBoot find the UUID from
> which it is desired to boot from unless it scans
> the USB devices first?

restamp, I think the question was misleading. It still must scan, but since the disk UUID was already assigned before in previous boot with a single disk drive, then it can be used for the next boot. And we can do it in Debian with fw_setenv. At least how I understood it (I could be missing some details).

However, the rootfs partition label is still the most elegant solution, IMO. Because UUID is not going to be valid if we change the boot drive. But rootfs label can be set outside or inside the box if the boot drive change.

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



Edited 1 time(s). Last edit at 10/22/2013 01:12AM by bodhi.
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: