blob: b0562bd8fd7bfc2eb82d5eb40491f177fc59a8a5 [file] [log] [blame] [edit]
# Copyright 2020 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
description "Set up the hardware configuration files for ARCVM"
author "chromium-os-dev@chromium.org"
# Use 'never' since terminating this job fails ARC to start.
oom score never
# Make this a task so that 'start arcvm-per-board-features' will block until
# the script finishes.
task
# Execute generate_camera_profile and board_hardware_features scripts and
# store the results in /run/arcvm/host_generated/oem.
script
die() {
logger -t "${UPSTART_JOB}" "$1"
exit 1
}
DEV_CAMERA_ARGS=""
if [ -e /dev/camera-internal0 ]; then
DEV_CAMERA_ARGS=" -b /dev/camera-internal0"
fi
if [ -e /dev/camera-internal1 ]; then
DEV_CAMERA_ARGS="${DEV_CAMERA_ARGS} -b /dev/camera-internal1"
fi
exec /sbin/minijail0 --config=/usr/share/minijail/arcvm-per-board-features.conf \
${DEV_CAMERA_ARGS} \
-- /usr/sbin/arc-apply-per-board-config \
--log_tag=arc-apply-per-board-config ||
die "Failed to execute arc-apply-per-board-config"
end script