# (C) 2017-2026 by Christian Hesse <mail@eworm.de>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

[Unit]
Description=Offline system update with pacman
Documentation=https://pacman-offline.eworm.de/
ConditionPathIsSymbolicLink=/system-update
DefaultDependencies=false
Requires=sysinit.target dbus.socket
Wants=pacman-offline-done-poweroff.service pacman-offline-done-reboot.service
After=sysinit.target system-update-pre.target dbus.socket
Before=pacman-offline-done-poweroff.service pacman-offline-done-reboot.service system-update.target
OnFailure=pacman-offline-failure.target

[Service]
Type=oneshot
# Pretty print to tty...
StandardOutput=tty
StandardError=tty
# ... or use this for debugging - less pretty, but with output in journal.
#StandardOutput=journal+console
#StandardError=journal+console
ExecStartPre=-/usr/bin/plymouth change-mode --updates
ExecStartPre=-/usr/bin/plymouth system-update --progress=20
ExecStart=/usr/lib/systemd/scripts/pacman-offline
