blob: 016ea4d755aad4351068b811a2f4816ddf124cbf [file] [log] [blame]
# 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 "Modem firmware updater daemon"
author "ejcaruso@chromium.org"
start on starting system-services
stop on stopping system-services
# Same oom score level as e.g. shill
oom score -100
# Set to true to turn on debug mode on startup.
env DEBUG_MODE="false"
import DEBUG_MODE
script
# Override logging level if sticky flag exists.
if [ -f /var/cache/modem-utilities/log_modemfwd_debug ]; then
DEBUG_MODE="true"
fi
# Default helper directory is /opt/google/modemfwd-helpers and if the
# firmware directory isn't specified we load from the cellular component.
# -u Run as modem user.
# -g Run as modem group.
# -G Inherit supplementary groups from new uid.
# -v Enter new mount namespace, allows to change mounts inside jail.
# -n prevents the executable from gaining new privileges.
# -b /var/lib/metrics Mount with write permissions for uma metrics.
# -k /run/imageloader with MS_BIND|MS_REC to pick up any new DLC package
exec minijail0 -u modem -g modem -G -v -n \
-b /var/lib/metrics,,1 \
-k '/run/imageloader,/run/imageloader,none,MS_BIND|MS_REC' \
/usr/bin/modemfwd \
--firmware_directory=/opt/google/modemfwd-firmware \
--debug_mode="${DEBUG_MODE}"
end script