Tools/scripts: sync with FreeBSD