In short - write the manufacturer public key in ROM and a fuse selects if signature check is enforce.
Disclaimer: I didn't come up with this, I'm just summarizing approximately how I understand some Android devices to already work. This also makes me view this system as somewhat battle tested.
That's not a difficult problem, technically. There are a number of ways it can be done. Anything from comparing checksums to eFuses.
> Sure, but it's hidden from 99.99% of your user base
Yes. My point is that avoiding open sourcing firmware because of the risk of piracy or reverse-engineering doesn't make sense because pirates and/or interested engineers will do it directly from the devices anyway.
But they don't need to make it too easy by giving the source on a silver platter.
Sony's answer for Xperia phones used to be that you'd unlock the bootloader with a key you got from them by entering the serial number/IMEI. As part of that, they warn that using custom ROMs that damage the phone - by overclocking, for example - would void the warranty.
It's a reasonable compromise, in my opinion.
How can they know/figure it out? (They can't/or it's prohibitively expensive/difficult).
>it's very common to find my firmware reverse engineered and available within a month or so of the product being released.
Sure, but it's hidden from 99.99% of your user base