initramfs questions

I’m trying to build a uImage that uses initramfs for the entire filesystem. The idea being that I can simply copy a single uImage file to an SD card and it will boot, unpack the attach filesystem, and run.
This seems like it ought to be pretty straightforward, as described in the linux docs. I figured it would be simplest to make use of the rootfs that OE builds, so I set up my .config file options to auto-build the initramfs from there. That seems to work, in that making the kernel generates a uImage with the specfied directory structure attached at the end as a cpio archive.

However, when I copy this uImage to a FAT-formatted SD card and try to boot it, I get this:
U-Boot 1.3.3 (Jul 10 2008 - 16:33:09)

OMAP3530-GP rev 2, CPU-OPP2 L3-165MHz
OMAP3 Beagle Board + LPDDR/NAND
DRAM: 128 MB
NAND: 256 MiB
In: serial
Out: serial
Err: serial
Audio Tone on Speakers … complete
Hit any key to stop autoboot: 0
reading uImage

and it hangs there forever. The uImage is 17MB, is that perhaps too big for uboot to read properly?

To simplify things, I made a very stripped-down dir structure, with just busybox and a few devices. The “init” file that is run is a simple shell script which tries to echo some text and then sleep for a long time. Booting this uImage from SD will get past the “reading uImage” stage, and start the kernel, with what looks like normal kernel startup messages (too long to include here). At the end, however, I get:

VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 1
twl4030_rtc twl4030_rtc: setting system clock to 2000-01-01 00:00:00 UTC (946684800)
Freeing init memory: 1860K
Warning: unable to open an initial console.
Failed to execute /init
Kernel panic - not syncing: Attempted to kill init!

Or some variant thereof. I suspect I’m missing some needed devices or perhaps I’m using a non-statically linked version of busybox (although ‘ldd busybox’ says it is not dynamic)

If anyone has gotten initramfs running on the beagleboard, or has general info on how to get it going, I’d appreciate the help.

Thanks,
Brett

I'm trying to build a uImage that uses initramfs for the entire filesystem.
The idea being that I can simply copy a single uImage file to an SD card and
it will boot, unpack the attach filesystem, and run.
This seems like it ought to be pretty straightforward, as described in the
linux docs. I figured it would be simplest to make use of the rootfs that OE
builds, so I set up my .config file options to auto-build the initramfs from
there. That seems to work, in that making the kernel generates a uImage with
the specfied directory structure attached at the end as a cpio archive.

However, when I copy this uImage to a FAT-formatted SD card and try to boot
it, I get this:
U-Boot 1.3.3 (Jul 10 2008 - 16:33:09)

OMAP3530-GP rev 2, CPU-OPP2 L3-165MHz
OMAP3 Beagle Board + LPDDR/NAND
DRAM: 128 MB
NAND: 256 MiB
In: serial
Out: serial
Err: serial
Audio Tone on Speakers ... complete
Hit any key to stop autoboot: 0
reading uImage

and it hangs there forever. The uImage is 17MB, is that perhaps too big for
uboot to read properly?

No idea

To simplify things, I made a very stripped-down dir structure, with just
busybox and a few devices. The "init" file that is run is a simple shell
script which tries to echo some text and then sleep for a long time. Booting
this uImage from SD will get past the "reading uImage" stage, and start the
kernel, with what looks like normal kernel startup messages (too long to
include here). At the end, however, I get:
...
VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 1
twl4030_rtc twl4030_rtc: setting system clock to 2000-01-01 00:00:00 UTC
(946684800)
Freeing init memory: 1860K
Warning: unable to open an initial console.
Failed to execute /init
Kernel panic - not syncing: Attempted to kill init!

Is you init executable?
Do you have a shell in your initrfs
maybe adding
#!/bin/sh
to the top of your init file.

Perhaps replace init with a statically linked hello world program.

Or some variant thereof. I suspect I'm missing some needed devices or
perhaps I'm using a non-statically linked version of busybox (although 'ldd
busybox' says it is not dynamic)

If anyone has gotten initramfs running on the beagleboard, or has general
info on how to get it going, I'd appreciate the help.

There is info in kernel/Documentation on initramfs.

Frans.

