ext2 support (need it for SD card)?

Post Reply
Chris
Posts: 7
Joined: Tue Oct 06, 2009 2:01 pm

ext2 support (need it for SD card)?

Post by Chris » Mon Dec 07, 2009 4:54 pm

Hi All,

My board was supposed to have ext2 support and for my app I need that on the SD card. The FAT will only mount as root:root and that will simply not work for my application. As the board comes ext2 formatted cards are not recognized. Would probably have the same problem with ext2/3 on a USB drive as well I suspect but what I need is the SD card.

I looked around and found nothing :-( and tried all sorts of links purporting to be able to build a new kernel and not one of them worked for me.

I looked at the software update topic but that doesn't seem to cover it.

Kind of out of ideas. Any suggestions or pointers MUCH appreciated.

Hope this makes some sense, googled until I am blind :-).

Thanks! Chris.

Steve
Posts: 5
Joined: Sun Sep 06, 2009 6:52 pm

Re: ext2 support (need it for SD card)?

Post by Steve » Mon Dec 07, 2009 8:40 pm

I've built a new kernel on my Gentoo Linux box with ext3 support following the instructions in the Gentoo Embedded Handbook. If you have a working cross-compiler, the instructions should be equally valid on any Linux distribution.

In summary:
  • Extract the kernel source code from the CD (I tried using the kernel from Venting Machine but had some problems)
  • Create the "xkmake" script similar to the one from the Embedded Handbook. I would use:

    Code: Select all

    #!/bin/sh
    exec make ARCH="arm" CROSS_COMPILE="armv4tl-softloat-linux-gnueabi-" INSTALL_MOD_PATH="${SYSROOT}" "$@"
  • xkmake mini2440_defconfig (loads the default configuration)
  • xkmake menu_config (to add ext3 support)
  • xkmake (to do the actual compile)

Chris
Posts: 7
Joined: Tue Oct 06, 2009 2:01 pm

Re: ext2 support (need it for SD card)?

Post by Chris » Mon Dec 07, 2009 9:44 pm

Thanks for the pointers Steve!

I forgot to mention I have the FriendlyARM mini2440, assuming that makes a difference.

I got the compiler that came on the CD working but not sure that is going to work for a kernel, although it seems like it should.

I've been through so much of this that I am a bit confused and somewhat overwhelmed, hopefully your pointers will help alleviate that :-).

Will give it a go, probably tomorrow.

MUCH appreciated!

Chris
Posts: 7
Joined: Tue Oct 06, 2009 2:01 pm

Re: ext2 support (need it for SD card)?

Post by Chris » Tue Dec 08, 2009 9:30 pm

Well, sigh, to no avail.

I got the kernel source from: http://www.friendlyarm.net/downloads

Linux 2.6.29 (2009-07-08) 71 MB

Unpacked that and set the symbolic link to it (/usr/src/linux).

copied the config_mini2440_n35 to .config and ran ./xkmake xconfig and added ext2 and ext3 and saved and exited.

Ran: ./xkmake mini2440_defconfig

Got:

nimitz:/usr/src/linux# ./xkmake mini2440_defconfig
***
*** Can't find default configuration "arch/arm/configs/mini2440_defconfig"!
***
make[1]: *** [mini2440_defconfig] Error 1
make: *** [mini2440_defconfig] Error 2

No idea what is going on here, this one makes me 0/6 for ways to build a kernel for this. I assume that the source from FriendlyARM is what the kernel I am running was built from, but apparently not.

/perplexed.

Chris
Posts: 7
Joined: Tue Oct 06, 2009 2:01 pm

Re: ext2 support (need it for SD card)?

Post by Chris » Tue Dec 08, 2009 9:56 pm

Found I did have the source for the kernel on the CD the board came with.

Same results.

Starting to wonder if I do have a cross compiler as I tried this to see what would happen:

./xkmake
make: armv4tl-softloat-linux-gnueabi-gcc: Command not found
scripts/kconfig/conf -s arch/arm/Kconfig
*
* Restart config...
[ ... ]

Off to google some more.

Steve
Posts: 5
Joined: Sun Sep 06, 2009 6:52 pm

Re: ext2 support (need it for SD card)?

Post by Steve » Wed Dec 09, 2009 6:29 pm

How have you installed your cross compiler? The name of the gcc command is likely to be different (ie it may not be armv4tl-softloat-linux-gnueabi-gcc). You'll need to update your xkmake script accordingly.

