| # Copyright 2018 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| description "Mount /home/chronos/user/MyFiles for ARC." |
| author "chromium-os-dev@chromium.org" |
| |
| start on started arc-myfiles |
| stop on stopping arc-myfiles |
| |
| env SOURCE=/home/chronos/user/MyFiles |
| env DEST=/run/arc/media/MyFiles-read |
| # The read-only MyFiles should be achieved by allowing read (and prohibiting |
| # write) to group everybody. This is consistent with removable-read, and |
| # accessible by system apps (media process, DocumentsUI) and non-system apps |
| # with READ_EXTERNAL_STORAGE or WRITE_EXTERNAL_STORAGE. |
| env UMASK=027 |
| env ANDROID_ROOT_UID=0 |
| env ANDROID_EVERYBODY_GID=9997 |
| |
| expect fork |
| |
| pre-start exec logger -t "${UPSTART_JOB}" "Pre-start ${UPSTART_JOB}" |
| |
| # The accesses are intentionally the same as arc-myfiles.conf to restrict access |
| # to MediaProvider and DocumentsUI. This will be the same behaviour as |
| # removable-media in pre-72. |
| # TODO(risan): Remove these mount-passthrough processes or do something to fix |
| # the mount points. |
| |
| # systemd-cat is used to redirect stdio from sdcard to journald for logging. |
| # minijail is used in the mount-passthrough-jailed script. |
| exec /usr/bin/systemd-cat -t "${UPSTART_JOB}" \ |
| mount-passthrough-jailed "${SOURCE}" "${DEST}" "${UMASK}" \ |
| "${ANDROID_ROOT_UID}" "${ANDROID_EVERYBODY_GID}" "read" |
| |
| post-stop exec logger -t "${UPSTART_JOB}" "Post-stop ${UPSTART_JOB}" |