How to boot from SD

Discuss peripherals for the XO and power management.

How to boot from SD

Postby cwickert » Sat May 16, 2009 11:24 am

I have a 4 GB SDHC card but I cannot get my XO (developer program) to boot from it. First I got the error "device didn't power up after one second". I googled a little and some replies as well as the changelogs indicated I had to upgrade my BIOS. Now I have firmware Q2E24. The error message has changed, but the XO wont boot from the SD card. Instead I get:
<buffer@ffb61e28>:35: Can't open boot device

Any ideas?
cwickert
 
Posts: 7
Joined: Sat May 16, 2009 11:19 am

Re: How to boot from SD

Postby cwickert » Sat May 16, 2009 11:37 am

A little more info for people traing to help me:
When I try to boot from the card. I see the following on the display
Boot device: /sd/disk:\boot\olpc.fth Arguments:
Boot device: /sd/disk:$xosyspath\vmlinuz0 Agruments: root=uuid=100C-91BC rootfstype=vfat rw liveimg overlay=UUID=100C91BC quiet rhgb persistenthome=mtd0 reset overlay

Is this correct? Why does the first line have no arguments? /boot/olpc.fth does exist on the SD.
The second line looks ok to me, /syslinux/vmlinux is there, and the UUID and the overlay file are correctly recognized, so at least it can read the card. But it wont boot.
cwickert
 
Posts: 7
Joined: Sat May 16, 2009 11:19 am

Re: How to boot from SD

Postby cwickert » Sat May 16, 2009 1:30 pm

Meanwhile I was told to update to Q2E41 and so I did. No change, still "Unable to open boot device". In fact things have become worse:
  • Booting without SD I don't get a boot prompt from the firmware at all but have to press Esc. Is this intended?
  • Booting with SD I have to type "boot" before it tries to. This used to work automatically. Has the behavior changed?
I have read all changelogs in the wiki but I can't find any info on the changes I described above. Shouldn't things like these be documented somehow?
cwickert
 
Posts: 7
Joined: Sat May 16, 2009 11:19 am

Re: How to boot from SD

Postby ektoric » Sun May 17, 2009 1:57 pm

What distro is on your SD?
  • "Boot device: /sd/disk:\boot\olpc.fth Arguments:" is correct. That means the firmware was able to mount your SD, and found a usable olpc.fth file. This file needs no arguments as all the boot parameters are specified in this file.
  • "Boot device: /sd/disk:$xosyspath\vmlinuz0 Agruments: root=uuid=100C-91BC rootfstype=vfat overlay=UUID=100C91BC ..."
    • are you sure you have the variable "$xosyspath" defined correctly? If you're not sure, you might want to forgo the variable and just slap in the static pathname.
    • your root uuid and overlay uuid look a little similar but different. Please double (tripple?) check that these are the correct values.
    • One way to check the UUID, at least on a desktop system is to insert your SD and
      Code: Select all
      ls -lF /dev/disk/by-uuid/
I think number 3 is the biggest reason for which the firmware "can't open boot device". The easiest way to debug this is to follow http://wiki.laptop.org/go/Custom_bootloader and manually enter your boot-file, boot-device, ramdisk. Once you've got a combination that works, you can create a simple olpc.fth file that specifies those (and only those) parameters, for the XO to autoboot with. Afterwards, you can play with the olpc.fth to add logic/functionality.
ektoric
Support Team
 
Posts: 470
Joined: Wed Jan 02, 2008 3:46 pm
Location: Austin, TX

Re: How to boot from SD

Postby cwickert » Sun May 17, 2009 4:26 pm

ektoric wrote:What distro is on your SD?

A custom Fedora 10 spin.

are you sure you have the variable "$xosyspath" defined correctly? If you're not sure, you might want to forgo the variable and just slap in the static pathname.

How would I check that and what would the correct pathname be? Sorry, this is all quite new to me and I find it badly documented, e.g. there is no full example commandline on the wiki page.

But I think you are right, looks like $xosyspath is not defined at all in oplc.fth:
\ Boot script for USB boot
hex rom-pa fffc7 + 4 $number drop h# 2e19 < [if]
patch 2drop erase claim-params
: high-ramdisk ( -- )
cv-load-ramdisk
h# 22c +lp l@ 1+ memory-limit umin /ramdisk - ffff.f000 and ( new-ramdisk-adr )
ramdisk-adr over /ramdisk move ( new-ramdisk-adr )
to ramdisk-adr
;
' high-ramdisk to load-ramdisk
[then]

