Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore SD card state changes when not SD card is not used #88

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions app/dockerdwrapperwithcompose.c
Original file line number Diff line number Diff line change
Expand Up @@ -743,10 +743,12 @@ static void
sd_card_callback(const char *sd_card_area, void *app_state_void_ptr)
{
struct app_state *app_state = app_state_void_ptr;
if (!sd_card_area)
const bool using_sd_card = is_parameter_yes(PARAM_SD_CARD_SUPPORT);
if (using_sd_card && !sd_card_area)
stop_dockerd(); // Block here until dockerd has stopped using the SD card.
app_state->sd_card_area = sd_card_area ? strdup(sd_card_area) : NULL;
g_main_loop_quit(loop); // Trigger a restart of dockerd from main()
if (using_sd_card)
g_main_loop_quit(loop); // Trigger a restart of dockerd from main()
}

// Stop the application and start it from an SSH prompt with
Expand Down
6 changes: 4 additions & 2 deletions app/sd_disk_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

typedef void (*SdDiskCallback)(const char *area_path, void *user_data);

// Call sd_disk_callback with a path to the SD card when it has become available
// and with NULL when it is about to be unmounted.
// Call sd_disk_callback with a path to the SD card when it has become
// available. Call sd_disk_callback with NULL when it is about to be unmounted.
// Unmounting will fail if the SD card area contains open files when the
// callback returns.
struct sd_disk_storage *sd_disk_storage_init(SdDiskCallback sd_disk_callback,
void *user_data);

Expand Down