OESF Portables Forum

Everything Else => Zaurus Distro Support and Discussion => Distros, Development, and Model Specific Forums => Archived Forums => Angstrom & OpenZaurus => Topic started by: fRE on July 12, 2004, 08:25:35 am

Title: custom initrd
Post by: fRE on July 12, 2004, 08:25:35 am
Hello,

I have BIG problem with my internal flash storage,
so to diagnose what was happen I'm trying to make my custom initrd based on OZ.

I tried to mount oryginal initrd on my workstation, but with no success...
I tried something like this:

Code: [Select]
mount -o loop -t jffs2 initrd.bin tmp
what filesystem has been used on OZ initrd?

I need some little help, (maybe some link to web page with documentation).
My Z is now almost completly dead so I can not make to many experiments on it..

Andrzej.
Title: custom initrd
Post by: Stubear on July 12, 2004, 09:17:39 am
You can't directly mount a jffs2 image with -o loop.

You have to create a mtdblock device and copy the imagfe across to trhat first

Search for "mount mtdblock mtdram jffs2" on this site (or google) and you find a heap of posts on how to do this.

Stu
Title: custom initrd
Post by: fRE on July 13, 2004, 03:36:05 am
Quote
Search for "mount mtdblock mtdram jffs2" on this site (or google)

Thanks!  
I've got it

Code: [Select]
$ mount
(..)
/dev/mtdblock/0 on /home/fred/download/oz/initrd.d type jffs2 (rw)

Bers Regards,
Andrzej Borsuk
Title: custom initrd
Post by: fRE on July 14, 2004, 07:55:16 am
little update...

not everything works correctly for me...

first, I tried to copy files from jffs2 filesystem and found some files unreadable.. eg:
Code: [Select]
tar: initrd.d/etc/terminfo/v/vt100: Nie można stat: Błąd wejścia/wyjścia
in english it's mean "I/O Error" ;-)

I have tried to use jffs2dump on initrd.bin from OZ 3.5.1 and got error messages like this

Code: [Select]
Wrong bitmask  at  0x00e1fffc, 0xffff


