linux-mips
[Top] [All Lists]

initrd and ramdisk in ELF sections

To: linux-mips@linux-mips.org
Subject: initrd and ramdisk in ELF sections
From: David Goodenough <david.goodenough@linkchoose.co.uk>
Date: Mon, 26 Jun 2006 15:09:34 +0100
Organization: Linkchoose Ltd
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
User-agent: KMail/1.9.1
I have a kernel that I want to load into a Microtik RB500 (and hopefully later
into a RB112) via their network boot facility.  It is a 2.6.17 kernel.

I also want to be able to embed in the kernel a ramdisk image (squashfs)
that can be used as root when I first boot this kernel.  This root image will
be used to initialise the NAND flash which the boards have on them.  The
RB500 does have a Compact Flash socket, so I could do this by intialising
the CF on my laptop, but the RB112 has no such CF socket, and I want to 
get myself ready for that.

I read in a Microtik Wiki entry:-

http://wiki.mikrotik.com/wiki/RB500_Linux_SDK

about using objcopy --add-section, but I am having difficulty making it
work.  I also notice that the script mkvmlinux uses the same technique
but offers both initrd and ramdisk support.  But the Microtik wiki entry
is talking about a 2.4 kernel, which it would appear is different.

For reasons that I do not understand when I tried loading the root image
as an initrd with root=/dev/ram0 as a kernel parm, even though the 
squashfs code had been initialised (according to the system log which I 
am reading through a serial console) the initrd code assumed that the
image was a yaffs image and refused to proceed.  So I wanted (using
the model in mkvmlinux) to use the ramdisk option, as looking at the
code for that it will try looking for a squashfs.  But if I use ramdisk as
the section name in the objcopy it does not find it.

So I went Googling around to see if I could find any guidance, and 
found little or nothing.  So I asked a few people including Alan Cox and
they said that this level of intialisation is very architecture dependant
and that I should ask here.

Can anyone please point me at some documentation, or the right bit
of code, or if they have knowledge of this kind of thing provide me
with some pointers as to what to do.

Thanks in advance

David

<Prev in Thread] Current Thread [Next in Thread>
  • initrd and ramdisk in ELF sections, David Goodenough <=