xref: /freebsd/sys/contrib/openzfs/contrib/dracut/90zfs/zfs-rollback-bootfs.service.in (revision 5b31cc94b10d4bb7109c6b27940a0fc76a44a331)
1[Unit]
2Description=Rollback bootfs just before it is mounted
3Requisite=zfs-import.target
4After=zfs-import.target dracut-pre-mount.service zfs-snapshot-bootfs.service
5Before=dracut-mount.service sysroot.mount
6DefaultDependencies=no
7ConditionKernelCommandLine=bootfs.rollback
8ConditionEnvironment=BOOTFS
9
10[Service]
11Type=oneshot
12ExecStart=/bin/sh -c '. /lib/dracut-lib.sh; SNAPNAME="$(getarg bootfs.rollback)"; exec @sbindir@/zfs rollback -Rf "$BOOTFS@${SNAPNAME:-%v}"'
13RemainAfterExit=yes
14