Skip to content

Commit

Permalink
Adds the --ignore-seed option when installing
Browse files Browse the repository at this point in the history
When using a local chunk store, it's useful to ignore using the
active slot as a seed.
  • Loading branch information
fhackenberger committed Nov 19, 2019
1 parent 41d5f33 commit 03665b7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
4 changes: 3 additions & 1 deletion include/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ typedef struct {
gchar *handlerextra;
/* ignore compatible check */
gboolean ignore_compatible;
/* ignore using slot as seed */
gboolean ignore_slot_as_seed;

/* for storing installation runtime informations */
RContextInstallationInfo *install_info;
Expand Down Expand Up @@ -124,4 +126,4 @@ void r_context_register_progress_callback(progress_callback progress_cb);

RaucContext *r_context_conf(void);
const RaucContext *r_context(void);
void r_context_clean(void);
void r_context_clean(void);
4 changes: 3 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
GMainLoop *r_loop = NULL;
int r_exit_status = 0;

gboolean install_ignore_compatible, install_progressbar = FALSE;
gboolean install_ignore_compatible, install_progressbar, install_ignore_slot_as_seed = FALSE;
gboolean info_noverify, info_dumpcert = FALSE;
gboolean status_detailed = FALSE;
gchar *output_format = NULL;
Expand Down Expand Up @@ -220,6 +220,7 @@ static gboolean install_start(int argc, char **argv)
args->status_result = 2;

r_context_conf()->ignore_compatible = install_ignore_compatible;
r_context_conf()->ignore_slot_as_seed = install_ignore_slot_as_seed;

r_loop = g_main_loop_new(NULL, FALSE);
if (ENABLE_SERVICE) {
Expand Down Expand Up @@ -1703,6 +1704,7 @@ typedef struct {

GOptionEntry entries_install[] = {
{"ignore-compatible", '\0', 0, G_OPTION_ARG_NONE, &install_ignore_compatible, "disable compatible check", NULL},
{"ignore-seed", '\0', 0, G_OPTION_ARG_NONE, &install_ignore_slot_as_seed, "disable using slot as seed", NULL},
{"progress", '\0', 0, G_OPTION_ARG_NONE, &install_progressbar, "show progress bar", NULL},
{0}
};
Expand Down
9 changes: 6 additions & 3 deletions src/update_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,12 @@ static gboolean casync_extract_image(RaucImage *image, gchar *dest, GError **err
}
seed_mounted = TRUE;
}

g_debug("Adding as casync directory tree seed: %s", seedslot->mount_point);
seed = g_strdup(seedslot->mount_point);
if (!r_context()->ignore_compatible) {
g_debug("Adding as casync directory tree seed: %s", seedslot->mount_point);
seed = g_strdup(seedslot->mount_point);
}else {
g_debug("Skipping to use tree seed: %s", seedslot->mount_point);
}
} else {
g_debug("Adding as casync blob seed: %s", seedslot->device);
seed = g_strdup(seedslot->device);
Expand Down

0 comments on commit 03665b7

Please sign in to comment.