blob: 0425146a87f780548cf12a1d44c1f1b287472029 [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
script
if [ -f /var/lib/fwupd/pending.db ]; then
exec minijail0 \
--profile=minimalistic-mountns --uts -e -l -p -N \
-k /run,/run,tmpfs -b /run/dbus -u fwupd -g fwupd \
-- /usr/bin/fwupdmgr activate 2>&1 | logger -t "${UPSTART_JOB}"
fi
end script