If you can't get it to work I can compile a kernel for you. Just let me know what options you require - is it just the defaults + ext2?

Chris
Posts: 7
Joined: Tue Oct 06, 2009 2:01 pm

Re: ext2 support (need it for SD card)?

Post by Chris » Wed Dec 09, 2009 10:57 pm

Steve wrote:How have you installed your cross compiler? The name of the gcc command is likely to be different (ie it may not be armv4tl-softloat-linux-gnueabi-gcc). You'll need to update your xkmake script accordingly.

If you can't get it to work I can compile a kernel for you. Just let me know what options you require - is it just the defaults + ext2?
Hello and Thanks Steve!

Very much appreciate your offer and I may have to take you up on it, but I would prefer to get things working here. I don' want to have to pester someone every time I make a change and need something new in the kernel.

Slowly I am getting things figured out. I had the cross compiler that came on the CD with the FriendlyARM installed and working for the examples. That is the compiler I wanted (export PATH=$PATH:/usr/local/arm/4.3.2/bin/) .

I moved the kernel source that came on the CD into the arm project directory and changed the xkmake to match:

Code: Select all

#!/bin/sh
exec make ARCH="arm" CROSS_COMPILE="arm-none-linux-gnueabi-" INSTALL_MOD_PATH="${SYSROOT}" "$@"
{~/projects/arm/linux-2.6.29} $ cat xkmake

Same problem as before: *** Can't find default configuration "arch/arm/configs/mini2440_defconfig"!

And it isn't there :-(.

I googled and didn't get much back that made sense to me :-(. It seems that everything just assumes it is there???

Anyone know where I might find that file?

I am wondering if the "config_mini2440_n35" is that file that just needs to be copied and renamed into arch/arm/configs. From what I do know about building kernels, it appears to be what would normally come out of make menuconfig into .config.

It come with a bunch of those, I am pretty sure the _n35 is the one I want:

Code: Select all

{~/projects/arm/linux-2.6.29} $ ls config_*
config_mini2440_a70  config_mini2440_n35  config_mini2440_vga1024x768  config_qq2440_n35
config_mini2440_l8   config_mini2440_t35  config_qq2440_a70                   config_qq2440_vga1024x768
Any ideas appreciated!

Thanks very much!

Chris
Posts: 7
Joined: Tue Oct 06, 2009 2:01 pm

Re: ext2 support (need it for SD card)?

Post by Chris » Thu Dec 10, 2009 12:31 am

Disregard Previous ?!?

It appears that this may have been massively simpler than I have been persuing.

I copied over the appropriate(?) config_ to .config and ran menuconfig adding ext2/3 and ran xkmake on it and I seem to have ended up with a kernel!

Code: Select all

[ ... ]
OBJCOPY arch/arm/boot/zImage
  Kernel: arch/arm/boot/zImage is ready
[ ... ]
produces a kernel that is 0.2M larger than the one supplied:

Code: Select all

-rwxr-xr-x 1 vw vw 2.1M 2009-12-09 23:08 arch/arm/boot/zImage
Will save off the existing kernel and load that tomorrow to see what happens.

Only question is that it seems to have built a couple modules:

Code: Select all

[ ... ]
  Building modules, stage 2.
  MODPOST 2 modules
  CC      drivers/char/mini2440_hello_module.mod.o
  LD [M]  drivers/char/mini2440_hello_module.ko
  CC      drivers/scsi/scsi_wait_scan.mod.o
  LD [M]  drivers/scsi/scsi_wait_scan.ko
[vw@nimitz] Wed Dec 09 23:08:19 [293]
Which I do not recall seeing on the device, but will check again to be sure.

Hopefully progress!

Chris
Posts: 7
Joined: Tue Oct 06, 2009 2:01 pm

Re: ext2 support (need it for SD card)?

Post by Chris » Fri Jan 01, 2010 8:16 pm

Update:

Apparently not :-(.

I can generate the kernel but it appears that linux in general knows nothing about a yffs filesystem.

I can generate the kernel but it won't read the yffs filesystem.

Sigh. I suppose I need to figure out how to generate a root filesystem in jffs2 and get it loaded into nand.

Also looking like I have a bad block in the bad block table, so I am not sure what is going on, perhaps an old version of u-boot that I have...

Onward....

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests