For reasons I cannot (yet) explain, if theIf a disk is of an oddball size (200mb + 512b, the boot process takes more attempts to read the GPT partition table.
In the later attempts, when dev->d_slice is setin the case of rootgen.sh), it matches GELI and the boot sector is 'decrypted'when disk_open() is called on a GELI encrypted partition, even though it is not encryptedattempts to read the partition table fail, resulting in gas they pass through the decryption process which turns the already plaintext data into jibberish.
Only decrypt content if it is within the bounds of the encrypted partition (specifically not before the start of the partition)
This makes the GELI boot test profile added in https://reviews.freebsd.org/D15846 work.
I am still unsure why it works if the disk is 200mbWhen reading the partition table, always pass a slice and partition setting of -1, but not if it is 200mb + 512band an offset of 0.