Google Drive FUSE filesystem on Fedora

We are going to build google-drive-ocamlfuse from source, a FUSE (filesystem in userspace) backed by Google Drive written in OCaml by Alessandro Strada. It lets you mount your Google Drive on Linux as a filesystem, a service that Google has yet to make available.

What is OCaml?

OCaml is a general purpose programming language with an emphasis on expressiveness and safety. Developed for more than 20 years at Inria by a group of leading researchers, it has an advanced type system that helps catch your mistakes without getting in your way. It’s used in environments where a single mistake can cost millions and speed matters, is supported by an active community, and has a rich set of libraries and development tools.

Alessandro makes available .deb packages for Ubuntu, and there are details on using OPAM to install for other distributions. OPAM is an OCaml package manager. OPAM is not available in the standard Fedora repositories, and rather than manually installing and configuring yet another package manager, it would seem simpler to just build the three required ocaml packages from source. Below are details on all the Fedora dependencies and commands for building google-drive-ocamlfuse. This has been tested and confirmed working on Fedora 25.

First we need to install gapi-ocaml, a simple, unofficial, OCaml client for Google Services, and also all of the required Fedora dependencies.

# dnf install ocaml ocaml-ocamldoc ocaml-findlib ocaml-cryptokit-devel ocaml-curl-devel ocaml-extlib-devel ocaml-ocamlnet-devel ocaml-xmlm-devel ocaml-yojson-devel
$ git clone https://github.com/astrada/gapi-ocaml.git
$ cd gapi-ocaml
$ ocaml setup.ml -configure
$ ocaml setup.ml -build
# ocaml setup.ml -install

Now we need the ocaml binding for FUSE which enables you to write your own multithreaded, efficient userspace filesystems using the ocaml programming language. We also need a couple more Fedora dependencies.

# dnf install ocaml-camlidl-devel fuse-devel
$ git clone https://github.com/astrada/ocamlfuse.git
$ cd ocamlfuse
$ ocaml setup.ml -configure
$ ocaml setup.ml -build
# ocaml setup.ml -install

Finally we can install google-drive-ocamlfuse, and yet more Fedora dependencies.

# dnf install ocaml-sqlite-devel ocaml-biniou-devel ocaml-easy-format-devel zlib-devel
$ git clone https://github.com/astrada/google-drive-ocamlfuse.git
$ cd google-drive-ocamlfuse
$ ocaml setup.ml -configure
$ ocaml setup.ml -build
# ocaml setup.ml -install

google-drive-ocamlfuse should now be ready to use and authorise against your Google account following the standard authorisation instructions!

Posted in Geekorama.

Steven Hale leads the operation and development of the international Birmingham Solar Oscillations Network (BiSON), a global network of automated robotic solar telescope run by the University of Birmingham in the UK. His research interests are instrumentation and electronics, and high-resolution optical spectroscopy techniques. In his spare time he has many interests including photography and aviation, and has a private helicopter license rated on the Robinson R22 and R44 aircraft.

This is a private blog and in no way represents opinions or endorsements from the University of Birmingham.

4 Comments

  1. Great instructions, many thanks!

    I had to install one more dependency for the final step:

    dnf install zlib-devel

  2. Thanks for your comments, Paul.

    For future reference, it’s common to indicate where commands require a privileged shell by using different command prompts. Typically a % or $ sign indicates a normal shell, and a # sign indicates a privileged shell, as I’ve used in the article.

    I tend not to use sudo and simply run ‘su’ to elevate the whole shell, which is useful especially when running a lot of commands that all require root privileges. Having two shells open, one as a normal user and one as root, I find is better than messing about with sudo – especially on distributions that don’t have security issues by as default allowing sudo for all users.

    Steve.

Leave a Reply

Your email address will not be published. Required fields are marked *