How to update /boot that's on another disk?

Hello!
It's my first post here so i hope i don't do many mistakes. Sorry for any mistakes as i am not a native english speaker.
Let's start at the begining, i have a HP T610 plus terminal that i upgraded with nvme drive using pci-e to nvme adapter.
This mini server is running 13.2-RELEASE. From factory it has 16GB flash on module disk on which i installed freebsd with zfs, but it was veeery slow so i moved rootfs and swap to the nvme drive using:
Code:
gpart create -s gpt nvd0 
gpart add -t freebsd-swap -s 4G nvd0 
gpart add -t freebsd-zfs nvd0 
zpool attach -w zroot /dev/ada0p4 /dev/nvd0p2 
zpool detach ada0p4 # freebsd-zfs partition on disk on module drive
swapoff /dev/ada0p2 # Swap partition on disk on module drive
After all of that i edited /etc/fstab to point to swap device on nvd0p1 partition and voila root on nvme drive, but HP T610 doesn't support booting from nvme drives so i have to keep /boot on this disk on module so i searched forums and found Thread how-to-setup-another-bootdisk.81805 and Thread how-to-create-a-bootdisk-that-can-boot-a-crypted-zroot-pool.81812 so i cleared partition table on ada0 and proceeded with:
Code:
gpart create -s gpt ada0
gpart add -t efi -s 200M ada0
gpart add -a 4k -s 512K -t freebsd-boot ada0
gpart add -t freebsd-ufs -s 1G ada0
gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 2 ada0
newfs_msdos -F 32 -c 1 /dev/ada0p1
mount -t msdosfs /dev/ada0p1 /mnt
mkdir -p /mnt/EFI/BOOT
cp /boot/loader.efi /mnt/EFI/BOOT/BOOTX64.efi
umount /mnt
newfs -U -O1 /dev/ada0p3
mount /dev/ada0p3 /mnt
cp -r /boot /mnt
umount /mnt

And my system is booting with uefi and legacy bios, nice! But the files on ada0p3 has to be in folder named boot otherwise loader() cannot find config files and boot fails.
So here comes my question, can i somehow mount subfolder boot that resides on ada0p3 on to the /boot on root filesystem after boot process is done ? I want to do that so i don't have to remember after freebsd-update() or changes in /boot/loader.conf to mount ada0p3 and sync /boot on rootfs to boot on ada0p3.

Thanks in advance!
 
Back
Top