Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

busybox in embedded linux shows "applet not found"

I compiled busybox myself,and I put it in our embedded linux. But I have some questions.

Question 1:When I try to use some command such as gzip,it prints "gzip: applet not found".While I checked the menuconfig of busybox,I make sure that I've selected "gzip".

Question 2:I used to work with VIM,but busybox just provide VI.So I make a link VIM to VI,but when I typed vim and run it,it also show "vim: applet not found".

Anybody can help me with this problem that "applet not found"? Thank you very much.

PS:I'm confused with the "applet" of busybox,what it is? Like "applet" in java?

like image 252
Ezio Avatar asked Sep 27 '13 06:09

Ezio


2 Answers

The answer to questions 1 and 2 is: you must set your PATH variable first or compile busybox with FEATURE_PREFER_APPLETS enabled. You can set the PATH variable with:

$ export PATH=/bin:/sbin:/usr/bin:/usr/sbin

A busybox applet is a small application that is usually found in the UNIX common utilities (defined in the POSIX standard). This applets are compiled into a single executable: busybox.

like image 199
Luis Lavaire. Avatar answered Sep 17 '22 12:09

Luis Lavaire.


[F.Y.I.] Shebang's typo caused me the same applet not found error.

$ # The '!' was forgotten in shebang
$ cat sample.sh
#/bin/sh

echo 'hello world'

$ ./sample.sh
sample.sh: applet not found

In docker-compose, running the above script gives me the blow error:

standard_init_linux.go:211: exec user process caused "exec format error"
like image 24
KEINOS Avatar answered Sep 19 '22 12:09

KEINOS