Add some customizations taken from FreeBSD

No "fixes from upstream" patches were brought in, only ones that would
persist between updates.