Difference between revisions of "EBC Exercise 27 BusyBox"

From eLinux.org
Jump to: navigation, search
(Updated for 2011, included httpd)
Line 1: Line 1:
[[Category:ECE597]]
+
[[Category:ECE497]]
 
[[Category:BeagleBoard]]
 
[[Category:BeagleBoard]]
  
We'll attack getting BusyBox like we did getting the kernel ([[ECE597 Configuring the Kernel]]) though the paths will be slightly different.  Make sure you have commented out  
+
== Compiling BusyBox ==
 +
 
 +
We'll attack getting BusyBox like we did getting the kernel ([[ECE497 Lab02 Installing The Angstrom Distribution]]) though the paths will be slightly different.  Make sure you have commented out  
 
<pre>
 
<pre>
 
# INHERIT += " rm_work "
 
# INHERIT += " rm_work "
 
</pre>
 
</pre>
in the '''local.conf''' file.  See [[ECE597 Configuring the Kernel]] for details.
+
in the '''local.conf''' file.  See [[ECE497 Lab02 Installing The Angstrom Distribution]] for details.
  
 
Check and see what you already have for previous installations:
 
Check and see what you already have for previous installations:
 
<pre>
 
<pre>
cd ${OETREE}/angstrom-dev/work/beagleboard-angstrom-linux-gnueabi
+
$ source ~/.oe/environment-2008
ls
+
$ time bitbake busybox
 +
$ cd ~/BeagleBoard/oe/build/tmp-angstrom_2008_1/work/beagleboard-angstrom-linux-gnueabi
 +
$ ls
 
</pre>
 
</pre>
Do you see '''BusyBox'''?  I didn't.  Do this to find it:
+
My bitbake took about 3 minutes to download and compile.
 +
 
 +
When you did ''ls'' did you see '''BusyBox'''?  I didn't.  Do this to find it:
 
<pre>
 
<pre>
cd ${OETREE}/angstrom-dev/work
+
$ cd ~/BeagleBoard/oe/build/tmp-angstrom_2008_1/work
find . -name "*busybox*"
+
$ find . -name "*busybox*"
 
</pre>
 
</pre>
The <code>find</code> command will find all files and directories that contain the name <code>busybox</code>.
+
The ''find'' command will find all files and directories that contain the name <code>busybox</code>.
BusyBox is not a Beagle specific compile, so it appears in a different location.  Change to the BusyBox directory and look around.  Can you find the source? If not, try
+
BusyBox is not a Beagle specific compile, so it appears in a different location.  Change to the BusyBox directory and look around.  Can you find the source? Hint: they aren't in a git directory.
<pre>
+
 
cd ${OETREE}/openembedded
+
== Configuring BusyBox ==
$ bitbake -c clean busybox
 
$ bitbake -f -c compile busybox
 
</pre>
 
This took just a few minutes on my machine.  Your mileage may vary.  Once done look again for the BusyBox sources.  Hint: they aren't in a git directory.
 
  
 
You can now configure BusyBox.
 
You can now configure BusyBox.
Line 35: Line 37:
 
$ make
 
$ make
 
</pre>
 
</pre>
 +
My make took about 1 minute to compile.
 +
 +
Copy it to your Beagle and test it out.  Just typing '''busybox''' will tell you what commands it knows.  Try some of them.
 +
<pre>
 +
$ busybox
 +
$ busybox ls
 +
</pre>
 +
For extra fun try.
 +
<pre>
 +
$ busybox httpd
 +
</pre>
 +
Yup, you are now running a web server.  Your task is to figure out where to put the web pages it is serving.  If you get something interesting going post your Beagle's address here.
 +
 +
{|style="color:green; background-color:#ccccff;" cellpadding="10" cellspacing="0" border="1"
 +
! URL !! Name !! Notes
 +
|-
 +
| [http://mr814.dhcp.rose-hulman.edu mr814.dhcp.rose-hulman.edu]
 +
| Mark A. Yoder
 +
| My first Beagle web page.
 +
|}
 +
 +
== Shrinking BusyBox ==
 +
 +
How big is the '''busybox''' file?  Try making it smaller by removing commands you don't use.  How big is it if you just have ''ls''? How much bigger is it when you add httpd?  Try your own combinations.  Report your findings to the class.

Revision as of 12:49, 30 March 2011


Compiling BusyBox

We'll attack getting BusyBox like we did getting the kernel (ECE497 Lab02 Installing The Angstrom Distribution) though the paths will be slightly different. Make sure you have commented out

# INHERIT += " rm_work "

in the local.conf file. See ECE497 Lab02 Installing The Angstrom Distribution for details.

Check and see what you already have for previous installations:

$ source ~/.oe/environment-2008
$ time bitbake busybox
$ cd ~/BeagleBoard/oe/build/tmp-angstrom_2008_1/work/beagleboard-angstrom-linux-gnueabi
$ ls

My bitbake took about 3 minutes to download and compile.

When you did ls did you see BusyBox? I didn't. Do this to find it:

$ cd ~/BeagleBoard/oe/build/tmp-angstrom_2008_1/work
$ find . -name "*busybox*"

The find command will find all files and directories that contain the name busybox. BusyBox is not a Beagle specific compile, so it appears in a different location. Change to the BusyBox directory and look around. Can you find the source? Hint: they aren't in a git directory.

Configuring BusyBox

You can now configure BusyBox.

make xconfig

After saving the configuration changes to update the .config file, it is a simple matter of running make.

$ make

My make took about 1 minute to compile.

Copy it to your Beagle and test it out. Just typing busybox will tell you what commands it knows. Try some of them.

$ busybox
$ busybox ls

For extra fun try.

$ busybox httpd

Yup, you are now running a web server. Your task is to figure out where to put the web pages it is serving. If you get something interesting going post your Beagle's address here.

URL Name Notes
mr814.dhcp.rose-hulman.edu Mark A. Yoder My first Beagle web page.

Shrinking BusyBox

How big is the busybox file? Try making it smaller by removing commands you don't use. How big is it if you just have ls? How much bigger is it when you add httpd? Try your own combinations. Report your findings to the class.