mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-28 17:39:23 +03:00
Add bootfs.snapshot and bootfs.rollback kernel parameters
Unlike other filesystems, snapshots and rollbacks of bootfs need to be done from a rescue environment. This patch makes it possible to snap- shot or rollback the bootfs simply by specifying bootfs.snapshot or bootfs.rollback on the kernel command line. The operation will be performed by dracut just before bootfs is mounted. Reviewed-by: Antonio Russo <antonio.e.russo@gmail.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Gregory Bartholomew <gregory.lee.bartholomew@gmail.com> Closes #10198
This commit is contained in:
committed by
GitHub
parent
3d93161b01
commit
9052e3d70b
@@ -0,0 +1,14 @@
|
||||
[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}"'
|
||||
ExecStart=/bin/sh -c '. /lib/dracut-lib.sh; SNAPNAME="$(getarg bootfs.rollback)"; /sbin/zfs rollback -Rf "${BOOTFS}@${SNAPNAME:-%v}"'
|
||||
RemainAfterExit=yes
|
||||
Reference in New Issue
Block a user