From ba79b07b4f8637c3a0094b5690e96ade29783135 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Thu, 5 Jan 2017 09:34:00 +0000 Subject: [PATCH] libdfu: Don't read data from some DfuSe targets The option bytes section makes no sense to include in the flashed image. --- libdfu/dfu-device.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libdfu/dfu-device.c b/libdfu/dfu-device.c index 261775ec6..35b31e419 100644 --- a/libdfu/dfu-device.c +++ b/libdfu/dfu-device.c @@ -1858,12 +1858,21 @@ dfu_device_upload (DfuDevice *device, /* upload from each target */ for (i = 0; i < priv->targets->len; i++) { DfuTarget *target; + const gchar *alt_name; gulong id1; gulong id2; g_autoptr(DfuImage) image = NULL; /* upload to target and proxy signals */ target = g_ptr_array_index (priv->targets, i); + + /* ignore some target types */ + alt_name = dfu_target_get_alt_name_for_display (target, NULL); + if (g_strcmp0 (alt_name, "Option Bytes") == 0) { + g_debug ("ignoring target %s", alt_name); + continue; + } + id1 = g_signal_connect (target, "percentage-changed", G_CALLBACK (dfu_device_percentage_cb), device); id2 = g_signal_connect (target, "action-changed",