contrib: dracut: zfs-{rollback,snapshot}-bootfs: order after key loading
This fixes at least one race I got with an encrypted root Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #13291
This commit is contained in:
parent
30c6dce7f7
commit
6ebdb0b20d
|
@ -1,14 +1,12 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Rollback bootfs just before it is mounted
|
Description=Rollback bootfs just before it is mounted
|
||||||
Requisite=zfs-import.target
|
Requisite=zfs-import.target
|
||||||
After=zfs-import.target zfs-snapshot-bootfs.service
|
After=zfs-import.target dracut-pre-mount.service zfs-snapshot-bootfs.service
|
||||||
Before=dracut-mount.service
|
Before=dracut-mount.service
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
ConditionKernelCommandLine=bootfs.rollback
|
ConditionKernelCommandLine=bootfs.rollback
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
# ${BOOTFS} should have been set by zfs-env-bootfs.service
|
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStartPre=/bin/test -n ${BOOTFS}
|
ExecStart=/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}"'
|
||||||
ExecStart=/bin/sh -c '. /lib/dracut-lib.sh; SNAPNAME="$(getarg bootfs.rollback)"; exec @sbindir@/zfs rollback -Rf "${BOOTFS}@${SNAPNAME:-%v}"'
|
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Snapshot bootfs just before it is mounted
|
Description=Snapshot bootfs just before it is mounted
|
||||||
Requisite=zfs-import.target
|
Requisite=zfs-import.target
|
||||||
After=zfs-import.target
|
After=zfs-import.target dracut-pre-mount.service
|
||||||
Before=dracut-mount.service
|
Before=dracut-mount.service
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
ConditionKernelCommandLine=bootfs.snapshot
|
ConditionKernelCommandLine=bootfs.snapshot
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
# ${BOOTFS} should have been set by zfs-env-bootfs.service
|
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStartPre=/bin/test -n ${BOOTFS}
|
ExecStart=/bin/sh -c '. /lib/dracut-zfs-lib.sh; decode_root_args || exit; [ "$root" = "zfs:AUTO" ] && root="$BOOTFS" SNAPNAME="$(getarg bootfs.snapshot)"; exec @sbindir@/zfs snapshot "$root@${SNAPNAME:-%v}"'
|
||||||
ExecStart=-/bin/sh -c '. /lib/dracut-lib.sh; SNAPNAME="$(getarg bootfs.snapshot)"; exec @sbindir@/zfs snapshot "${BOOTFS}@${SNAPNAME:-%v}"'
|
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
|
|
Loading…
Reference in New Issue