mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-05 15:55:45 +00:00
Set the firmware contents even when subclassing ->parse()
This commit is contained in:
parent
e8684d9f65
commit
e358cc7bde
@ -906,6 +906,11 @@ fu_firmware_parse_full(FuFirmware *self,
|
||||
}
|
||||
if (!fu_firmware_check_magic_for_offset(self, fw, &offset, flags, error))
|
||||
return FALSE;
|
||||
|
||||
/* always set by default */
|
||||
fu_firmware_set_bytes(self, fw);
|
||||
|
||||
/* handled by the subclass */
|
||||
if (klass->parse != NULL)
|
||||
return klass->parse(self, fw, offset, flags, error);
|
||||
|
||||
@ -922,9 +927,7 @@ fu_firmware_parse_full(FuFirmware *self,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* just add entire blob */
|
||||
fu_firmware_set_bytes(self, fw);
|
||||
fu_firmware_set_size(self, g_bytes_get_size(fw));
|
||||
/* success */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -543,7 +543,6 @@ fu_intel_thunderbolt_nvm_parse(FuFirmware *firmware,
|
||||
|
||||
/* add this straight away */
|
||||
priv->sections[FU_INTEL_THUNDERBOLT_NVM_SECTION_DIGITAL] = offset;
|
||||
fu_firmware_set_bytes(firmware, fw);
|
||||
|
||||
/* is native */
|
||||
if (!fu_intel_thunderbolt_nvm_read_uint8(
|
||||
|
@ -360,7 +360,6 @@ fu_bcm57xx_firmware_parse(FuFirmware *firmware,
|
||||
g_autoptr(FuFirmware) img = fu_bcm57xx_dict_image_new();
|
||||
fu_bcm57xx_dict_image_set_target(FU_BCM57XX_DICT_IMAGE(img), 0xD);
|
||||
fu_bcm57xx_dict_image_set_kind(FU_BCM57XX_DICT_IMAGE(img), 0x0);
|
||||
fu_firmware_set_bytes(img, fw);
|
||||
fu_firmware_set_addr(img, BCM_CODE_DIRECTORY_ADDR_APE);
|
||||
fu_firmware_set_id(img, "ape");
|
||||
fu_firmware_add_image(firmware, img);
|
||||
|
@ -383,8 +383,7 @@ fu_ccgx_firmware_parse(FuFirmware *firmware,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* add something, although we'll use the records for the update */
|
||||
fu_firmware_set_bytes(firmware, fw);
|
||||
/* success */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -131,8 +131,7 @@ fu_elantp_firmware_parse(FuFirmware *firmware,
|
||||
error))
|
||||
return FALSE;
|
||||
|
||||
/* whole image */
|
||||
fu_firmware_set_bytes(firmware, fw);
|
||||
/* success */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,6 @@ fu_ep963x_firmware_parse(FuFirmware *firmware,
|
||||
}
|
||||
|
||||
/* success */
|
||||
fu_firmware_set_bytes(firmware, fw);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,6 @@ fu_fresco_pd_firmware_parse(FuFirmware *firmware,
|
||||
/* set version number */
|
||||
version = fu_fresco_pd_version_from_buf(ver);
|
||||
fu_firmware_set_version(firmware, version);
|
||||
fu_firmware_set_bytes(firmware, fw);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -73,9 +73,7 @@ fu_nordic_hid_firmware_parse(FuFirmware *firmware,
|
||||
fu_firmware_add_flag(FU_FIRMWARE(self), FU_FIRMWARE_FLAG_HAS_CHECKSUM);
|
||||
priv->crc32 = fu_nordic_hid_firmware_crc32(buf, bufsz);
|
||||
|
||||
/* do not strip the header */
|
||||
fu_firmware_set_bytes(firmware, fw);
|
||||
|
||||
/* success */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,6 @@ fu_pxi_firmware_parse(FuFirmware *firmware,
|
||||
self->model_name = g_strndup((gchar *)model_name, sizeof(model_name));
|
||||
|
||||
/* success */
|
||||
fu_firmware_set_bytes(firmware, fw);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,6 @@ fu_steelseries_firmware_parse(FuFirmware *firmware,
|
||||
|
||||
self->checksum = checksum;
|
||||
fu_firmware_add_flag(FU_FIRMWARE(self), FU_FIRMWARE_FLAG_HAS_CHECKSUM);
|
||||
fu_firmware_set_bytes(firmware, fw);
|
||||
|
||||
/* success */
|
||||
return TRUE;
|
||||
|
@ -311,8 +311,7 @@ fu_synaptics_cxaudio_firmware_parse(FuFirmware *firmware,
|
||||
fu_synaptics_cxaudio_firmware_avoid_badblocks(badblocks, records);
|
||||
}
|
||||
|
||||
/* this isn't used, but it seems a good thing to add */
|
||||
fu_firmware_set_bytes(firmware, fw);
|
||||
/* success */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,8 @@ fu_synaptics_mst_firmware_parse(FuFirmware *firmware,
|
||||
G_BIG_ENDIAN,
|
||||
error))
|
||||
return FALSE;
|
||||
fu_firmware_set_bytes(firmware, fw);
|
||||
|
||||
/* success */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -167,8 +167,7 @@ fu_vli_pd_firmware_parse(FuFirmware *firmware,
|
||||
}
|
||||
}
|
||||
|
||||
/* whole image */
|
||||
fu_firmware_set_bytes(firmware, fw);
|
||||
/* success */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -259,8 +259,7 @@ fu_vli_usbhub_firmware_parse(FuFirmware *firmware,
|
||||
break;
|
||||
}
|
||||
|
||||
/* whole image */
|
||||
fu_firmware_set_bytes(firmware, fw);
|
||||
/* success */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user