Jump to content
eskimobob

Anyone playing with EncFS?

Recommended Posts

I want to use a BBB to make myself a custom backup device which will automatically encrypt files and periodically upload to a cloud or remote server via rsync.

 

Sounds reasonable to me but I'm struggling to get EncFS to compile.  I'm cross compiling on xubuntu using the arm-linux-gnueabi toolchain.

 

When I run ./configure, I keep getting "Can't find libfuse.a - add the search path to LDFLAGS" despite having already compiled fuse and created libfuse.a.  I have also tried setting the LDFLAGS to point to the libfuse.a file but it refuses to find it.

 

This is the latest in a long line of stumbling blocks - one of the biggest was getting the boost libraries to compile.

 

Before I spend more hours on it, I thought I'd post here in case one of you will immediately say I am wasting my time.

 

Output of my configure attempt below:

martin@martin-PBLaptop:~/Documents/Technical/BeagleBoneBlack/encfs/encfs-1.7.4$ ./configure --host=arm-linux-gnueabi --with-boost-libdir=/home/martin/Documents/Technical/BeagleBoneBlack/boost/boost_1_54_0/stage/lib
configure: WARNING: if you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-linux-gnueabi-strip... arm-linux-gnueabi-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... arm-unknown-linux-gnueabi
checking for arm-linux-gnueabi-g++... arm-linux-gnueabi-g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether arm-linux-gnueabi-g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of arm-linux-gnueabi-g++... gcc3
checking whether NLS is requested... yes
checking for msgfmt... /usr/bin/msgfmt
checking for gmsgfmt... /usr/bin/msgfmt
checking for xgettext... /usr/bin/xgettext
checking for msgmerge... /usr/bin/msgmerge
checking for arm-linux-gnueabi-gcc... arm-linux-gnueabi-gcc
checking whether we are using the GNU C compiler... yes
checking whether arm-linux-gnueabi-gcc accepts -g... yes
checking for arm-linux-gnueabi-gcc option to accept ISO C89... none needed
checking dependency style of arm-linux-gnueabi-gcc... gcc3
checking for ld used by GCC... /usr/arm-linux-gnueabi/bin/ld
checking if the linker (/usr/arm-linux-gnueabi/bin/ld) is GNU ld... yes
checking for shared library run path origin... done
checking for CFPreferencesCopyAppValue... no
checking for CFLocaleCopyCurrent... no
checking for GNU gettext in libc... yes
checking whether to use NLS... yes
checking where the gettext function comes from... libc
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by arm-linux-gnueabi-gcc... /usr/arm-linux-gnueabi/bin/ld
checking if the linker (/usr/arm-linux-gnueabi/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/arm-linux-gnueabi-nm -B
checking the name lister (/usr/bin/arm-linux-gnueabi-nm - interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/arm-linux-gnueabi/bin/ld option to reload object files... -r
checking for arm-linux-gnueabi-objdump... arm-linux-gnueabi-objdump
checking how to recognize dependent libraries... pass_all
checking for arm-linux-gnueabi-ar... arm-linux-gnueabi-ar
checking for arm-linux-gnueabi-strip... (cached) arm-linux-gnueabi-strip
checking for arm-linux-gnueabi-ranlib... arm-linux-gnueabi-ranlib
checking command to parse /usr/bin/arm-linux-gnueabi-nm -B output from arm-linux-gnueabi-gcc object... ok
checking how to run the C preprocessor... arm-linux-gnueabi-gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if arm-linux-gnueabi-gcc supports -fno-rtti -fno-exceptions... no
checking for arm-linux-gnueabi-gcc option to produce PIC... -fPIC -DPIC
checking if arm-linux-gnueabi-gcc PIC flag -fPIC -DPIC works... yes
checking if arm-linux-gnueabi-gcc static flag -static works... yes
checking if arm-linux-gnueabi-gcc supports -c -o file.o... yes
checking if arm-linux-gnueabi-gcc supports -c -o file.o... (cached) yes
checking whether the arm-linux-gnueabi-gcc linker (/usr/arm-linux-gnueabi/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking how to run the C++ preprocessor... arm-linux-gnueabi-g++ -E
checking for ld used by arm-linux-gnueabi-g++... /usr/arm-linux-gnueabi/bin/ld
checking if the linker (/usr/arm-linux-gnueabi/bin/ld) is GNU ld... yes
checking whether the arm-linux-gnueabi-g++ linker (/usr/arm-linux-gnueabi/bin/ld) supports shared libraries... yes
checking for arm-linux-gnueabi-g++ option to produce PIC... -fPIC -DPIC
checking if arm-linux-gnueabi-g++ PIC flag -fPIC -DPIC works... yes
checking if arm-linux-gnueabi-g++ static flag -static works... yes
checking if arm-linux-gnueabi-g++ supports -c -o file.o... yes
checking if arm-linux-gnueabi-g++ supports -c -o file.o... (cached) yes
checking whether the arm-linux-gnueabi-g++ linker (/usr/arm-linux-gnueabi/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking for cc_r... arm-linux-gnueabi-gcc
checking for boostlib >= 1.34... yes
checking whether the Boost::System library is available... yes
checking for exit in -lboost_system... yes
configure: WARNING: BOOST_CPPFLAGS -I/usr/include
checking whether the Boost::Serialization library is available... yes
checking for exit in -lboost_serialization... yes
checking whether the Boost::Filesystem library is available... yes
checking for exit in -lboost_filesystem... yes
checking fuse.h usability... yes
checking fuse.h presence... yes
checking for fuse.h... yes
checking for fuse_new in -lfuse_ino64... no
checking for fuse_new in -lfuse... no
configure: error: 
	    Can't find libfuse.a - add the search path to LDFLAGS
	    and rerun configure, eg:
	    export LDFLAGS=-L/usr/local/lib 

Share this post


Link to post
Share on other sites

It's probably bad form to reply to my own post :rolleyes: but I've just made a bit of progress so better post to save others wasting time.

 

After inspecting the configure script, it seemed like it was not actually really complaining that it could not find libfuse.a but that it could not find libfuse full stop.  I therefore recompiled fuse so that I create libfuse.so and then tried compiling encfs again specifying LDFLAGS to point to the shared object file and this time it does fine the library.

 

I now get a different error message:



configure: error: cannot run test program while cross compiling

off to investigate that now...

 

EDIT

 

it seems that the configure script does not handle well the testing of tools when cross compiling.  The recommendation was to either create a new configure script (sounds like a big job) or else edit the configure script to remove the specific test that is failing.  Since I know the fuse lib I have made is never than that required, I have simply removed the test.

 

I now get through the entire configure process without problems and can move on to make.

Make started complaining about not having RLog so I have downloaded and built that successfully.

 

Getting lots of compile errors now though so plodding on - too late tonight, will have to resume another night...

Share this post


Link to post
Share on other sites

Ok, I gave up...  well, almost :P

 

Since I was having endless problems getting it to build on Angstrom, I decided instead to try installing a BBB Ubuntu (13.04) image instead.  That was surprisingly easy to do and once booted, I was able to simply do:

 

sudo apt-get install encfs

 

and it worked like a charm - it downloaded the package and all dependencies and installed perfectly.

 

I can now happily attach an external USB hard drive and use encfs to create a transparently encrypted folder - bingo B)

 

Remaining tasks:

1) setup a Samba share so I can access the drive across my network

2) setup a cron job to do a daily rsync of the encrypted folder system to the cloud

 

Longer term I would like to get it working on Angstrom since Angstrom boots significant faster than Ubuntu!

 

As it happens, I have used the ldd command to get a list of the dependent shared libraries so I could in theory copy those across to my Angstrom distribution - the only problem there is that the Ubuntu distribution uses hard float whereas I'm pretty sure the Angstrom image uses soft float...

Share this post


Link to post
Share on other sites

You know, I can not help but wonder if a whole file system is required for this. I mean there has to be another way to encrypt files on Linux ? I really do not know but . . . yeah.

Share this post


Link to post
Share on other sites

You know, I can not help but wonder if a whole file system is required for this. I mean there has to be another way to encrypt files on Linux ? I really do not know but . . . yeah.

 

I can sympathise with what you are saying but having seen it in action, it is very slick.

 

There is in reality only one copy of the files (the encrypted copy) on the disk.  If I try and write a file to the unencrypted mount point, the file system grabs it and encrypts it automatically then saves to disk.  Similarly, when I try and read a file from the unencrypted mount point, the file system intervenes, decrypts the corresponding disk file and makes it available to me.  All this is done transparently and with no noticeable delay  B)

Share this post


Link to post
Share on other sites

So how is it going now ? Did you get it working, or have you moved on to other things for now ? I just did a Samba share last night but for a different purpose( to share my local worpress wp-contents directory to a local Windows machine for theme development)

 

Samba seems to be very much straight forward now compared to the last time I used it. Install a couple of packages, edit the smb.conf file, and issue smbpasswd -a <username>. Bam! done. Of course for windows 7 it seems to me necessary to prefix the share with the computer name you're cocnnecting to when connecting( Because Windows 7 when not on a Domain, automatically adds the computer name as the local domain for the computer - when not using simple file sharing, which really sucks) Either way its something that is fairly trivial and in my own case easy to live with.

Share this post


Link to post
Share on other sites

So how is it going now ? Did you get it working, or have you moved on to other things for now ? I just did a Samba share last night but for a different purpose( to share my local worpress wp-contents directory to a local Windows machine for theme development)

 

Samba seems to be very much straight forward now compared to the last time I used it. Install a couple of packages, edit the smb.conf file, and issue smbpasswd -a <username>. Bam! done. Of course for windows 7 it seems to me necessary to prefix the share with the computer name you're cocnnecting to when connecting( Because Windows 7 when not on a Domain, automatically adds the computer name as the local domain for the computer - when not using simple file sharing, which really sucks) Either way its something that is fairly trivial and in my own case easy to live with.

 

It's working fine on Ubuntu, I am very happy with it :-)  

 

I have been investigating relative costs of the different cloud storage options - since I have just under 250GB of data to store, I know I have to pay or else split the data into endless different accounts - since my aim is for secure backup of commercial data, I am happy to pay once I find a suitable cloud service.  Not all of them support rsync and since I want this to be entirely automatic, that's a requirement.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...