This commit is actually a rework of what's been done in RELENG-e2k-workstation private branch (along with a few more generic fixups).