factored bootloader patching out of main.cpp and into weakly defined external function.