diff --git a/README.md b/README.md index d5523a3..08e5a4f 100644 --- a/README.md +++ b/README.md @@ -275,10 +275,10 @@ Following are the possible values of `Status`: 0 RUNNING The application is started and dockerd is running. 1 TLS CERT MISSING Use TLS is selected but there but certificates are missing on the device. The application is running but dockerd is stopped. - Upload certificates and restart the application. + Upload certificates and restart the application or de-select Use TLS. 2 NO SOCKET Neither TCP Socket or IPC Socket are selected. - The application has stopped. - Select one or both sockets and start the application. + The application is running but dockerd is stopped. + Select one or both sockets. 3 NO SD CARD Use SD Card is selected but no SD Card is mounted in the device. The application is running but dockerd is stopped. Insert and mount a SD Card. @@ -289,7 +289,12 @@ Following are the possible values of `Status`: permissions to use it. The application is running but dockerd is stopped. Make sure no directories with the wrong user permissions are left on the - SD Card. + SD Card. Then restart the application. + 6 SD CARD MIGRATION FAILED Use SD Card is selected but migrating data from the old data root location to the + new one has failed. + The application is running but dockerd is stopped. + Manually back up and remove either the old data root folder, or the new + data root folder, from the SD card. Then restart the application. ``` ## Building the Docker Compose ACAP diff --git a/app/dockerdwrapperwithcompose.c b/app/dockerdwrapperwithcompose.c index 824204b..1802069 100644 --- a/app/dockerdwrapperwithcompose.c +++ b/app/dockerdwrapperwithcompose.c @@ -47,6 +47,7 @@ typedef enum { STATUS_NO_SD_CARD, STATUS_SD_CARD_WRONG_FS, STATUS_SD_CARD_WRONG_PERMISSION, + STATUS_SD_CARD_MIGRATION_FAILED, STATUS_CODE_COUNT, } status_code_t; @@ -56,7 +57,8 @@ static const char* const status_code_strs[STATUS_CODE_COUNT] = {"-1 NOT STARTED" "2 NO SOCKET", "3 NO SD CARD", "4 SD CARD WRONG FS", - "5 SD CARD WRONG PERMISSION"}; + "5 SD CARD WRONG PERMISSION", + "6 SD CARD MIGRATION FAILED"}; struct settings { char* data_root; @@ -351,6 +353,7 @@ static bool setup_sdcard(AXParameter* param_handle, const char* data_root) { if (!migrate_from_old_sdcard_setup(data_root)) { log_error("Failed to migrate data from old data-root"); + set_status_parameter(param_handle, STATUS_SD_CARD_MIGRATION_FAILED); return false; } @@ -381,6 +384,7 @@ static char* prepare_data_root(AXParameter* param_handle, const char* sd_card_ar if (is_parameter_yes(param_handle, PARAM_SD_CARD_SUPPORT)) { if (!sd_card_area) { log_error("SD card was requested, but no SD card is available at the moment."); + set_status_parameter(param_handle, STATUS_NO_SD_CARD); return NULL; } char* data_root = g_strdup_printf("%s/data", sd_card_area);