Thanks for the suggestions. I have tried a statically linked app with a single printf and a long sleep (so the app didn't exit), and it does not give a kernel panic, but I also never see the printout. I'm wondering if there is something special I need to do to make sure the init process has access to the console/tty device. I will try booting with initrd instead and see if that works any differently.

Brett

Hello Brett,

According to this tutorial (http://free-electrons.com/doc/embedded_lfs/img21.html) it seems that you need /dev/console and /dev/null as a minimum. The tutorial uses an initrd instead of an initramfs, but these two solutions look like different ways of doing the same thing.

Could I ask how long it takes to boot the system using this approach?. Thanks

Hope this may help.

Kind Regards

david

Hi All

I have seen two discussion threads on the beagleboard.org site that discuss the issue of connecting a microphone to a Beagle board. One of these is appended below…

TWL4030 does not seem to have any provision for a mic-in path (as described in its datasheet). Providing the required mic-bias would be an issue if we try to connect the microphone to the line in port. Does anyone in the group have any recommendations on how to go about enabling a microphone with beagle board?

Regards

Puneet

Hi Vineet :

Do you try to use line in from other audio source instead of
microphone. There should be no microphone bias voltage connected to
the audio in connector. I also try the same thing as you did with line
in instead of microphone. It only work on the the aplay and arecord
only record noise. Anybody know the reason?

Regards,

David

- Hide quoted text -

You definitely will need some /dev entries to get initramfs running.

Booting using initramfs is unlikely to go faster. Rationale: at some
point in time the initramfs image needs to be loaded (either as part
of the kernel load, if initramfs is embedded in the kernel or by your
boot loader, if you use initrd= ).
Typically you load more than what you need during startup and
generally you do not recover the additional load time during startup.
Example: suppose you use dynamic linking and need glibc. Then in your
initramfs you'll have to stuff the complete glibc, which then needs to
be read from nand, uncompressed and copied to the buffer cache). If
you do not use initramfs, then the applications only load those pages
from glibc as they are needed, which generally results in a lot less I/
O traffic.

Of course your mileage will vary depending on
- static vs dynamic linking
- which fs your rfs is on
- the kind of application(s) and their memory usage
and probably several other factors.

If you want to boot fast, have a look at axfs.

Frans.

Hi All

I have seen two discussion threads on the beagleboard.org site that
discuss the issue of connecting a microphone to a Beagle board. One of
these is appended below...

TWL4030 does not seem to have any provision for a mic-in path (as
described in its datasheet). Providing the required mic-bias would be an
issue if we try to connect the microphone to the line in port. Does
anyone in the group have any recommendations on how to go about enabling
a microphone with beagle board?

There is provisions for that but that input is not brought out on the Beagle
board. You will need an amplifier to bring the mic signals up to line level.
A simple op-amp (i.e. 741) or even a single transistor will suffice.
Depending on what kind of mic you have, you may need to DC bias it to power
the internal JFET amp.

Here is a page that describes a simple amp -

http://www.tkk.fi/Misc/Electronics/circuits/micamp.html

This uses a simple BJT design; it'll probally even work with the common 2N2222
type NPN's.

Puneeth why are you hijacking this thread ???

Hi Frans

I have updated the subject line. My apologies for the oversight.

Regards
Puneet

Hi Yau

Thanks for your input and feedback. I will try this out.

BTW, are there any plans for the Rev C Beagle board to have mic in to be
brought out on the Beagle board?

Regards
Puneet

Hi All

I have seen two discussion threads on the beagleboard.org site that
discuss the issue of connecting a microphone to a Beagle board. One of

these is appended below...

TWL4030 does not seem to have any provision for a mic-in path (as
described in its datasheet). Providing the required mic-bias would be
an issue if we try to connect the microphone to the line in port. Does

anyone in the group have any recommendations on how to go about
enabling a microphone with beagle board?

There is provisions for that but that input is not brought out on the
Beagle board. You will need an amplifier to bring the mic signals up to
line level.
A simple op-amp (i.e. 741) or even a single transistor will suffice.
Depending on what kind of mic you have, you may need to DC bias it to
power the internal JFET amp.

Here is a page that describes a simple amp -

http://www.tkk.fi/Misc/Electronics/circuits/micamp.html

This uses a simple BJT design; it'll probally even work with the common
2N2222 type NPN's.

Regards

Puneet

Hi Vineet :

Do you try to use line in from other audio source instead of
microphone. There should be no microphone bias voltage connected to
the audio in connector. I also try the same thing as you did with line

in instead of microphone. It only work on the the aplay and arecord
only record noise. Anybody know the reason?

Regards,

David

On Oct 10, 11:51 am, "Vineet Priyank" <vineetpriy...
<http://groups.google.com/groups/unlock?_done=/group/beagleboard/brows
e_
thread/thread/793323a6e4c939f8/93d1a3d5b37d6202%3Flnk%3Dgst%26q%3Dmicr
op hone&msg=5584e12b152c098b> @tataelxsi.co.in>
wrote:

<http://groups.google.com/group/beagleboard/browse_thread/thread/79332
3a 6e4c939f8/?hide_quotes=no#msg_5584e12b152c098b>

- Hide quoted text -
<http://groups.google.com/group/beagleboard/browse_thread/thread/79332
3a 6e4c939f8/?hide_quotes=no#msg_5584e12b152c098b>

- Show quoted text -
<http://groups.google.com/group/beagleboard/browse_thread/thread/79332
3a 6e4c939f8/?hide_quotes=no#msg_5584e12b152c098b>

> Hi,
>
> I am using Rev B5 Beagle Board. I am trying Audio Playback on Beagle

board.arecord -t wav -c 2 -r 44100 -f S16_LE -v k is diplaying on the
console according to the Beagle test diagonistics.

> But while playing Audio output is not coming out. However aplay is

playing pcm data which I took from ALSA FS.

> Beagle board is not capturing audio from microphone. What may be the

fix?

> Regards,
> Vineet
>
> This message (including any attachment) is confidential and may be

legally privileged. Access to this message by anyone other than the
intended recipient(s) listed above is unauthorized. If you are not
the intended recipient you are hereby notified that any disclosure,
copying, or distribution of the message, or any action taken or
omission of action by you in reliance upon it, is prohibited and may

be unlawful.

No, you should start your own thread, not piggyback on a different
thread and change the subject.
This thread is about initramfs questions!

Frans.