Descriptioncrosutils: add scripts/.local_mounts to allow mounting additional (RO) folders in chroot
It would be helpful if we can share some folders inside/outside chroot, for
example editor configuration / settings, or the default Downloads folder.
For safety concern and prevent user accidentally deleted their files in actual home, the mounts were made as read-only.
This CL reads .local_mounts (just like .default_boards) from scripts folder,
and mount the folders whenever you do enter_chroot.
.local_mounts has a very simple syntax:
mount_path
or source_path(outside chroot) destination_path(inside chroot)
or # comments.
Examples:
# comment here
/usr/share/vim/google
/home/XXX/Downloads /outside
BUG=none
TEST=manually:
1. Create ~/trunk/src/scripts/.local_mounts with following content:
/usr/share/vim/google
/home/XXX/Downloads /outside
2. Create the folders: chroot/usr/share/vim/google, chroot/outside
3. ./enter_chroot.sh
4. ls -l /usr/share/vim/google # folder is mounted correctly
ls -l /outside
5. exit
6. mount | grep chroot # nothing is left
Change-Id: I8901d8291e618cea493b3d74e7ef00e6830c660f
Patch Set 1 #Patch Set 2 : allow "source only" and ignore empty lines #Patch Set 3 : Change to read-only mounts and refine by reviewer's comments #Patch Set 4 : Use FLAGS_trunk for root #Patch Set 5 : Add into .gitignore, and refine local variable names #Messages
Total messages: 12 (0 generated)
|