UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
7,484 Views
Registered: ‎10-27-2011

adding Programs to BusyBox

Jump to solution

People of the world, i have a question.

 

 

I run linux-xlnx which is BusyBox on a ZedBoard.

It boots and runs quite well.

 

Now, i try to install some essential programs like m4 & make.

Therefore, i cross-compiled both programs on my Desktop Linux and put the generated ELFs in ZedBoard's rootfs /usr/bin.

 

The thing is that BusyBox does not find these programs, although /usr/bin is in the $PATH.

> cd /usr/bin
> ls -l | grep m4
-rwxr-xr-x    1 1000     1000        736609 Nov 12 11:52 m4
> ./m4
-/bin/ash: ./m4: not found

But, what works is calling it with ash:

> ash /usr/bin/m4
/usr/bin/m4: line 1: syntax error: unexpected word (expecting ")")

So, it is a correct executable and this is what 'file' confirms, too.

 

What's the problem, here?

Isn't it possible to add programs to BusyBox?

Do i have to rebuilt it, each time i wanna add a program?

 

 

Thanks.

 

 

0 Kudos
1 Solution

Accepted Solutions
Scholar rfs613
Scholar
14,051 Views
Registered: ‎05-28-2013

Re: adding Programs to BusyBox

Jump to solution
There is no need to rebuild busybox. However you cannot run a binary executable as a shell script, that won't work in any case.

The basic idea of cross-compiling and transferring over the executable is correct. However, there are two likely problems:

1) Your may not have cross-compiled even though you think you did. On your Desktop linux machine, use "file" on the generated "m4" to ensure it has been built for ARM, not for i686 or x86_64.

2) If it is an ARM executable, it may be linked against libraries which do not exist on your Zedboard. Note that this could even include the C library, which may be glibc or uclibc (amongst others). This could prevent the binary from running, or even starting up. You can sometimes use "ldd" to help figure this out.

I would suggest compiling a trivial hello-world with your cross-compiler, and transferring that over.

Also be aware that ARM has several models for floating point. The cross-compiler you are using needs to agree with the other code on your Zedboard, and with the capabilities of the CPU.
0 Kudos
2 Replies
Scholar rfs613
Scholar
14,052 Views
Registered: ‎05-28-2013

Re: adding Programs to BusyBox

Jump to solution
There is no need to rebuild busybox. However you cannot run a binary executable as a shell script, that won't work in any case.

The basic idea of cross-compiling and transferring over the executable is correct. However, there are two likely problems:

1) Your may not have cross-compiled even though you think you did. On your Desktop linux machine, use "file" on the generated "m4" to ensure it has been built for ARM, not for i686 or x86_64.

2) If it is an ARM executable, it may be linked against libraries which do not exist on your Zedboard. Note that this could even include the C library, which may be glibc or uclibc (amongst others). This could prevent the binary from running, or even starting up. You can sometimes use "ldd" to help figure this out.

I would suggest compiling a trivial hello-world with your cross-compiler, and transferring that over.

Also be aware that ARM has several models for floating point. The cross-compiler you are using needs to agree with the other code on your Zedboard, and with the capabilities of the CPU.
0 Kudos
Adventurer
Adventurer
7,454 Views
Registered: ‎10-27-2011

Re: adding Programs to BusyBox

Jump to solution

Thanks for your help.

Indeed, i had used different toolchains for BusyBox and m4.

Now, it works.

0 Kudos