1[Unit] 2Description=Rollback bootfs just before it is mounted 3Requisite=zfs-import.target 4After=zfs-import.target zfs-snapshot-bootfs.service 5Before=dracut-mount.service 6DefaultDependencies=no 7ConditionKernelCommandLine=bootfs.rollback 8 9[Service] 10# ${BOOTFS} should have been set by zfs-env-bootfs.service 11Type=oneshot 12ExecStartPre=/bin/sh -c 'test -n "${BOOTFS}"' 13ExecStart=/bin/sh -c '. /lib/dracut-lib.sh; SNAPNAME="$(getarg bootfs.rollback)"; /sbin/zfs rollback -Rf "${BOOTFS}@${SNAPNAME:-%v}"' 14RemainAfterExit=yes 15