Moved function out of bootloader to util for use on linux