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
6DefaultDependencies=no
7ConditionKernelCommandLine=bootfs.rollback
8
9[Service]
10Type=oneshot
11ExecStart=/bin/sh -c '. /lib/dracut-zfs-lib.sh; decode_root_args || exit; [ "$root" = "zfs:AUTO" ] && root="$BOOTFS"; SNAPNAME="$(getarg bootfs.rollback)"; exec @sbindir@/zfs rollback -Rf "$root@${SNAPNAME:-%v}"'
12RemainAfterExit=yes
13