: set-bootpath-dev ( -- )
" /chosen" find-package if ( phandle )
" bootpath" rot get-package-property 0= if ( propval$ )
get-encoded-string ( bootpath$ )
[char] \ left-parse-string 2nip ( dn$ )
dn-buf place ( )
then
then

" /sd" dn-buf count sindex 0>= if
" sd:"
else
" u:"
then
" BOOTPATHDEV" $set-macro
;

set-bootpath-dev
" root=UUID=100C-91BC rootfstype=vfat rw liveimg overlay=UUID=100C-91BC quiet rhgb persistenthome=mtd0 reset_overlay" to boot-file
" ${BOOTPATHDEV}$xosyspath\initrd0.img" expand$ to ramdisk
" ${BOOTPATHDEV}$xosyspath\vmlinuz0" expand$ to boot-device
unfreeze
boot


ektoric wrote:your root uuid and overlay uuid look a little similar but different.

Sorry, that was a typo, they both match:
Code: Select all
root=UUID=100C-91BC rootfstype=vfat rw liveimg overlay=UUID=100C-91BC quiet  rhgb  persistenthome=mtd0 reset_overlay


ektoric wrote:One way to check the UUID, at least on a desktop system is to insert your SD and
Code: Select all
ls -lF /dev/disk/by-uuid/

Code: Select all
ls -lF /dev/disk/by-uuid/
insgesamt 0
lrwxrwxrwx 1 root root 15 17. Mai 20:26 100C-91BC -> ../../mmcblk0p1
lrwxrwxrwx 1 root root 10 17. Mai 15:45 9417-721B -> ../../sda1
lrwxrwxrwx 1 root root 10 17. Mai 15:45 98980779980754E2 -> ../../sda2
lrwxrwxrwx 1 root root 10 17. Mai 15:45 cf765682-7541-4e0b-a490-7c288eedf0d6 -> ../../sda3

So the UUID is correct.

Code: Select all
ls /media/disk/syslinux/vmlinuz*
/media/disk/syslinux/vmlinuz0

syslinux/vmlinuz0 also exists.

Code: Select all
ls /media/disk/LiveOS/overlay*
/media/disk/LiveOS/overlay--100C-91BC

So does the overlay file.

ektoric wrote:The easiest way to debug this is to follow http://wiki.laptop.org/go/Custom_bootloader and manually enter your boot-file, boot-device, ramdisk. Once you've got a combination that works, you can create a simple olpc.fth file that specifies those (and only those) parameters, for the XO to autoboot with.

Sorry, I'm getting confused more and more. Shouldn't livecd-creator take care of creating a proper fth? Regarding autoboot: any idea why my XO wont boot automatically with Q2E41?
cwickert
 
Posts: 7
Joined: Sat May 16, 2009 11:19 am

Re: How to boot from SD

Postby cwickert » Sun May 17, 2009 5:56 pm

Ok, the path is definitely wrong because $xosyspath is not set. When I try
Code: Select all
boot sd:\syslinux\vmlinuz0

at least the kernel is found. So I edited the fth and replaced "$xosyspath" with "\syslinux". Nothing, the file boot loader wont show up at all. When I use ":\syslinux" instead the firmware tries to boot, but wont find the kernel due to the duplicate "::" This means that "\syslinux" is correct. What is wrong here? I don't get it.
cwickert
 
Posts: 7
Joined: Sat May 16, 2009 11:19 am

Re: How to boot from SD [SOLVED]

Postby cwickert » Tue May 19, 2009 8:10 pm

OK, problem solved, unfreeze-dcon was missing. So the last 3 lines become:
unfreeze
unfreeze-dcon
boot

A big thanks goes out to Mitch Bradley for this!
cwickert
 
Posts: 7
Joined: Sat May 16, 2009 11:19 am

Re: How to boot from SD

Postby ektoric » Tue May 19, 2009 10:42 pm

ektoric
Support Team
 
Posts: 470
Joined: Wed Jan 02, 2008 3:46 pm
Location: Austin, TX

Re: How to boot from SD

Postby cwickert » Wed May 20, 2009 8:35 am

cwickert
 
Posts: 7
Joined: Sat May 16, 2009 11:19 am

Re: How to boot from SD

Postby miltonhork » Tue Oct 27, 2009 8:35 am

U-boots load kernel into memory.As the kernel boots, it initializes the hardware and then mounts the root filesystem. The kernel then runs "/sbin/init", which handles the rest of the boot-up sequence.
miltonhork
 
Posts: 3
Joined: Thu Oct 15, 2009 8:39 am


Return to Hardware

Who is online

Users browsing this forum: No registered users and 2 guests