Backport:

https://github.com/pcbsd/pcbsd/commit/35b47b710ae25a90a3964df63ef2d839ba99e3b4