Build changes to sync with FreeNAS

Import commit f099314915db2bdcf542c9a99c1da7ac07869fa7 from williambr