blob: c76c56f60ebfc919d17a565c679021f9cf4a3494 [file] [log] [blame]
#!/bin/sh
# Copyright 2019 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.
user=root
owner_id="$(cryptohome --action=status | jq -r '.mounts[0].owner')"
if [ -z "${owner_id}" ]; then
echo "$0: Could not connect, cannot get owner_id" >&2
exit 1
fi
vm_name=arcvm
# TODO(b/147857453): Use /system/bin/runcon.
exec /usr/bin/vsh \
--user="${user}" --owner_id="${owner_id}" --vm_name="${vm_name}" -- \
/system/bin/env -i \
ANDROID_ASSETS=/assets \
ANDROID_DATA=/data \
ANDROID_ROOT=/system \
ANDROID_STORAGE=/storage \
ASEC_MOUNTPOINT=/mnt/asec \
EXTERNAL_STORAGE=/sdcard \
PATH=/sbin:/vendor/bin:/system/bin:/system/xbin \
/system/bin/sh "$@"