Ejemplo n.º 1
0
func generateOtaPackage(params []string) error {
	res, output, err := sys.ExecCmd(ota_constant.OTA_MAKE_CMD, params)
	revel.INFO.Println("generate ota package: \n", output)
	if !res || err != nil {
		return fmt.Errorf("%s failed: %s\n\tdetail message: %s\n", ota_constant.OTA_MAKE_CMD, err, output)
	}
	return nil
}
Ejemplo n.º 2
0
func generateRadioImage(radio_dtim_path string, radio_image_path string, image_list []string) error {
	params := make([]string, 0, 5)
	params = append(params, radio_dtim_path)
	params = append(params, radio_image_path)
	params = append(params, image_list...)

	//	fmt.Println(ota_constant.RESIGN_DTIM_CMD, " ", params)
	res, output, err := sys.ExecCmd(ota_constant.RESIGN_DTIM_CMD, params)
	if !res || err != nil {
		return fmt.Errorf("%s failed: %s\n\tdetail message: %s\n", ota_constant.RESIGN_DTIM_CMD, err, output)
	}
	return nil
}
Ejemplo n.º 3
0
func gzipCpImage(path_list []string) error {
	for _, path := range path_list {
		params := make([]string, 0, 5)
		params = append(params, ota_constant.GZIP_CMD_PARAMS...)
		params = append(params, path)
		res, output, err := sys.ExecCmd(ota_constant.GZIP_CMD_NAME, params)
		if !res || err != nil {
			return fmt.Errorf("%s failed: %s\n\tdetail message: %s\n", ota_constant.GZIP_CMD_PARAMS, err, output)
		}
	}

	return nil
}