blob: 33f2eb86a584ceaec4fd833ea72275fe7c42395a [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 ""
# 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
pre-start script
mkdir -p /var/cache/fwupd /var/lib/fwupd
chown -R fwupd:fwupd /var/cache/fwupd /var/lib/fwupd
end script
if [ -f /var/lib/fwupd/pending.db ]; then
exec minijail0 \
--uts -e -l -p -N \
-v -P /mnt/empty -b / -b /proc -r -t -b /dev,,1 -k run,/run,tmpfs \
-k /var,/var,tmpfs -b /var/cache/fwupd,,1 -b /var/lib/fwupd,,1 \
-b /sys,,1 -u fwupd -g fwupd --add-suppl-group usb \
-- /usr/bin/fwupdtool activate 2>&1 | logger -t "${UPSTART_JOB}"
end script