blob: 34232b181e39d7958bc7abd06ef21ae366f0c636 [file] [log] [blame]
# 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.
description "Activate firmware update on devices using fwupdtool"
author "chromium-os-dev@chromium.org"
# Use 'start on stopping' and 'task' to hold up restarting the session
# manager until we're done. Job duration is expected to be O(ms) and
# it is used to signal devices to apply any pending updates already
# installed.
start on stopping ui
task
oom score -100
env LANG=en_US.UTF-8
env FWUPD_RET=0
script
if [ -f /var/lib/fwupd/pending.db ]; then
syslog-cat --identifier="${UPSTART_JOB}" -- minijail0 \
--profile=minimalistic-mountns --uts -e -l -p -N \
-k /run,/run,tmpfs -b /run/dbus -u fwupd -g fwupd \
-- /usr/bin/fwupdmgr activate || FWUPD_RET=$?
metrics_client -e Platform.Fwupd.ActivateStatus "${FWUPD_RET}" 2
fi
end script