2020-05-30 07:16:08 +03:00
|
|
|
[Unit]
|
|
|
|
Description=Rollback bootfs just before it is mounted
|
|
|
|
Requisite=zfs-import.target
|
|
|
|
After=zfs-import.target zfs-snapshot-bootfs.service
|
|
|
|
Before=dracut-mount.service
|
|
|
|
DefaultDependencies=no
|
|
|
|
ConditionKernelCommandLine=bootfs.rollback
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
# ${BOOTFS} should have been set by zfs-env-bootfs.service
|
|
|
|
Type=oneshot
|
|
|
|
ExecStartPre=/bin/sh -c 'test -n "${BOOTFS}"'
|
2021-04-14 18:30:59 +03:00
|
|
|
ExecStart=/bin/sh -c '. /lib/dracut-lib.sh; SNAPNAME="$(getarg bootfs.rollback)"; @sbindir@/zfs rollback -Rf "${BOOTFS}@${SNAPNAME:-%v}"'
|
2020-05-30 07:16:08 +03:00
|
|
|
RemainAfterExit=yes
|