[buildd-tools-devel] Bug#623913: Bug#623913: schroot: Please support read-only bind-mounts

Chris Fester camaronut at gmail.com
Fri Sep 5 16:56:00 UTC 2014


Hi all,

I looked at the source code for schroot, and found that a mount command was
being forked/exec'd for every line in the fstab file.  I was able to get ro
bind mounts working with two entries in the fstab file.  Examples:

/sandboxes/rev3disks/platform   /home/Platform            none    ro,bind
      0       0
/sandboxes/rev3disks/sdk          /home/SDK                 none    ro,bind
        0       0

#The lines below are necessary to change the bind mount to readonly
/home/Platform   /home/Platform            none    remount,ro,bind
0       0
/home/SDK         /home/SDK                 none    remount,ro,bind
0       0

The key was to make sure you specify bind even when doing the remount.
 Stumbled on that while reading the mount man page.

The output of schroot still warns that the dirs are rw, but a check of
/proc/mounts outside of the sandbox confirms they've been properly
remounted ro.

Thanks for all the great work with schroot!  It solves many of my build
problems!

Chris Fester

-- 
Oh, meltdown... It's one of these annoying buzzwords. We prefer to call it
an unrequested fission surplus.
-- Mr. Burns, The Simpsons
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20140905/c2005d39/attachment.html>


More information about the Buildd-tools-devel mailing list