Skip to content

Commit

Permalink
update_handler: add ubi static volume support
Browse files Browse the repository at this point in the history
Add slot type "ubivol" for ubi static volumes.
Rename  ubifs_to_ubifs_handler to img_to_ubivol_handler.
Avoid slot status update for static volumes.

Signed-off-by: Jan Remmet <j.remmet@phytec.de>
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
  • Loading branch information
jremmet authored and jluebbe committed Jun 16, 2016
1 parent 943b11d commit 8018d9b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/install.c
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,11 @@ static gboolean launch_and_wait_default_handler(RaucInstallArgs *args, gchar* bu
goto image_out;
}

if (g_strcmp0(dest_slot->type, "ubivol") == 0) {
g_message("Skipping slot status update for ubi (static volume) slot %s ", dest_slot->device);
goto image_out;
}

g_debug("mounting slot %s", dest_slot->device);
res = r_mount_slot(dest_slot, &ierror);
if (!res) {
Expand Down
5 changes: 3 additions & 2 deletions src/update_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ static gboolean untar_image(RaucImage *image, gchar *dest, GError **error)
return res;
}

static gboolean ubifs_to_ubifs_handler(RaucImage *image, RaucSlot *dest_slot, GError **error)
static gboolean img_to_ubivol_handler(RaucImage *image, RaucSlot *dest_slot, GError **error)
{
GOutputStream *outstream = NULL;
GError *ierror = NULL;
Expand Down Expand Up @@ -475,8 +475,9 @@ RaucUpdatePair updatepairs[] = {
{"*.vfat", "raw", img_to_raw_handler},
{"*.tar.*", "ext4", tar_to_ext4_handler},
{"*.tar.*", "ubifs", tar_to_ubifs_handler},
{"*.ubifs", "ubifs", ubifs_to_ubifs_handler},
{"*.ubifs", "ubifs", img_to_ubivol_handler},
{"*.img", "nand", img_to_nand_handler},
{"*.img", "ubivol", img_to_ubivol_handler},
{"*.img", "*", img_to_raw_handler}, /* fallback */
{0}
};
Expand Down

0 comments on commit 8018d9b

Please sign in to comment.