Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HOWTO compile FUSE libraries and examples (Not the kernel module)
04-21-2006, 10:20 AM
Post: #1
HOWTO compile FUSE libraries and examples (Not the kernel module)
HowTO compile fuse libraries and examples

The scope of this Howto is to explain how to get the FUSE libraries and examples. THe FUSE libraries are needed to compile any aplication that use FUSE, as djmount.

There is no explanation here of how to compile the fuse kernel module. This needs other crosscompiler enviroment.

First of all we need a cross-compiler enviroment. I am going to explain mine:

I use colinux/colonist to have Linux in my Windows OS. The linux distribution is Knnopix-4.0.2
I have build the crosscompiler environment using the Makefile you can get from here:

http://www.m740.de/forum/showthread.php?...#post49854

This is only needed the first time.

Because colonist makes a virtual ext2 filesystem that is completely used by Knoppix, I use another 2GB virtual flesystem (in a file) that I mount every time I start up Knoppix. This is mounted in /mnt/hd in my case.

I have created a small script that set all variables needed for compilation. You can see it in here:
Code:
root@tty1[hd]# cat setenv.sh

rm /usr/local/mips-linux

AR=mips-uclibc-ar
AS=mips-uclibc-as
CC=mips-uclibc-gcc
CPP=mips-uclibc-cpp
CXX=mips-uclibc-g++
LD=mips-uclibc-ld
NM=mips-uclibc-nm
OBJCOPY=mips-uclibc-objcopy
OBJDUMP=mips-uclibc-objdump
RANLIB=mips-uclibc-ranlib
SIZE=mips-uclibc-size
STRINGS=mips-uclibc-strings
STRIP=mips-uclibc-strip

ln -s /mnt/hd/m740 /usr/local/mips-linux
PATH=$PATH:/usr/local/mips-linux/bin

export AR AS CC CPP CXX LD NM OBJCOPY OBJDUMP RANLIB SIZE STRINGS STRIP PATH
I execute it with
Code:
source /mnt/hd/setenv.sh
After that, I have a /usr/local/mips-linux directory that links to my own virtual filesystem. And all libs/includes and applications are installed in there for M740

Now, this is what we need.

You can get FUSE-2.5.3 from here:

http://sourceforge.net/project/showfiles..._id=132802

Download and untar this into any directory you are confortable:
Code:
tar -zxvf fuse-2.5.3.tar.gz

After that, you can compile it directly using the following commands:
Code:
./configure --host=mips-linux --disable-kernel-module --prefix=/usr/local/mips-linux
make
make install
This will compile and install fuse in your /usr/local/mips-linux directory. After that you will can compile any fuse application.

Fuse includes a example/ directory with 4 examples. In order to use them without changing your firmware, you need to link them with -static option. If not, you will need to include libfuse.o into you /usr/local/mips-linux/lib in the box.
For do this, only go to fuse-2.5.3/example and modify Makefile.

Look for the following lines:
Code:
LIBS =
LIBTOOL = $(SHELL) $(top_builddir)/libtool
And modified it such as:
Code:
LIBS = -static
LIBTOOL = $(SHELL) $(top_builddir)/libtool
Write the file, and then from the same directory execute
Code:
make clean
make
This will compile and link the examples including the libfuse library inside the objects.

If you want to test in into the box, copy the hello example to the box. You will need a modified firmware that include fuse.o in /usr/local/mips-linux/modules
You will need to copy too the fusermount application that you can find un fuse-2.5.3/util to the box. This must be located in a place that it is in your PATH variable. If it is not, please, execute
Code:
export PATH=/var/media/USB-HDD-1/bin:$PATH
where /var/media/USB-HDD-1/bin is an example for where to put the fusermount

If this fuse module it is not included in /var/etc/load_modules, you will need to start it manually. To do so:
Code:
insmod fuse
You can check it is started with
Code:
lsmod |grep fuse
and you will get one line.

Then, go to where you have copy the hello example and execute in this way
Code:
mkdir /var/media/USB-HDD-1/fuse
./hello /var/media/USB-HDD-1/fuse
After that, you can go to the mount directory. If you list the directory, you will find a virtual file called hello. If you do
Code:
cat hello
you will get
Code:
Hello World!

When you finish to test, you need to unmount the virtual filesystem. To do this, please get out from the directory and execute
Code:
fusermount -u /var/media/USB-HDD-1/fuse
and finally remove the module
Code:
rmmod fuse

I hope this helps

M740AV -> M750T_EPG + 2.4.6_IO + HD 80GB + osd2tcp + Siesta Util
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  djmount-0.52 HOWTO and binaries phosy 12 23.252 04-26-2006 08:14 PM
Last Post: glotzi

Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | open7x0.org Homepage | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication