fork from https://hg.openindiana.org/sustaining/oi_151a/sfw-gate