Welcome! Log In Create A New Profile

Advanced

uboot not loading/boot/uImage for archlinux

Posted by velo 
uboot not loading/boot/uImage for archlinux
May 19, 2014 03:49PM
I am running davy's uboot to boot from an SD card. It works fine with bodhi's Debian rootfs. When I use an ArchLinux rootfs, it has trouble finding files, even though the files are there when I put the SD card into a separate Linux machine.

Here is what I see in netconsole:
Pogov4> ext2ls mmc 0:1 /

ext2ls mmc 0:1 /
<DIR>       4096 .
<DIR>       4096 ..
<DIR>      16384 lost+found
<SYM>          7 bin
<DIR>          0 boot
<DIR>       4096 dev
<DIR>          0 etc
<DIR>       4096 home
<SYM>          7 lib
<DIR>      98306 mnt
<DIR>       4096 opt
<DIR>       4096 proc
<DIR>       4096 root
<DIR>       4096 run
<SYM>          7 sbin
<DIR>          0 srv
<DIR>       4096 sys
<DIR>          0 tmp
<DIR>          0 usr
<DIR>       4096 var
Pogov4> ext2ls mmc 0:1 /boot          # empty directory?!
ext2ls mmc 0:1 /boot

Any idea why this bootloader cannot find the /boot/uImage file?

Certain directories are fine, but others have no content even though I verified on a separate box that the SD card does have content.

Pogov4> ext2ls mmc 0:1 /root          # this is fine, has content

ext2ls mmc 0:1 /root
<DIR>       4096 .
<DIR>       4096 ..
<DIR>       4096 empty
<DIR>       4096 games
<DIR>       4096 opt
<DIR>       4096 spool
<SYM>         10 mail
<SYM>          6 run
<DIR>       4096 tmp
<DIR>       4096 local
<DIR>       4096 log
<DIR>       4096 lib
<DIR>       4096 cache
<SYM>         11 lock
<DIR>       4096 db
Pogov4> ext2ls mmc 0:1 /usr           # no content?!
ext2ls mmc 0:1 /usr
Pogov4> ext2ls mmc 0:1 /dev           # no content?!
ext2ls mmc 0:1 /dev
<DIR>       4096 .
<DIR>       4096 ..

Pogov4> ext2load mmc 0:1 /boot/uImage # cannot find /boot/uImage?!
ext2load mmc 0:1 /boot/uImage
** No boot file defined **

If I put in an SD card with Debian, then it works fine.

Any ideas? Does anyone have a different ArchLinux rootfs I can try?
Re: uboot not loading/boot/uImage for archlinux
May 19, 2014 05:10PM
Have you tried the latest Arch rootfs ?

Both Debian and Arch have /boot/uImage, so the difference as shown is strange indeed.

Update:

Were both extracted into the same SD card? what fs is the card (ext2/ext3)?

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



Edited 2 time(s). Last edit at 05/19/2014 06:05PM by bodhi.
Re: uboot not loading/boot/uImage for archlinux
May 19, 2014 06:03PM
My workaround is to copy /boot/uImage to /uImage, and have the uboot reference that instead:

setenv mmc_boot 'mw 0x800000 0 1; ext2load mmc 0:1 0x00800000 /uImage; if ext2load mmc 0:1 0x01100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi'
Re: uboot not loading/boot/uImage for archlinux
May 19, 2014 06:09PM
velo,

Pls see my questions updated above.

Copying /boot/uImage to /uImage as a work around is a nice temporary solution! but I'm still wondering why there is a difference.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: uboot not loading/boot/uImage for archlinux
May 19, 2014 06:14PM
HI bodhi,

Yes, I extracted the latest ArchLinuxARM rootfs into the same SD card and both are using ext3. I also made sure that the bootargs are all referencing rootfstype=ext3

The uboot from archlinuxarm.org works fine with the same ArchLinuxARM off a USB stick.

This issue seems unique to booting off an SD card with ArchLinuxARM.
Re: uboot not loading/boot/uImage for archlinux
May 19, 2014 11:08PM
I've just notice this. It does not look like a typical /root directory either. Do these files show up if you look at /root in another Linux box?

