Skip to content

Instantly share code, notes, and snippets.

@paradigm
Last active August 29, 2015 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paradigm/10565454 to your computer and use it in GitHub Desktop.
Save paradigm/10565454 to your computer and use it in GitHub Desktop.
bedrock linux flopsie experimental shared subtree for /mnt and /media instructions
Purpose:
In Bedrock Linux, as of flopsie, mounts in one client do not appear in others.
This is particularly annoying for things like usb drives which are mounted by a
mount command in one client, but then cannot have their contents used by
programs from other clients.
Solution:
Linux supports the ability to automatically propogate mount points in mount
trees when set up properly. Utilize that.
Hacky solution for flopsie:
1. Note: This requires testing/experimentation. Could go horribly wrong.
2. Ensure /mnt and /media exist as directories in the core.
mkdir -p /bedrock/clients/bedrock/mnt
mkdir -p /bedrock/clients/bedrock/media
3. Open up /bedrock/clients/bedrock/etc/fstab and add the following:
/mnt /mnt bind defaults,bind 0 0
/media /media bind defaults,bind 0 0
4. Open up /bedrock/clients/bedrock/etc/init.d/rcS and just *before* the line
which announces "Setting up client shared items" (around line 230) add:
announce "Sharing subtrees"
mount --make-shared /mnt
mount --make-shared /media
result
5. Add the following to /bedrock/etc/frameworks.d/default (or some other framework/client.conf)
bind = /mnt, /media
Thoughts/notes on solution for Hawkey:
- Have brs recognize a new key ("shared") which will check if the core has the
given directory as a shared mount point and, if not, mount that, then
continue as though it was a bind setting. Will have to be careful to ensure
we do not "leak" mount points in the core when doing this; will have to remove
those as well when taking down a client.
- Do not create a new setting, but rather have all bind items act as described
above. This is conceptually simpler, but but will result in more mount
points / overhead.
- Might be able to just make the root of the filesystem ("/") shared - then
everything will propogate. Experimentation seems to indicate this will not
cause an infinite loop. Haven't thought through possible downsides.
- When taking down a client, be sure to --make-private every mount point being
unmounted to make sure the umount event does not propogate to other clients.
- When (re)mounting a "shared" item, will need to use --rbind to ensure the
all of the sub-mount points propogate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment