def update_firmware(self, file_url, component_type):
        """Updates the given firmware on the server for the given component.

        :param file_url: location of the raw firmware file. Extraction of the
                         firmware file (if in compact format) is expected to
                         happen prior to this invocation.
        :param component_type: Type of component to be applied to.
        :raises: InvalidInputError, if the validation of the input fails
        :raises: IloError, on an error from iLO
        :raises: IloConnectionError, if not able to reach iLO.
        :raises: IloCommandNotSupportedError, if the command is
                 not supported on the server
        """
        fw_update_uri = self._get_firmware_update_service_resource()
        action_data = {
            'Action': 'InstallFromURI',
            'FirmwareURI': file_url,
        }

        # perform the POST
        LOG.debug(self._('Flashing firmware file: %s ...'), file_url)
        status, headers, response = self._rest_post(
            fw_update_uri, None, action_data)
        if status != 200:
            msg = self._get_extended_error(response)
            raise exception.IloError(msg)

        # wait till the firmware update completes.
        common.wait_for_ris_firmware_update_to_complete(self)

        try:
            state, percent = self.get_firmware_update_progress()
        except exception.IloError:
            msg = 'Status of firmware update not known'
            LOG.debug(self._(msg))  # noqa
            return

        if state == "ERROR":
            msg = 'Unable to update firmware'
            LOG.debug(self._(msg))  # noqa
            raise exception.IloError(msg)
        elif state == "UNKNOWN":
            msg = 'Status of firmware update not known'
            LOG.debug(self._(msg))  # noqa
        else:  # "COMPLETED" | "IDLE"
            LOG.info(self._('Flashing firmware file: %s ... done'), file_url)