2020-05-29 23:16:08 -05:00
|
|
|
[Unit]
|
|
|
|
|
Description=Snapshot bootfs just before it is mounted
|
|
|
|
|
Requisite=zfs-import.target
|
2022-04-05 00:19:38 +02:00
|
|
|
After=zfs-import.target dracut-pre-mount.service
|
2020-05-29 23:16:08 -05:00
|
|
|
Before=dracut-mount.service
|
|
|
|
|
DefaultDependencies=no
|
|
|
|
|
ConditionKernelCommandLine=bootfs.snapshot
|
2023-03-31 18:47:48 +02:00
|
|
|
ConditionEnvironment=BOOTFS
|
2020-05-29 23:16:08 -05:00
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
|
Type=oneshot
|
2023-03-31 18:47:48 +02:00
|
|
|
ExecStart=-/bin/sh -c '. /lib/dracut-lib.sh; SNAPNAME="$(getarg bootfs.snapshot)"; exec @sbindir@/zfs snapshot "$BOOTFS@${SNAPNAME:-%v}"'
|
2020-05-29 23:16:08 -05:00
|
|
|
RemainAfterExit=yes
|