More portable system type detection in common.sh