OpenWrt Forum Archive

Topic: Mounting Box.com, Google Drive and other WebDAV-accessed clouds

The content of this topic has been archived on 26 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

It is possible to mount WebDAV cloud storages on your router as a simple folder. After then, cloud usage only depends on your imagination. You may, for example:

- download torrents by dropping *.torrent-file on your PC folder,
- sync two clouds,
- backup attached HDD to cloud,
- choose a mounted folder as a multimedia content source for a minidlna/xupnpd or other DLNA-server on router

and so on. Please, feel free to use my Makefiles for davfs2 or Makefiles for wdfs for your platform. Here is a little tested cloud mounting summary:

Cloud Name    Free account     How to mount on router
Yandex.Disk       10Gb                   $ mount -t davfs https://webdav.yandex.ru /tmp/yandex_disk
4shared.com      15Gb                   $ mount -t davfs https://webdav.4shared.com/ /tmp/4shared
Box.com             50Gb (promo)     $ mount -t davfs https://www.box.com/dav /tmp/box.com
Google Drive       5Gb                   Only via DAV-Pocket service: $ mount -t davfs https://dav-pocket.appspot.com/docso /tmp/gdrive/

(Last edited by ryzhov_al on 22 May 2012, 15:43)

I'd additionally recommend setting up the encrypted directory (via encfs) on such cloud based storage.
Otherwise the privacy of your files may be on risk...
Another problem, when using such cloud based storage with davfs is locking.
When mounting from my Linux box I get the following warning:

#mount  -o uid=my_user -t davfs https://webdav.4shared.com/ /tmp/4shared
Please enter the username to authenticate with server
https://webdav.4shared.com/ or hit enter for none.
  Username: my_user@my_mail.com
Please enter the password to authenticate user my_user@my_mail.com with server
https://webdav.4shared.com/ or hit enter for none.
  Password: 
/sbin/mount.davfs: warning: the server does not support locks

So the problem is - how safe are the files when two applications running on two different machines will
try to use the same file at the same time?

Hello, I'm new in this forum. I try to make something similar on Tomato firmware. You think it's possible with your Makefile? Could you explain how to copy Makefile? onto sources of DAVFS2? I try this, but make command don't run. Could you put the ./configure command for davfs with mipsel?

Thanks.

wzab wrote:

#mount  -o uid=my_user -t davfs https://webdav.4shared.com/ /tmp/4shared

I went ahead to get an account from 4Shared and have no problem to mount the space as shown below. However, I can't use it. In other words, when I tried to create a directory, I got an Invalid argument error message as shown below even though I mounted the space with the -o rw option. Any idea why?

[root@Mi:/home/local/PEOPLE/admin/mazilo 91%] # mount -t davfs https://www.4shared.com ~mazilo/4shared -o uid=mazilo -o gid=users -o rw
Please enter the username to authenticate with server
https://www.4shared.com or hit enter for none.
  Username: <my username>
Please enter the password to authenticate user openwrt with server
https://www.4shared.com or hit enter for none.
  Password:  <my password>
/sbin/mount.davfs: warning: the server does not support locks
[root@Mi:/home/local/PEOPLE/admin/mazilo 92%] #
[mazilo@Mi:/opt/openwrt-svn-trunk 207%] ~ ls -la ~/4shared/
total 1
drwxr-xr-x 3 mazilo users 72 Jul  6 09:12 .
drwx------ 2 mazilo users  0 Jul  6 09:12 lost+found
[mazilo@Mi:/opt/openwrt-svn-trunk 208%] ~
[mazilo@Mi:/opt/openwrt-svn-trunk 208%] ~ mkdir ~/4shared/openwrt
mkdir: cannot create directory `/home/local/PEOPLE/admin/mazilo/4shared/openwrt': Invalid argument
[mazilo@Mi:/opt/openwrt-svn-trunk 209%] ~

Is it possible to mount webdav storage as /overlay ? (I mean, install packages on davfs2 remote fs)
This, actually, will be usefull for 4M flash device owners.

Unfortunately, I have no success with your repo and davfs2. My steps :
1.  echo "src-svn rtndev http://wl500g-repo.googlecode.com/svn/feeds/rtndev" >> /opt/trunk/feeds.conf.default
2. ./scripts/feeds update -a && ./scripts/feeds install-a
3. make package/feeds/rtndev/davfs2/compile V=99 2>&1 | tee build.log

I've got:
# cat build.log
^MCollecting package info: package/feeds/rtndev/davfs2^MCollecting package info: merging...^MCollecting package info: done
make[1]: Entering directory `/opt/trunk'
make[2]: Entering directory `/opt/trunk/package/toolchain'
WARNING: skipping libssp -- package not selected
WARNING: skipping libstdcpp -- package not selected
WARNING: skipping libgfortran -- package not selected
WARNING: skipping ldd -- package not selected
WARNING: skipping ldconfig -- package not selected
make[2]: Leaving directory `/opt/trunk/package/toolchain'
make[2]: Entering directory `/opt/trunk/feeds/packages/libs/expat'
make[2]: Leaving directory `/opt/trunk/feeds/packages/libs/expat'
make[2]: Entering directory `/opt/trunk/package/ocf-crypto-headers'
make[2]: Leaving directory `/opt/trunk/package/ocf-crypto-headers'
make[2]: Entering directory `/opt/trunk/package/zlib'
make[2]: Leaving directory `/opt/trunk/package/zlib'
make[2]: Entering directory `/opt/trunk/package/openssl'
WARNING: skipping openssl-util -- package not selected
make[2]: Leaving directory `/opt/trunk/package/openssl'
make[2]: Entering directory `/opt/trunk/feeds/packages/libs/neon'
make[2]: Leaving directory `/opt/trunk/feeds/packages/libs/neon'
make[2]: Entering directory `/opt/trunk/package/fuse'
WARNING: skipping fuse-utils -- package not selected
make[2]: Leaving directory `/opt/trunk/package/fuse'
make[2]: Entering directory `/opt/trunk/feeds/packages/libs/gettext'
WARNING: skipping libintl -- package not selected
make[2]: Leaving directory `/opt/trunk/feeds/packages/libs/gettext'
make[2]: Entering directory `/opt/trunk/feeds/packages/libs/libiconv'
WARNING: skipping libiconv -- package not selected
make[2]: Leaving directory `/opt/trunk/feeds/packages/libs/libiconv'
make[2]: Entering directory `/opt/trunk/feeds/rtndev/davfs2'
. /opt/trunk/include/shell.sh; gzip -dc /opt/trunk/dl/davfs2-1.4.6-03062012.tar.gz | /bin/tar -C /opt/trunk/build_dir/target-i386_uClibc-0.9.33.2/davfs2/.. -xf -
...
...
...
checking for CFPreferencesCopyAppValue... no
checking for CFLocaleCopyCurrent... no
checking whether to use NLS... no
checking for neon library in /opt/trunk/staging_dir/target-i386_uClibc-0.9.33.2/opt... not found
configure: error: could not find neon
make[2]: *** [/opt/trunk/build_dir/target-i386_uClibc-0.9.33.2/davfs2/.configured_] Error 1
make[2]: Leaving directory `/opt/trunk/feeds/rtndev/davfs2'
make[1]: *** [package/feeds/rtndev/davfs2/compile] Error 2
make[1]: Leaving directory `/opt/trunk'
make: *** [package/feeds/rtndev/davfs2/compile] Error 2

(Last edited by manki on 17 Jul 2012, 16:33)

maurer wrote:

just add the new opkg repo to tomato and you'll have the davfs2 package in there wink
http://code.google.com/p/wl500g-repo/wiki/Using

No! My repo is not clear OpenWRT, it's Optware replacement! You can't use my binaries without recompilation.

manki wrote:

Unfortunately, I have no success with your repo and davfs2. My steps :

Please, fix davfs2 Makefile before using it. It uses /opt folder instead of /usr.

(Last edited by ryzhov_al on 23 Jul 2012, 08:28)

I've written a tutorial some time ago regarding davfs2 and encfs http://goo.gl/AHKYS

I fixed neon path to /usr but it didn't help.

make package/feeds/rtndev/davfs2/compile V=99 2>&1 | tee build.log


.
.
.

i486-openwrt-linux-uclibc-gcc -DHAVE_CONFIG_H -I. -I..   -I/opt/src/trunk/staging_dir/target-i386_uClibc-0.9.33.2/usr/include -I/opt/src/trunk/staging_dir/target-i386_uClibc-0.9.33.2/include -I/opt/src/trunk/staging_dir/toolchain-i386_gcc-4.6-linaro_uClibc-0.9.33.2/usr/include -I/opt/src/trunk/staging_dir/toolchain-i386_gcc-4.6-linaro_uClibc-0.9.33.2/include -I/opt/src/trunk/staging_dir/target-i386_uClibc-0.9.33.2/usr/lib/libiconv-stub/include -I/opt/src/trunk/staging_dir/target-i386_uClibc-0.9.33.2/usr/lib/libintl-stub/include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE   -O2 -pipe -march=i486 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -I/opt/src/trunk/staging_dir/target-i386_uClibc-0.9.33.2/usr/lib/libiconv-stub/include -I/opt/src/trunk/staging_dir/target-i386_uClibc-0.9.33.2/usr/lib/libintl-stub/include  -I/opt/src/trunk/staging_dir/target-i386_uClibc-0.9.33.2/usr/include/neon -MT xmalloc.o -MD -MP -MF .deps/xmalloc.Tpo -c -o xmalloc.o xmalloc.c
mv -f .deps/xmalloc.Tpo .deps/xmalloc.Po
rm -f libgnu.a
i486-openwrt-linux-uclibc-ar cru libgnu.a areadlink-with-size.o file-set.o hash-pjw.o hash-triple.o malloca.o openat-die.o xalloc-die.o xstrndup.o argz.o basename.o canonicalize.o chdir-long.o chown.o creat-safer.o dirname.o dup-safer.o exitfail.o fchownat.o fd-safer.o filenamecat.o getcwd.o hash.o open-safer.o openat-proc.o pipe-safer.o same.o save-cwd.o stripslash.o xgetcwd.o xmalloc.o
i486-openwrt-linux-uclibc-ranlib libgnu.a
make[6]: Leaving directory `/opt/src/trunk/build_dir/target-i386_uClibc-0.9.33.2/davfs2-1.4.7/lib'
make[5]: Leaving directory `/opt/src/trunk/build_dir/target-i386_uClibc-0.9.33.2/davfs2-1.4.7/lib'
Making all in src
make[5]: Entering directory `/opt/src/trunk/build_dir/target-i386_uClibc-0.9.33.2/davfs2-1.4.7/src'
i486-openwrt-linux-uclibc-gcc -DPROGRAM_NAME=\"mount.davfs\" -DDAV_SYS_CONF_DIR=\"/etc/davfs2\" -DDAV_SYS_RUN=\"/opt/var/run/mount.davfs\" -DDAV_SYS_CACHE=\"/opt/var/cache/davfs2\" -DDAV_SECRETS=\"secrets\" -DDAV_CONFIG=\"davfs2.conf\" -DDAV_CERTS_DIR=\"certs\" -DDAV_CLICERTS_DIR=\"private\" -DDAV_DATA_DIR=\"/usr/share/davfs2\" -DLOCALEDIR=\"/usr/share/locale\" -DDAV_USER=\"nobody\" -DDAV_GROUP=\"nobody\" -DHAVE_CONFIG_H -I. -I..  -I../lib -I../lib -I/opt/src/trunk/staging_dir/target-i386_uClibc-0.9.33.2/usr/include -I/opt/src/trunk/staging_dir/target-i386_uClibc-0.9.33.2/include -I/opt/src/trunk/staging_dir/toolchain-i386_gcc-4.6-linaro_uClibc-0.9.33.2/usr/include -I/opt/src/trunk/staging_dir/toolchain-i386_gcc-4.6-linaro_uClibc-0.9.33.2/include -I/opt/src/trunk/staging_dir/target-i386_uClibc-0.9.33.2/usr/lib/libiconv-stub/include -I/opt/src/trunk/staging_dir/target-i386_uClibc-0.9.33.2/usr/lib/libintl-stub/include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE  -Wall -O2 -pipe -march=i486 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -I/opt/src/trunk/staging_dir/target-i386_uClibc-0.9.33.2/usr/lib/libiconv-stub/include -I/opt/src/trunk/staging_dir/target-i386_uClibc-0.9.33.2/usr/lib/libintl-stub/include  -I/opt/src/trunk/staging_dir/target-i386_uClibc-0.9.33.2/usr/include/neon -MT cache.o -MD -MP -MF .deps/cache.Tpo -c -o cache.o cache.c
cache.c:58:23: fatal error: sys/xattr.h: No such file or directory
compilation terminated.
make[5]: *** [cache.o] Error 1
make[5]: Leaving directory `/opt/src/trunk/build_dir/target-i386_uClibc-0.9.33.2/davfs2-1.4.7/src'
make[5]: Entering directory `/opt/src/trunk/build_dir/target-i386_uClibc-0.9.33.2/davfs2-1.4.7'
make[5]: Nothing to be done for `all-am'.
make[5]: Leaving directory `/opt/src/trunk/build_dir/target-i386_uClibc-0.9.33.2/davfs2-1.4.7'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/opt/src/trunk/build_dir/target-i386_uClibc-0.9.33.2/davfs2-1.4.7'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/opt/src/trunk/build_dir/target-i386_uClibc-0.9.33.2/davfs2-1.4.7'
make[2]: *** [/opt/src/trunk/build_dir/target-i386_uClibc-0.9.33.2/davfs2-1.4.7/.built] Error 2
make[2]: Leaving directory `/opt/src/trunk/feeds/rtndev/davfs2'
make[1]: *** [package/feeds/rtndev/davfs2/compile] Error 2
make[1]: Leaving directory `/opt/src/trunk'
make: *** [package/feeds/rtndev/davfs2/compile] ?????? 2

Missed file sys/xattr.h :
cache.c:58:23: fatal error: sys/xattr.h: No such file or directory

(Last edited by manki on 9 Aug 2012, 10:42)

it seems this  http://www.gotxi.org/ibon/2012/09/25/mo … n-openwrt/ working on ar71xx too


root@OpenWrt:/opt/sbin# /opt/sbin/mount.davfs https://www.box.com/dav/ /mnt
Please enter the username to authenticate with server
https://www.box.com/dav/ or hit enter for none.
  Username: de@sp.lv
Please enter the password to authenticate user de@sp.lv with server
https://www.box.com/dav/ or hit enter for none.
  Password:
/opt/sbin/mount.davfs: the server certificate is not trusted
  issuer:      GeoTrust, Inc., US
  subject:     Box.net, Inc., Palo Alto, California, US, ts5ja
  identity:    *.box.com
  fingerprint: ca:bd:64:fd:6b:84:5:5d:35:98:2:fe:a6:1c:4e:5:5e:7f:57:5
You only should accept this certificate, if you can
verify the fingerprint! The server might be faked
or there might be a man-in-the-middle-attack.
Accept certificate for this session? [y,N] y
root@OpenWrt:/tmp# df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                    5.1M      2.1M      3.1M  40% /
/dev/root                 2.0M      2.0M         0 100% /rom
tmpfs                    14.3M      1.6M     12.7M  11% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/mtdblock3            5.1M      2.1M      3.1M  40% /overlay
overlayfs:/overlay        5.1M      2.1M      3.1M  40% /
https://www.box.com/dav/
                         25.4G     12.7G     12.7G  50% /mnt

(Last edited by derrij on 5 Oct 2012, 09:35)

derrij wrote:

it seems this  http://www.gotxi.org/ibon/2012/09/25/mo … n-openwrt/ working on ar71xx too

Yes, but this trick works only with trunk.
I can't see any rtn-dev repo package in menuconfig when using backfire branch 8(
Somebody knows how to fix this?

manki wrote:
derrij wrote:

it seems this  http://www.gotxi.org/ibon/2012/09/25/mo … n-openwrt/ working on ar71xx too

Yes, but this trick works only with trunk.
I can't see any rtn-dev repo package in menuconfig when using backfire branch 8(
Somebody knows how to fix this?

rtndev is a feed for my repo only. You have to fix davfs2 Makefile to use it on OpenWRT.

ryzhov_al wrote:

You have to fix davfs2 Makefile to use it on OpenWRT.

Yes, I know. I told that packages from feed rtn-dev visible via "make menuconfig" in trunk, but I can't get the same for backfire branch - all packages from feed rtn-dev unvisible via "make menuconfig".

(Last edited by manki on 31 Oct 2012, 09:57)

manki wrote:

Yes, I know. I told that packages from feed rtn-dev visible via "make menuconfig" in trunk, but I can't get the same for backfire branch - all packages from feed rtn-dev unvisible via "make menuconfig".

You have to fix feeds.conf. Please, refer Buildroot Wiki page for further instructions.

Update: here is original Russian thread.

(Last edited by ryzhov_al on 31 Oct 2012, 11:49)

Hello, I'm new in this forum. I attempt to render anything equivalent upon Tomato firmware. You might think it's possible along with your Makefile? Could you explain exactly how to copy Makefile? on resources of DAVFS2? I try this excellent, however make command don't run. Could you place the ./configure command for davfs with mipsel?

Uddham wrote:

Hello, I'm new in this forum. I attempt to render anything equivalent upon Tomato firmware. You might think it's possible along with your Makefile? Could you explain exactly how to copy Makefile? on resources of DAVFS2? I try this excellent, however make command don't run. Could you place the ./configure command for davfs with mipsel?

Well, despite the fact that it's offtopic:

  • deploy a Tomato toolchain,

  • apply my patches to davfs2 sources,

  • make your own script to configure davfs2.

After then, a sources will be ready to compile, just don't forget about dependencies.

(Last edited by ryzhov_al on 6 Dec 2012, 09:08)

Thanks for sharing, how about its speed, how can I use it with my PCs, by samba? or ftp ? to access those openwrt webdav.

The discussion might have continued from here.