Using StandardizedDevelopmentEnvironment: Difference between revisions

From
Jump to navigation Jump to search
No edit summary
No edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
NOTE: If you want to contribute to the [[BerlinRoofNet|Berlin Roof Net]] project - especially by adding code for OpenWRT - feel free to ask us for a CD with the WRT Standardized Development Environment (in short WRTSDE), which is based on SuSE Linux 9.2 and contains necessary tools and some sources, like OpenWRT and [[ClickModularRouter|Click]].
NOTE: If you want to contribute to the [[BerlinRoofNet|Berlin Roof Net]] project - especially by adding code for OpenWRT - feel free to ask us for a CD with the WRT Standardized Development Environment (in short WRTSDE), which is based on SuSE Linux 9.2 and contains necessary tools and some sources, like OpenWRT and [[ClickModularRouter|Click]].


The next chapter will describe the usage of that WRTSDE, after getting it.
The next chapter describes how to use this WRTSDE, once you got it.


=Unpacking WRTSDE=
=Unpacking WRTSDE=

First you have to create a new empty directory, which will later contain a complete copy of a Linux installation - the WRT standardized development environment.


mkdir mywrtsde
mkdir mywrtsde
tar xzf wrtsde-0.x.tar.gz -C mywrtsde


For executing the next commands successfully you have to become superuser (root).
=Getting ROOT privileges=

su -
su -

Now you can unpack the file wrtsde-0.x.tar.gz (contained on WRTSDE CD).

tar xzf wrtsde-0.x.tar.gz -C mywrtsde

=Modify some settings=

If you need access to the Internet from the WRTSDE, e.g. for downloading files, you have to copy the /etc/resolv.conf file from your host system into the WRTSDE.

cp /etc/resolv.conf mywrtsde/etc/


=Changing to CHROOT environment=
=Changing to CHROOT environment=
If nothing goes wrong you should be able to change into this directory via chroot and compile your first "Hello World!" program for the Linksys WRT54G(S) router.
chroot mywrtsde su - wrt

# Untar your "Hello World!" program from CD-ROM or whereever
$ tar xzf /media/cdrom/hello.tar.gz -C mywrtsde/home/wrt
# Don't work as root! User wrt exists.
$ chroot mywrtsde su - wrt
# set environment
$ . click/env.sh
# cd into hello directory
$ cd hello
# Build the hello binary
$ make
# Make sure the binary is executable on MIPSEL
$ file hello
hello: ELF 32-bit LSB MIPS-II executable, MIPS, version 1 (SYSV), dynamically linked (uses shared libs), not stripped

Latest revision as of 08:30, 8 February 2005

NOTE: If you want to contribute to the Berlin Roof Net project - especially by adding code for OpenWRT - feel free to ask us for a CD with the WRT Standardized Development Environment (in short WRTSDE), which is based on SuSE Linux 9.2 and contains necessary tools and some sources, like OpenWRT and Click.

The next chapter describes how to use this WRTSDE, once you got it.

Unpacking WRTSDE

First you have to create a new empty directory, which will later contain a complete copy of a Linux installation - the WRT standardized development environment.

mkdir mywrtsde

For executing the next commands successfully you have to become superuser (root).

su -

Now you can unpack the file wrtsde-0.x.tar.gz (contained on WRTSDE CD).

tar xzf wrtsde-0.x.tar.gz -C mywrtsde

Modify some settings

If you need access to the Internet from the WRTSDE, e.g. for downloading files, you have to copy the /etc/resolv.conf file from your host system into the WRTSDE.

cp /etc/resolv.conf mywrtsde/etc/

Changing to CHROOT environment

If nothing goes wrong you should be able to change into this directory via chroot and compile your first "Hello World!" program for the Linksys WRT54G(S) router.

# Untar your "Hello World!" program from CD-ROM or whereever
$ tar xzf /media/cdrom/hello.tar.gz -C mywrtsde/home/wrt

# Don't work as root! User wrt exists.
$ chroot mywrtsde su - wrt

# set environment
$ . click/env.sh
 
# cd into hello directory
$ cd hello

# Build the hello binary
$ make

# Make sure the binary is executable on MIPSEL
$ file hello
hello: ELF 32-bit LSB MIPS-II executable, MIPS, version 1 (SYSV), dynamically linked (uses shared libs), not stripped