fakeroot and ostree xattrs



I saw the post by Anton and I thought I should post about what I've been
doing WRT fakeroot and ostree related building.  I was looking for a
fakeroot that I could use in my build-system with ostree.  I ended up
modifying fakeroot to understand the "user.ostreemeta" xattr that ostree
attaches to it objects.

This has the advantage that you can do the equivalent of:

    ostree checkout --user-mode
    fakeroot some modifications ...
    fakeroot ostree commit --link-checkout-speedup

and the checkout and commits are fairly fast because it's just using
hard-links.

It shouldn't suffer from the renameat2 problems that Anton discussed
because it stores the permissions in the xattrs which are attached to
the inode so it's not path specific.  The xattrs approach means that
there is no server process (and no IPC) unlike uptream fakeroot. This
might make it  faster for gnome-continuous use-case too, although speed
wasn't really what I was optimising for.

The code is here: https://github.com/stb-tester/fakeroot/tree/ostree .

I hadn't mentioned it before because it's a little ugly for the time
being.  I've been wanting to tidy it up and submit it to fakeroot
upstream (whoever that is), but haven't made the time to do so just yet.
 It has been working for me though.

Problems with it:

1. The commits need tiding up.  In particular there is a big commit that
has a bunch of unrelated changes in and the commit message "SNAPSHOT". 
I'll need to split this up into some smaller ones and work out which
changes are necessary and which are not.

2. I haven't updated the build system to allow turning on this mode with
a configure switch.  The build is all rather ugly including a `#include
"ostree.c"` in one of the files.  I've just been building it by writing
out the gcc command line.

3. I've added some tests but not integrated them with make check

4. It's implemented in term of xattrs but doesn't support xattrs.  This
isn't a high priority for me at the moment as my stuff apparently
doesn't need xattrs

As you can see it was a bit of a rush/hack-job but I thought I should
mention it because it might be useful to others.  I'll talk about how
I've been using it inside my build-system in another post in the future
if that would interest people.

Thanks

Will


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]