2022-08-05 20:41:33 +00:00
|
|
|
#!/usr/bin/env bash
|
2022-09-13 17:55:17 +00:00
|
|
|
# Copyright 2022 The ChromiumOS Authors
|
2022-08-05 20:41:33 +00:00
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
|
|
|
# Ensure there's only 1 instance of setup-user.sh running
|
|
|
|
flock /tmp/entrypoint_lock /tools/setup-user.sh
|
|
|
|
|
|
|
|
# Give KVM device correct permission
|
2022-10-31 21:06:07 +00:00
|
|
|
if [ -e "/dev/kvm" ]; then
|
2022-10-19 22:25:57 +00:00
|
|
|
chmod 666 /dev/kvm
|
|
|
|
fi
|
2022-08-05 20:41:33 +00:00
|
|
|
|
|
|
|
# Run provided command or interactive shell
|
|
|
|
if [[ $# -eq 0 ]]; then
|
|
|
|
sudo -u crosvmdev /bin/bash -l
|
|
|
|
else
|
|
|
|
sudo -u crosvmdev /bin/bash -l -c "$*"
|
|
|
|
fi
|