@balanga said
Can I run this [script] while booted from a different partition on the same disk?
Yes, you can.
When booting from my existing FreeBSD partition I assume I need to mount the ZFS partition like so /dev/ada0p8 /mnt then
cd /mnt run this script from there.
The ZFS pool is mounted by the
zpool-create(8) altroot property on /mnt, but the root dataset won't be mounted (see "-m none" in the script). It's not possible, the installer media is a read-only file system, no mount point can be created.
Where do I extract kernel.txz and base.txz ? To /mnt ?
You don't need to extract anything.
Boot the installer media (from Ventoy if you like), proceed with the menu-guided installation as usual, choose at the "Select Installation Type" "Distribution Sets" (kernel.txz, base.txz, etc.), or pkgbase "Packages (Tech Preview), at the "Partitioning" menu enter "Shell", eventually edit your partitions, execute the shell script I posted,
exit the "Shell". The installation proceeds menu guided, distribution files (or pkgbase packages) are installed, system is configured.
Just check at the end ("Manual Configuration" menu, < Yes >) /boot/loader.conf (for zfs_load=), /etc/fstab (for swap, efi), /etc/sysctl.conf (for vfs.zfs.vdev.min_auto_ashift=12), /etc/rc.conf (for zfs_enable=).