Ejemplo n.º 1
0
 def backup_parameter(self, parameter_file):
   self.__logger.print_dividor()
   self.__logger.log('\tBackuping parameter to file %s\n' % (parameter_file))
   with io.BytesIO() as fh:
     self.__dump_partition(0x00000000, PART_BLOCKSIZE, fh)
     data = fh.getvalue()
   data = rkcrc.verify_parameter_image(data)
   if data:
     with open(parameter_file, 'wb') as f:
       f.write(data)
   else:
     self.__logger.print_error(
       '\tInvalid parameter file!\n')
Ejemplo n.º 2
0
 def backup_parameter(self, parameter_file):
     self.__logger.print_dividor()
     self.__logger.log('\tBackuping parameter to file %s\n' %
                       (parameter_file))
     with io.BytesIO() as fh:
         self.__dump_partition(0x00000000, PART_BLOCKSIZE, fh)
         data = fh.getvalue()
     data = rkcrc.verify_parameter_image(data)
     if data:
         with open(parameter_file, 'wb') as f:
             f.write(data)
     else:
         self.__logger.print_error('\tInvalid parameter file!\n')