LD_PRELOAD work in progress

Michael Terry michael.terry at canonical.com
Tue Feb 24 21:29:10 UTC 2015


Hello!  So I worked on a proof-of-concept for faking an overlayfs scenario
by doing path-redirection in an LD_PRELOAD library.

I've got working code here: lp:~mterry/+junk/snappy-preload

I've tested a few simple programs like bsdgame's boggle and xterm and they
run fine.  I'm going to try harder things and see what issues I run into.

Here's how I tested:
- Took a deb's contents, copy it all to a temporary directory, uninstall
that package
- Run the binary like:
LD_PRELOAD=/home/mike/Work/code/snappy-preload/trunk/builddir/src/libsnappypreload.so
SNAPPY_PRELOAD=/tmp/xterm /tmp/xterm/usr/bin/xterm

(LD_PRELOAD pointing to the built redirection library, and SNAPPY_PRELOAD
to point at the rootfs for the overlay.)

What's the state of the art for sucking a deb package and its dependencies
into an arbitrary filesystem tree?

There are dpkg hooks and such that would be good to run in such cases, I
imagine.  But I don't know much about getting dpkg to install to arbitrary
locations and forget about the package afterwards.  (You can do it a bit
with dpkg --root, but that situation seems to want all packages to be in
the root, rather than accepting that some deps come from the system.)

I also bet the logic to grab dependencies down to a certain level is
probably out there already, I just don't know where.

-- 
-mt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/snappy-devel/attachments/20150224/e5ef44d7/attachment.html>


More information about the snappy-devel mailing list