ext2ls mmc 0:1 /root
<DIR>       4096 .
<DIR>       4096 ..
<DIR>       4096 empty
<DIR>       4096 games
<DIR>       4096 opt
<DIR>       4096 spool
<SYM>         10 mail
<SYM>          6 run
<DIR>       4096 tmp
<DIR>       4096 local
<DIR>       4096 log
<DIR>       4096 lib
<DIR>       4096 cache
<SYM>         11 lock
<DIR>       4096 db

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: uboot not loading/boot/uImage for archlinux
May 20, 2014 12:57PM
You're right! That is not typical of the /root directory. I'll take a look again tonight and will post an update.
Re: uboot not loading/boot/uImage for archlinux
May 20, 2014 09:34PM
I am looking at the contents of the SD card, and the listing is from the /var directory.

Do you think this has anything to do with mtdparts env setting?

Any other setting that could cause extls or extload to offset?
Re: uboot not loading/boot/uImage for archlinux
May 20, 2014 10:05PM
velo,

If that is the content of the /var directory on SD card, then either the SD card file system itself has problem, or this U-Boot mmc driver has problem. I don't think it has anything to do with mtdparts. OTOH, If that is the content of the /var directory on NAND stock rootfs then it might be the mtdparts problem. You could try to reformat the SD card to Ext3 to see if the problem goes away.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: uboot not loading/boot/uImage for archlinux
May 20, 2014 11:14PM
Based on what you're saying, it seems it might be a problem with the MMC boot driver. I wonder why it loads the Debian rootfs fine, but not ArchLinux.

The card is already formatted as ext3.
Re: uboot not loading/boot/uImage for archlinux
May 20, 2014 11:32PM
bodhi, based on your hint, I reformatted the SD card as ext2 and now it works fine for ArchLinux. ext2ls lists all the directories correctly and I am able to boot to /boot/uImage instead of copying it to /uImage.

When booting with ext2, I made sure all the boot env settings have rootfs=ext2.
And similarly for ext3.

The same card formatted as ext3 for Debian worked fine.

Very odd!
Daven McCalla
Re: uboot not loading/boot/uImage for archlinux
November 28, 2022 03:53PM
I'm seeing a similar problem, where u-boot thinks directories are empty that are not empty. Is this a known issue with a known resolution?

=> ext4ls mmc 0:2
<DIR> 4096 .
<DIR> 4096 ..
<DIR> 16384 lost+found
<DIR> 4096 mnt
<DIR> 0 boot
<DIR> 0 home
<DIR> 4096 tmp
<DIR> 4096 root
<DIR> 4096 dev
<DIR> 0 run
<DIR> 0 sbin
<DIR> 102400 proc
<DIR> 0 bin
<DIR> 0 sys
<DIR> 0 media
<DIR> 0 srv
<DIR> 0 opt
<DIR> 0 var
<DIR> 0 lib
<DIR> 0 usr
<DIR> 0 etc
<DIR> 0 deb
359 uEnv.txt
Re: uboot not loading/boot/uImage for archlinux
November 28, 2022 04:42PM
Daven McCalla,

> I'm seeing a similar problem, where u-boot thinks
> directories are empty that are not empty. Is this
> a known issue with a known resolution?

Yes. It mentioned in the rootfs release thread.

Quote

1. Format a new USB drive with a single Ext3 partition, and label it rootfs. If you are running the latest U-Boot for Kirkwood then you can use Ext4. But be aware that Ext4 file system format needs to be "finalized" before it can be used for booting.

During the time you create the rootfs Debian-5.13.6-kirkwood-tld-1-rootfs-bodhi.tar.bz2, if using Ext4, you must "finalize" the drive (format it using no lazy init option).

mkfs.ext4 -E lazy_itable_init=0


And also after you created the rootfs whether Ext3 or Ext4, it's good to sync it a few times with sync commands to ensure everything is saved before unmount.

sync
sync

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



Edited 2 time(s). Last edit at 11/28/2022 04:44PM by bodhi.
Author:

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: