Initial work. Needs testing on virgin install.