code de-duplication of recent bootloader autoupgrde changes (bnc#885634)