[ELDK] [eldk 5] [arm] [qemu] init not tainted...

Wolfgang Denk wd at denx.de
Fri Apr 18 23:35:06 CEST 2014


Dear gilles B,

In message <DUB110-W52CC79162AF7595328AC5DC25D0 at phx.gbl> you wrote:
>
> I would like to install a light linux on Qemu ARM VersatilePB.
> I use my Intel Core i3 to cross compile linux kernel 3.11.

It appears you are fighting with several problems in parallel.  This
is usually a bad idea.  I highly recommend to solve issues one at a
time, i. e. when you run into a problem, then fix it, and only go on
to the next steps once you have fixed or at least thoroughly
understood the problem.

> In ARM compilation environment:
> source /opt/eldk-5.5/armv6/environment-setup-armv6-vfp-linux-gnueabi

As you don't mention it here, please keep in mind to unset the LDFLAGS
variable when compiling the Linux kernel - see the FAQ [1].

[1] http://www.denx.de/wiki/view/ELDK-5/FrequentlyAskedQuestionsAndAnswers#Compiling_U_Boot_or_Linux_fails

> I've configured linux 3.11 kernel to use "versatile_defconfig" :
> make versatile_defconfig

OK.

> and I've added EABI option.

I don't understand what you mean here.  CONFIG_AEABI=y is already set
in the versatile_defconfig configuration.

> I can't use make menuconfig because it needs ncurses shared libraries and i don't know how to install them with cross-compilation tools. 

make menuconfig works just fine; the ELDK installs the ncurses
libraries in
/opt/eldk-5.5/armv6t/sysroots/i686-eldk-linux/lib/libncurses*

> So I've edited .config file and modified CONFIG_AEABI to yes: CONFIG_AEABI=y

This makes no sense to me - as mentioned before, this is already set
when you use versatile_defconfig

>  my tiny test, i want to load kernel without root file system, just
> ramdisk (initrd) and just an 'init' programm that displays 'hello' every 
> seconds.

Note 1: a ramdisk / initrd is also a root file system.

Note 2: 'init' is a pretty special program, that has specific
requirements.  Your code is not sufficient.

I don't understand why you try to do such complicated things - why
don't you just use one of the ready-to-use file system images that
come included with the ELDK?

> I tried this : arm-linux-gnueabi-gcc -static -o init hello.c

Static linking is another really bad idea.  Please note that glibc's
static linking support has been deprecated for a long, long time.
Don't do it here, you just open another can of worms.

> Unfortunately my test has became a little bit more complex because I've to
> manage shared libraries by compiling without static option.

No, your test has become unnecessarily complex because you make it
difficult for yourself.  Why don't you just use the existing code?

> Last part, before to test with qemu-system-arm,I created an init ram disk with these files into a tmp directory:
> /dev/ttyAMA0
> /init
> /lib/ld-linux.so.3
> /lib/libc.so.6

This is by far not sufficient for a working root file system.
Again, I recommend to start with a working file system.  Once you have
that running, you can start playing with it and removing things you
think you don't need - but as mentioned before, do it one step at a
time, and don't try to fight in all places simultaneously.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Whenever people agree with me, I always think I must be wrong.
- Oscar Wilde


More information about the eldk mailing list