Skip to content

Commit 357aa5e

Browse files
zdykstraahesford
andcommitted
Make keylocation of target match that of source in duplicate_snapshot
Co-authored-by: Zach Dykstra <[email protected]> Co-authored-by: Andrew J. Hesford <[email protected]>
1 parent 48e6bcc commit 357aa5e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

90zfsbootmenu/zfsbootmenu-lib.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,7 @@ kexec_kernel() {
792792

793793
duplicate_snapshot() {
794794
local selected target target_parent pool recv_args
795+
local encroot keylocation
795796

796797
selected="${1}"
797798
if [ -z "$selected" ]; then
@@ -826,6 +827,13 @@ duplicate_snapshot() {
826827

827828
recv_args=( "-u" "-o" "canmount=noauto" "-o" "mountpoint=/" "${target}" )
828829

830+
if encroot="$( be_has_encroot "${selected}" )" ; then
831+
keylocation="$( zfs get -H -o value keylocation "${encroot}" 2>/dev/null )"
832+
if [ -n "${keylocation}" ] && [ "${keylocation}" != "-" ]; then
833+
recv_args+=( "-o" "keylocation=${keylocation}" )
834+
fi
835+
fi
836+
829837
(
830838
trap 'exit 0' SIGINT
831839
if command -v mbuffer >/dev/null 2>&1; then

0 commit comments

Comments
 (0)