DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2007-07-26 00:02:24

cyboc
Member
From: Vancouver, BC, Canada
Registered: 2007-07-14
Posts: 27
Website

How to Compile Joe's Own Editor (joe)

Hi,

I just cross compiled Joe's Own Editor (joe) and I thought I would share the "how to" here in case it could help someone else. You could use this procedure to build joe or you could adapt it to build other apps.

Step 1: Build the cross compiler

Setup the cross compiler environment and build the cross compiler tool chain using the instructions in the wiki. Follow them closely. When you get to the step "fix all broken links", see Fonz's easy instructions for fixing them.

Step 2: Get the joe Source

Normally, you get the source code from joe's website but the Download Source link just seems to return a file with 0 bytes. So, I got the joe source code from Debian instead. That should give you a file called joe_3.5.orig.tar.gz. There is a patch available from Debian but I didn't bother applying it (I'll leave that as an exercise to the reader).

Put the source tarball in GPL/zips, just like the other source tarballs you got from D-Link.

Step 3: Extract the source

From the GPL folder, extract the source from the tarball:

Code:

tar xzf zips/joe_3.5.orig.tar.gz

Step 4: Create build script

Using the other build scripts in the GPL folder as a sample, I created the following simple build script called build_joe and put it in the GPL folder just like the other build scripts:

Code:

#!/bin/bash
#
source setpath
export CC=arm-linux-gcc
export GCC=arm-linux-gcc

cd joe-3.5
./configure --host=arm-linux-uclibc
make clean
make

Don't forget the "--host=arm-linux-uclibc" after ./configure. Without that, you'll get an error like "configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'".

Step 5: Build Joe

From GPL folder run ./build_joe

It will take a few minutes. If you get no errors, you should get the binary GPL/joe-3.5/joe

For fun, you can see that it has been cross compiled for the DNS-323 by running this command against the joe binary : file joe. The output should look like this:

Code:

joe: ELF 32-bit LSB executable, ARM, version 1 (ARM), dynamically linked (uses shared libs), not stripped

The key is the "ARM". If you did not cross compile, it would say something like "Intel 80386" instead of "ARM" (assuming you are running this on a PC).

Step 6: Copy File to DNS and Run It

This part is easy. Just use samba share or FTP to upload the joe binary to your DNS. Then run it with ./joe or joe (if folder is on your path).

Enjoy! I hope this helps.


"If you feel yourself irreplaceable, put a finger in a glass of water. If you leave a hole when you take it out, you truly are irreplaceable."

Offline

 

#2 2007-07-29 18:29:22

transstilben
Member
From: Germany
Registered: 2007-06-15
Posts: 45
Website

Re: How to Compile Joe's Own Editor (joe)

Hi cyboc,

for those people who still haven't a cross compile environment, and who want to edit something on the DNS-box it would be nice if they could get the binary of JOE  somewhere.
Maybe FONZ can integrate JOE into his fun_plug distribution ? Does'nt this makes sense ?
By the way: Where is the compile environment which runs on the DNS-323 natively ? smile
However: Thank you for JOE !


DNS-323 FW1.03, 500GB-Samsung HD, 4-port USB-Hub, Clients: Vista Home Basic 64 bit, XP-Professional

Offline

 

#3 2007-07-29 19:29:23

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: How to Compile Joe's Own Editor (joe)

joe installs additional files, like config, syntax, language and a few more. Especially I noticed a "jmacs" link and a jmacs rc file. If these make joe use emacs-like key bindings, I like to see them installed as well. There's another binary, termidx - any idea what that one is for?

Offline

 

#4 2007-07-29 19:37:52

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: How to Compile Joe's Own Editor (joe)

Anyway, I've created and uploaded a package to http://www.inreto.de/dns323/fun-plug/0.3/
Install with funpkg.sh as usual. Attached is the funplug build script I've created from cyboc's post.

Offline

 

#5 2007-07-30 00:39:19

transstilben
Member
From: Germany
Registered: 2007-06-15
Posts: 45
Website

Re: How to Compile Joe's Own Editor (joe)

fonz wrote:

Anyway, I've created and uploaded a package to http://www.inreto.de/dns323/fun-plug/0.3/
Install with funpkg.sh as usual. Attached is the funplug build script I've created from cyboc's post.

Just tested joe on my DNS-box and it works great ! A great thanks to cyboc and fonz.

The day when an email client and a text based internet browser get's build in will be the day when i will have to justify why i'm not selling my vista box and migrating completely onto the DNS-323  wink


DNS-323 FW1.03, 500GB-Samsung HD, 4-port USB-Hub, Clients: Vista Home Basic 64 bit, XP-Professional

Offline

 

#6 2007-07-30 06:06:24

cyboc
Member
From: Vancouver, BC, Canada
Registered: 2007-07-14
Posts: 27
Website

Re: How to Compile Joe's Own Editor (joe)

transstilben wrote:

Just tested joe on my DNS-box and it works great ! A great thanks to cyboc and fonz.

You're welcome!

Hey Fonz, how did you get the binary so small? I think you got it down to about 317 KB. The one I built was almost 1.5 MB! Perhaps I statically linked everything? Did you tweak the configuration?

I've always been fond of Joe because it's easy to use and it's also my first name. :-)


"If you feel yourself irreplaceable, put a finger in a glass of water. If you leave a hole when you take it out, you truly are irreplaceable."

Offline

 

#7 2007-07-30 10:34:12

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: How to Compile Joe's Own Editor (joe)

cyboc wrote:

how did you get the binary so small?

Well, I guess it's a) the CFLAGS:
-march=armv5te  which allows the compiler to chose from a richer set of instructions, resulting in smaller code
-Os                      to optimize for size
and b) I stripped unneeded symbols (arm-linux-uclibc-strip --strip-unneeded), which also saves quite a lot of space.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB