Skip to content

Instantly share code, notes, and snippets.

@BHSPitMonkey BHSPitMonkey/ Secret
Last active Dec 13, 2015

What would you like to do?


An entry for the c4l13 Fedora Hackfest by Stephen Eisenhauer


FedoraFS is a filesystem driver built using FUSE which allows a user to mount a Fedora repository to a directory on their local machine. Essentially, this allows the user to browse and interact with the contents of the repository using cd, ls, cat, mkdir, et. al, in a familiar and painless way.

The interactions are accomplished by the driver via use of the Fedora REST API (aka Legacy API).

FedoraFS has been developed over the last two days, and sports the following exciting features:

  • NO error handling!
  • NO readable or maintainable code!
  • NO elegant execution flow!
  • LOW efficiency! and
  • LOW stability!

Despite these confidence-inspiring attributes, I still wouldn't recommend pointing this at any Fedora instance that isn't disposable, and I especially don't recommend trying to incorporate this into any kind of actual workflow or automated scripting tasks (at least in its current state).


FedoraFS has only been tested on Ubuntu (12.04+). You'll need Python and python-fuse.

sudo apt-get install libfuse-dev python-pip
sudo pip install python-fuse


You'll want to download the script somewhere, and create an empty directory to use as a mount point. Somewhere within your home directory works great. No sudo necessary.

$ wget
$ mkdir mnt

Now to mount the repository:

$ python mnt

No output means no problems. Let's take a look around:

$ tree mnt    # sudo apt-get install tree, if you don't have it
├── describe
│   └── repositoryVersion
└── objects
    └── all

3 directories, 1 file

Not much here yet, since this is an empty repository. We can see the repository version like so:

$ cat mnt/describe/repositoryVersion

Wonderful. I think it's about time we added an object to our repository, though:

$ mkdir mnt/objects/all/AllYourBase
$ ls mnt/objects/all/AllYourBase/
datastreams  profile.xml

How about that. Let's look at the new object's profile, in all its XML-ey glory:

$ cat mnt/objects/all/AllYourBase/profile.xml 
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fedora-access:objectProfile xmlns:fedora-access="" xmlns:fedora-management="" pid="AllYourBase">

My head's starting to hurt, so we're definitely getting somewhere. Objects are pretty lame if they don't have any datastreams, I think, so let's create one for our new object:

$ mkdir mnt/objects/all/AllYourBase/datastreams/text
$ ls mnt/objects/all/AllYourBase/datastreams/text/
content  profile.xml

Now we're in business. Let's take another high-level look at things now:

$ tree mnt
├── describe
│   └── repositoryVersion
└── objects
    └── all
        └── AllYourBase
            ├── datastreams
            │   └── text
            │       ├── content
            │       └── profile.xml
            └── profile.xml

6 directories, 4 files

Spiffy! Let's put some words into our new datastream called 'text':

$ echo "All your base are belong to us." > mnt/objects/all/AllYourBase/datastreams/text/content
bash: mnt/objects/all/AllYourBase/datastreams/text/content: Function not implemented

... What, did you really expect me to implement ALL the functionality in my spare time around the conference?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.