initramfs: use correct dataset for rootfs on rollback=1

When booting with root=zfs:rpool/myrootfs@foosnapshot rollback=1,
myrootfs and its descendants get rolled back to foosnapshot, however
ZFS_BOOTFS still contains myrootfs@foosnapshot instead of the
actually desired value of myrootfs.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Signed-off-by: Daniel Reichelt <hacking@nachtgeist.net>
Closes #12585 
Closes #12586
This commit is contained in:
nachtgeist 2021-10-08 18:16:31 +00:00 committed by GitHub
parent 97bbeeb938
commit a5b464263b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -630,6 +630,7 @@ setup_snapshot_booting()
then then
# Rollback snapshot # Rollback snapshot
rollback_snap "$s" || retval=$((retval + 1)) rollback_snap "$s" || retval=$((retval + 1))
ZFS_BOOTFS="${rootfs}"
else else
# Setup a destination filesystem name. # Setup a destination filesystem name.
# Ex: Called with 'rpool/ROOT/debian@snap2' # Ex: Called with 'rpool/ROOT/debian@snap2'