-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
contrib: dracut: zfs-{rollback,snapshot}-bootfs: order after key loading
This fixes at least one race I got with an encrypted root Upstream-commit: 6ebdb0b Upstream-commit: b8d9679 Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #13291
- Loading branch information
1 parent
41b2f45
commit 8213ddf
Showing
2 changed files
with
4 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
[Unit] | ||
Description=Rollback bootfs just before it is mounted | ||
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 | ||
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}"' | ||
ExecStart=/bin/sh -c '. /lib/dracut-lib.sh; SNAPNAME="$(getarg bootfs.rollback)"; exec @sbindir@/zfs rollback -Rf "${BOOTFS}@${SNAPNAME:-%v}"' | ||
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}"' | ||
RemainAfterExit=yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
[Unit] | ||
Description=Snapshot bootfs just before it is mounted | ||
Requisite=zfs-import.target | ||
After=zfs-import.target | ||
After=zfs-import.target dracut-pre-mount.service | ||
Before=dracut-mount.service | ||
DefaultDependencies=no | ||
ConditionKernelCommandLine=bootfs.snapshot | ||
|
||
[Service] | ||
# ${BOOTFS} should have been set by zfs-env-bootfs.service | ||
Type=oneshot | ||
ExecStartPre=/bin/sh -c 'test -n "${BOOTFS}"' | ||
ExecStart=-/bin/sh -c '. /lib/dracut-lib.sh; SNAPNAME="$(getarg bootfs.snapshot)"; exec @sbindir@/zfs snapshot "${BOOTFS}@${SNAPNAME:-%v}"' | ||
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}"' | ||
RemainAfterExit=yes |