Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(879)

Issue 5331009: crosutils: add scripts/.local_mounts to allow mounting additional (RO) folders in chroot

Created:
10 years ago by Hung-Te
Modified:
10 years ago
Reviewers:
kliegs, robotboy, adlr, sosa
CC:
chromium-os-reviews_chromium.org, Mandeep Singh Baines, anush, sosa
Visibility:
Public.

Description

crosutils: 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+60 lines, -31 lines) Patch
M .gitignore View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M enter_chroot.sh View 1 2 3 4 5 chunks +59 lines, -31 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
Hung-Te
10 years ago (2010-11-26 12:02:54 UTC) #1
kliegs
I'm a little mixed on this. While this is a big help, there's been concern ...
10 years ago (2010-11-26 15:33:35 UTC) #2
Hung-Te
10 years ago (2010-11-26 16:21:04 UTC) #3
Hung-Te
On 2010/11/26 15:33:35, kliegs wrote: > a user doing a rm -rf could delete those ...
10 years ago (2010-11-26 16:22:25 UTC) #4
kliegs
On Fri, Nov 26, 2010 at 11:22 AM, <hungte@chromium.org> wrote: > On 2010/11/26 15:33:35, kliegs ...
10 years ago (2010-11-26 16:35:33 UTC) #5
Hung-Te
On 2010/11/26 16:35:33, kliegs wrote: > The way you did it looks odd in your ...
10 years ago (2010-11-26 17:21:06 UTC) #6
Mandeep Singh Baines
This seems useful. But can you please document this on the wiki before commiting the ...
10 years ago (2010-11-29 18:23:23 UTC) #7
sosa
Some comments: 1) local variables should have following cases: blah_variable not BLAH_VARIABLE ... that casing ...
10 years ago (2010-11-29 19:31:54 UTC) #8
Hung-Te
On 2010/11/29 19:31:54, sosa wrote: > 1) local variables should have following cases: blah_variable not ...
10 years ago (2010-11-30 02:30:06 UTC) #9
Hung-Te
On 2010/11/29 18:23:23, Mandeep Singh Baines wrote: > But can you please document this on ...
10 years ago (2010-11-30 02:34:08 UTC) #10
kliegs
Sorry for not keeping up on this as I got pulled into other things. Was ...
10 years ago (2010-11-30 15:17:24 UTC) #11
Hung-Te
10 years ago (2010-11-30 15:48:31 UTC) #12
On 2010/11/30 15:17:24, kliegs wrote:
> Was commenting that you were alternating case and needed to 
> settle on a style - I hope I didn't actually say to make 
> everything upper case.

My apologize for that - you're right. The original code uses upper case, and you
simply mentioned the consistency issue -- not how to fix it.
Really sorry for that.

Powered by Google App Engine
This is Rietveld 408576698