Author Topic: custom initrd  (Read 5359 times)

fRE

  • Newbie
  • *
  • Posts: 8
    • View Profile
custom initrd
« 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.

Stubear

  • Hero Member
  • *****
  • Posts: 1164
    • View Profile
    • http://
custom initrd
« Reply #1 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
SL-C1000, Hand converted to English with Japanese Input
Running X apps via X/Qt
iRiver USB host cable; Diatec P-Cord usb power cable (extendable); Acro's Reel Cable USB (A to A, B, Mini-B,  & Mini-B 8pin); GreenHouse 1Gb PicoDrive+; 2x256Mb Hagiwara SD cards; 128Mb Transcend CF card; 512Mb PQI CF card; AmbiCom WL1100C-CF 11B WLAN card

fRE

  • Newbie
  • *
  • Posts: 8
    • View Profile
custom initrd
« Reply #2 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
« Last Edit: July 13, 2004, 03:38:20 am by fRE »

fRE

  • Newbie
  • *
  • Posts: 8
    • View Profile
custom initrd
« Reply #3 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..

Mickeyl

  • Hero Member
  • *****
  • Posts: 1495
    • View Profile
    • http://www.Vanille.de
custom initrd
« Reply #4 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 ?
Cheers,

Michael 'Mickey' Lauer | Embedded Linux Freelancer | www.Vanille-Media.de
Consider donating, if you like the software I contribute to.

fRE

  • Newbie
  • *
  • Posts: 8
    • View Profile
custom initrd
« Reply #5 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

Mickeyl

  • Hero Member
  • *****
  • Posts: 1495
    • View Profile
    • http://www.Vanille.de
custom initrd
« Reply #6 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*...
« Last Edit: July 15, 2004, 09:18:40 am by Mickeyl »
Cheers,

Michael 'Mickey' Lauer | Embedded Linux Freelancer | www.Vanille-Media.de
Consider donating, if you like the software I contribute to.

fRE

  • Newbie
  • *
  • Posts: 8
    • View Profile
custom initrd
« Reply #7 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/ to learn something about OE


Thanks for Advice

Stubear

  • Hero Member
  • *****
  • Posts: 1164
    • View Profile
    • http://
custom initrd
« Reply #8 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
SL-C1000, Hand converted to English with Japanese Input
Running X apps via X/Qt
iRiver USB host cable; Diatec P-Cord usb power cable (extendable); Acro's Reel Cable USB (A to A, B, Mini-B,  & Mini-B 8pin); GreenHouse 1Gb PicoDrive+; 2x256Mb Hagiwara SD cards; 128Mb Transcend CF card; 512Mb PQI CF card; AmbiCom WL1100C-CF 11B WLAN card

Mickeyl

  • Hero Member
  • *****
  • Posts: 1495
    • View Profile
    • http://www.Vanille.de
custom initrd
« Reply #9 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)
Cheers,

Michael 'Mickey' Lauer | Embedded Linux Freelancer | www.Vanille-Media.de
Consider donating, if you like the software I contribute to.

zenyatta

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
    • http://
custom initrd
« Reply #10 on: July 15, 2004, 03:29:18 pm »
Stubear: simply rename *.rootfs.jffs2 to initrd.bin.
SL-5500, 256MB Kingston CF card, 128MB EDGE SD card, Thomson HED-155 headphones
OpenZaurus 3.5.3 / Opie (kernel 64-0)

zenyatta

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
    • http://
custom initrd
« Reply #11 on: July 15, 2004, 03:29:30 pm »
Stubear: simply rename *.rootfs.jffs2 to initrd.bin.

z. (sorry about the double post)
« Last Edit: July 15, 2004, 03:30:34 pm by zenyatta »
SL-5500, 256MB Kingston CF card, 128MB EDGE SD card, Thomson HED-155 headphones
OpenZaurus 3.5.3 / Opie (kernel 64-0)

Stubear

  • Hero Member
  • *****
  • Posts: 1164
    • View Profile
    • http://
custom initrd
« Reply #12 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.
SL-C1000, Hand converted to English with Japanese Input
Running X apps via X/Qt
iRiver USB host cable; Diatec P-Cord usb power cable (extendable); Acro's Reel Cable USB (A to A, B, Mini-B,  & Mini-B 8pin); GreenHouse 1Gb PicoDrive+; 2x256Mb Hagiwara SD cards; 128Mb Transcend CF card; 512Mb PQI CF card; AmbiCom WL1100C-CF 11B WLAN card

Stubear

  • Hero Member
  • *****
  • Posts: 1164
    • View Profile
    • http://
custom initrd
« Reply #13 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
SL-C1000, Hand converted to English with Japanese Input
Running X apps via X/Qt
iRiver USB host cable; Diatec P-Cord usb power cable (extendable); Acro's Reel Cable USB (A to A, B, Mini-B,  & Mini-B 8pin); GreenHouse 1Gb PicoDrive+; 2x256Mb Hagiwara SD cards; 128Mb Transcend CF card; 512Mb PQI CF card; AmbiCom WL1100C-CF 11B WLAN card

Mickeyl

  • Hero Member
  • *****
  • Posts: 1495
    • View Profile
    • http://www.Vanille.de
custom initrd
« Reply #14 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.
Cheers,

Michael 'Mickey' Lauer | Embedded Linux Freelancer | www.Vanille-Media.de
Consider donating, if you like the software I contribute to.