Skip to content

Commit

Permalink
Merge pull request #92 from ejoerns/v0/topic/check-mounted
Browse files Browse the repository at this point in the history
install: check that destination device is not mounted
  • Loading branch information
jluebbe committed Jan 30, 2017
2 parents b89a231 + 6c03ab3 commit 21670e4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/install.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ typedef enum {
R_INSTALL_ERROR_TARGET_GROUP,
R_INSTALL_ERROR_DOWNLOAD_MF,
R_INSTALL_ERROR_HANDLER,
R_INSTALL_ERROR_NO_SUPPORTED
R_INSTALL_ERROR_NO_SUPPORTED,
R_INSTALL_ERROR_MOUNTED
} RInstallError;

typedef struct {
Expand Down
7 changes: 7 additions & 0 deletions src/install.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,13 @@ static gboolean launch_and_wait_default_handler(RaucInstallArgs *args, gchar* bu
goto out;
}

if (dest_slot->mount_point) {
res = FALSE;
g_set_error(error, R_INSTALL_ERROR, R_INSTALL_ERROR_MOUNTED,
"Destination device '%s' already mounted", dest_slot->device);
goto out;
}

/* determine whether update image type is compatible with destination slot type */
update_handler = get_update_handler(mfimage, dest_slot, &ierror);
if (update_handler == NULL) {
Expand Down

0 comments on commit 21670e4

Please sign in to comment.