Add upgrade function by hfupdate_write_file