Backport bcache, OSx mem from CGP
https://github.com/pommi/CGP/commit/0cea50041c7a16ce44d61a9c62028a7bb73bdcb1
https://github.com/pommi/CGP/commit/6843fcb869deb1cf48df149578331f3041084800