Skip to content

Commit

Permalink
src/update_handler: filter out character devices as casync seeds
Browse files Browse the repository at this point in the history
If extracting casync block-indexed images ("*.caibx") to a slot it could be of
advantage to use the slot's active counterpart as a casync seeding device. In
the case of UBI volume based slots those are char devices which can not be
handed out to casync. Instead one needs to derive related UBIBLOCK devices for
that purpose which have to be cleaned up afterwards. For the moment to simplify
things just discard the usage of seeding devices in that case.

Signed-off-by: Ulrich Ölmann <[email protected]>
  • Loading branch information
OnkelUlla committed Oct 24, 2019
1 parent 44e4269 commit dc6b9f0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/update_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,14 @@ static gboolean casync_extract_image(RaucImage *image, gchar *dest, int out_fd,
g_debug("Adding as casync directory tree seed: %s", seedslot->mount_point);
seed = g_strdup(seedslot->mount_point);
} else {
GStatBuf seedstat;

/* For the moment do not utilize UBI volumes as seed because they are
* character devices - additional logic is needed to (temporarily) map
* them to UBIBLOCK devices which are suitable for that purpose */
if (g_stat(seedslot->device, &seedstat) < 0 || S_ISCHR(seedstat.st_mode))
goto extract;

g_debug("Adding as casync blob seed: %s", seedslot->device);
seed = g_strdup(seedslot->device);
}
Expand Down

0 comments on commit dc6b9f0

Please sign in to comment.