Hello,
Thanks for your great work to help using ZFS on Rocky Linux.
On lines 429 and 469 of install-root-on-zfs-rocky.sh you are using HEREDOC with base64 encoded content.
You could avoid that by enclosing EOF1 and EOF2 with single quotes:
tee /tmp/foo <<'EOF1'
blahblah
EOF1
That would probably make the script easier to maintain.