[PATCH v2 4/4] fastboot: Add a ARM Barebox filetype handler

Sascha Hauer s.hauer at pengutronix.de
Thu Mar 10 23:07:13 PST 2016


On Wed, Feb 17, 2016 at 12:28:20PM +0100, Markus Pargmann wrote:
> +	if (filetype_is_barebox_image(filetype)) {
> +		struct bbu_data data = {
> +			.devicefile = filename,
> +			.imagefile = FASTBOOT_TMPFILE,
> +			.flags = BBU_FLAG_YES,
> +		};
> +
> +		if (!barebox_update_handler_exists(&data))
> +			goto copy;
> +
> +		fastboot_tx_print(f_fb, "INFOThis is an ARM Barebox image...");
> +
> +		data.image = read_file(data.imagefile, &data.len);
> +		if (!data.image) {
> +			fastboot_tx_print(f_fb, "FAILreading barebox");
> +			return;
> +		}
> +
> +		ret = barebox_update(&data);

data.image must be freed after use. Added this.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list