blob: fa5cf419d273347881f454be9332c5819b9a02dc [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 "Gets devices' metadata using fwupdtool"
author ""
# This job is started by udev via custom events.
# Job duration is expected to be O(ms).
start on fwupdtool-getdevices
pre-start script
mkdir -p /var/cache/fwupd /var/lib/fwupd
chown -R fwupd:fwupd /var/cache/fwupd /var/lib/fwupd
end script
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 -u fwupd -g fwupd --add-suppl-group usb --add-suppl-group i2c \
-- /usr/bin/fwupdtool get-devices --enable-json-state 2>&1 |
logger -t "${UPSTART_JOB}"
end script