second problem,
I tried to create new (smaller than oryginal) filesystem. I just removed /opt/* dir (I plan to move it to CF card)

Code: [Select]
mkfs.jffs2 \
    --eraseblock=0x10000 \
    --pad=0x800000 \
    -r initrd-fred-0.2  \
    -o initrd-fred-0.2.jffs2 \
    -l -f -q  \

everything looks fine, but my Z (sl-5500) won't boot

ah,
one more thing:
my workstation works on Linux-2.6.7
and my Z is SL-5500..
Title: custom initrd
Post by: Mickeyl on July 14, 2004, 02:27:57 pm
Just out of curiosity: Is there a special reason for you to fumble around with prebuilt root filesystems instead of just adding the stuff you want to have to OE ?
Title: custom initrd
Post by: fRE on July 15, 2004, 06:18:00 am
Quote
Just out of curiosity: Is there a special reason for you to fumble around with prebuilt root filesystems instead of just adding the stuff you want to have to OE ?

My SL-5500 is simply dead.... I can flash new initrd, but it must be smaller than oryginal (8MB will flash without errors). I tried to strip down existing filesystem because its look easiest for me..

Maybe it's lack of my knowledge? I have heard something about OE looking here, but it's looking more complicated than simple rebuilding existing filesystem. I suppose it will require full gcc toolchain and bitkeeper?

Best Regards,
Andrzej Borsuk
Title: custom initrd
Post by: Mickeyl on July 15, 2004, 09:18:03 am
Quote
Maybe it's lack of my knowledge? I have heard something about OE looking here, but it's looking more complicated than simple rebuilding existing filesystem. I suppose it will require full gcc toolchain and bitkeeper?
No it doesn't. Too bad, that's what most people seem to think. And then they waste hours by hacking initrd's instead of taking the plunge and trying to learn a new tool. And doing things which may even benefit other people...

I can't do more than recommend. If people want to do it the hard way, *shrug*...
Title: custom initrd
Post by: fRE on July 15, 2004, 10:47:12 am
Quote
trying to learn a new tool. And doing things which may even benefit other people...

ok, w'll try :-)

I'm going into http://openembedded.org/oe_wiki/ (http://openembedded.org/oe_wiki/) to learn something about OE


Thanks for Advice
Title: custom initrd
Post by: Stubear on July 15, 2004, 11:37:35 am
Quote
Quote
Maybe it's lack of my knowledge? I have heard something about OE looking here, but it's looking more complicated than simple rebuilding existing filesystem. I suppose it will require full gcc toolchain and bitkeeper?
No it doesn't. Too bad, that's what most people seem to think. And then they waste hours by hacking initrd's instead of taking the plunge and trying to learn a new tool. And doing things which may even benefit other people...

I can't do more than recommend. If people want to do it the hard way, *shrug*...
That's because it takes even longer to find out how to do anything with OE - the biggest problem with OE is lack of documentation. After setting up OE from the "Getting Started" guide the new user is left completely in the dark on how to configure OE to meet their needs.

I've been trying to get OE to compile qtopia using gcc-2.95 for the standard Sharp Rom, but there is not documentation on the Wiki or in the OE directory on how to do this.

Where is the documentation on how to create an image (intird.bin) from an existing rootfs? I've spent 30 minutes on the wiki and can't find it, the only reference I can find in the OE dirs is the help in oeimage itself which isn't very long.

I'm very keen to use OE but the learning curve is very steep unless you only want to creat OZ or Opie

Stu
Title: custom initrd
Post by: Mickeyl on July 15, 2004, 12:19:18 pm
Quote
I'm very keen to use OE but the learning curve is very steep unless you only want to creat OZ or Opie
And this won't change until those who just learned something new contribute to the documentation.

(I'm absolutely fed up with this community of takers. I can't count the hours of support I give via email and irc and although all people always promise to give back by improving the documentation or sending patches, it just doesn't happen)
Title: custom initrd
Post by: zenyatta on July 15, 2004, 03:29:18 pm
Stubear: simply rename *.rootfs.jffs2 to initrd.bin.
Title: custom initrd
Post by: zenyatta on July 15, 2004, 03:29:30 pm
Stubear: simply rename *.rootfs.jffs2 to initrd.bin.

z. (sorry about the double post)
Title: custom initrd
Post by: Stubear on July 15, 2004, 09:36:21 pm
Quote
Quote
I'm very keen to use OE but the learning curve is very steep unless you only want to creat OZ or Opie
And this won't change until those who just learned something new contribute to the documentation.

(I'm absolutely fed up with this community of takers. I can't count the hours of support I give via email and irc and although all people always promise to give back by improving the documentation or sending patches, it just doesn't happen)
I'm more than willing to post what I have learnt when I have actually learnt anything!

So far I'm able to copmile opie and OZ using standard OE, but compiling anything that uses qtopia with 2.95.x doesn't get past the opie-libs. I've been trying for 3 weeks to work out what the settings for ASSUME_PROVIDED should be if I want to use gcc 2.95.x and prebuilt toolchain and qtopia instead of Opie - why hasven't I posted the answer to the wiki - because I CANT FIND THE ANSWER! I've searched the wiki and the files in OE and PACKAGE and the only mention of it is in the file I need to edit to change it. Don't get me started on  PREFERRED_PROVIDERS.
Title: custom initrd
Post by: Stubear on July 15, 2004, 09:43:41 pm
Quote
Stubear: simply rename *.rootfs.jffs2 to initrd.bin.

z. (sorry about the double post)
I haven't gotten that far yet. Mickeyl suggests in his previous post that using OE to create a initrd for the Sharp Rom is a simple process that is far easier than spending hours hacking an initrd by hand.

I'm yet to find the documentation that will allow me to learn this process - so I ain't got no rootfs.jffs, but the rootfs tarball from the Sharp site and a heap of apps I want to change add to it. At the moment OE doesn't appear to be any better than just copying by hand and using the included scritp from sharp to roll another tarball

Stu
Title: custom initrd
Post by: Mickeyl on July 16, 2004, 07:02:50 am
Quote
I haven't gotten that far yet. Mickeyl suggests in his previous post that using OE to create a initrd for the Sharp Rom is a simple process that is far easier than spending hours hacking an initrd by hand.
No - I didn't suggested that OE is the way to create a root file system for the SharpRom because the original poster said:
Quote
so to diagnose what was happen I'm trying to make my custom initrd based on OZ.
Title: custom initrd
Post by: zenyatta on July 16, 2004, 07:59:12 am
Stubear: I've only flashed OE once and it was about a month ago, so take my advice with a grain of salt, but the trick is to use gcc 2.95.3 only for the kernel and nothing else. This is an excerpt from my conf/local.conf:
Code: [Select]
# Uncomment this if you want to use a prebuilt toolchain.  You will need to
# provide packages for toolchain and additional libraries yourself You will
# definitely need to say:
ASSUME_PROVIDED = "virtual/arm-linux-gcc-2.95"
# to build any of two Linux 2.4 Embedix kernels,
# i.e. openzaurus-sa-2.4.18 and openzaurus-pxa-2.4.18.
# ASSUME_PROVIDED = "virtual/${TARGET_PREFIX}gcc virtual/libc"
I also had problems with oemake failing at opie-libs, and I believe it was when both of those ASSUME_PROVIDED lines were uncommented. So the trick is to uncomment only the first one.

After I had succeeded in flashing OE I expressed ambiguity here at ZUG as to whether a newbie-friendly Howto would make sense or not (fearing actual newbies might flash OE and expect things to actually work). It seems my doubts were foolish indeed. I am re-freshing my OE setup and if I can repeat my success I will definitely post a Howto.

z.
Title: custom initrd
Post by: Stubear on July 16, 2004, 11:04:27 am
Quote
No - I didn't suggested that OE is the way to create a root file system for the SharpRom because the original poster said:
Quote
so to diagnose what was happen I'm trying to make my custom initrd based on OZ.
I apologize - I missed the reference to OZ.

Stu
Title: custom initrd
Post by: Stubear on July 16, 2004, 11:19:35 am
Quote
Stubear: I've only flashed OE once and it was about a month ago, so take my advice with a grain of salt, but the trick is to use gcc 2.95.3 only for the kernel and nothing else.
<snip>
z.
Zenyatta,
thanks for the tip, but the problem is I want to use gcc-2.95.3 for everything to compile apps that are compatible with the Sharp Rom. OZ doesn't meet my needs at the moment - I need a Japanese input system and the CRIM that comes standard with the Sharp Rom (along with the dictionary and translator) make it very easy to find the meaning of Kanji I can draw but don't know the readings/meanings of.

There are a number of apps I'd like to compile/package using OE, but till I get qtopia or opie compiled with 2.95.3 I can't even test them on Z. I've compiled some of them for OZ using gcc 3.4 but they don't work with the standard Sharp ROM (wrong glibc to start)

Guess it's back to cross-compiling everythnig by hand

Stu
Title: custom initrd
Post by: Mickeyl on July 16, 2004, 12:45:15 pm
This may be a good point to make a recommendation here:

If someone would take the plunge and add a 2.95.3 toolchain as well as a glibc 2.2.x to OpenEmbedded, all the SharpROM customizers would benefit - because you could use OpenEmbedded to build SharpROM compatible packages.

I'm not interested and no one of the OE core people is - however we will be glad to assist (via IRC and mailing list) if someone of you would take a shot at it.