mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2025-12-10 07:44:53 +01:00
Merge "sysupgrade-helper : Fix warnings during compilation"
This commit is contained in:
commit
672b0255df
2 changed files with 13 additions and 7 deletions
|
|
@ -794,7 +794,7 @@ int get_ubi_volume_id(char *vol_name)
|
|||
fgets(ubi_vol_name, sizeof(ubi_vol_name), fp);
|
||||
if (strstr(ubi_vol_name, vol_name)) {
|
||||
printf("%s volume id = %d\n", vol_name, i);
|
||||
close(fp);
|
||||
fclose(fp);
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
|
@ -811,10 +811,11 @@ int get_ubi_volume_id(char *vol_name)
|
|||
* to get the ELF header of rootfs metadata.
|
||||
*/
|
||||
|
||||
void extract_binary(struct image_section *section)
|
||||
int extract_binary(struct image_section *section)
|
||||
{
|
||||
extract_kernel_binary(section, "kernel");
|
||||
parse_elf_image_phdr(section);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1013,7 +1014,7 @@ int extract_rootfs_binary(char *filename)
|
|||
fp = mmap(NULL, sb.st_size, PROT_READ, MAP_PRIVATE, ifd, 0);
|
||||
if (fp == MAP_FAILED) {
|
||||
perror("mmap");
|
||||
close(fp);
|
||||
close(ifd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1049,13 +1050,16 @@ int compute_sha_hash(struct image_section *section)
|
|||
int retval;
|
||||
|
||||
#ifdef USE_SHA384
|
||||
snprintf(command, sizeof(command),
|
||||
retval = snprintf(command, sizeof(command),
|
||||
"openssl dgst -sha384 -binary -out %s %s", sha_hash, section->tmp_file);
|
||||
#endif
|
||||
#ifdef USE_SHA256
|
||||
snprintf(command, sizeof(command),
|
||||
retval = snprintf(command, sizeof(command),
|
||||
"openssl dgst -sha256 -binary -out %s %s", sha_hash, section->tmp_file);
|
||||
#endif
|
||||
if (retval < 0) {
|
||||
return retval;
|
||||
}
|
||||
retval = system(command);
|
||||
if (retval != 0) {
|
||||
printf("Error generating sha-hash, command : %s\n",command);
|
||||
|
|
@ -1801,7 +1805,7 @@ int do_board_upgrade_check(char *img)
|
|||
if (is_tz_authentication_enabled()) {
|
||||
/* If image is having signed rootfs image, then extract kernel and rootfs binary for parsing metadata. */
|
||||
if (is_rootfs_auth_enabled()) {
|
||||
printf("roofs image authentication is enabled ...\n");
|
||||
printf("rootfs image authentication is enabled ...\n");
|
||||
extract_rootfs_binary(check_image_exist("rootfs-"));
|
||||
extract_ubi_volume("ubi_rootfs", check_image_exist("ubi-"), TEMP_ROOTFS_PATH);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,8 +113,10 @@ int is_version_check_enabled(void);
|
|||
int get_sw_id_from_component_bin(struct image_section *);
|
||||
int get_sw_id_from_component_bin_elf(struct image_section *);
|
||||
int get_sw_id_from_component_bin_elf64(struct image_section *);
|
||||
void extract_binary(struct image_section *);
|
||||
int extract_binary(struct image_section *);
|
||||
int extract_kernel_binary(struct image_section *, char *);
|
||||
int extract_ubi_volume(char *, char *, char *);
|
||||
int extract_rootfs_binary(char *);
|
||||
int is_image_version_higher(void);
|
||||
int update_version(void);
|
||||
int check_image_version(void);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue