Skip to content

Commit

Permalink
Check for needs-shutdown like we do needs-reboot
Browse files Browse the repository at this point in the history
  • Loading branch information
hughsie committed May 24, 2024
1 parent b42ad1d commit 47d89dc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/fu-engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -1903,7 +1903,8 @@ fu_engine_publish_release(FuEngine *self, FuRelease *release, GError **error)
g_autofree gchar *checksum = NULL;
g_autoptr(GError) error_passim = NULL;
g_autoptr(PassimItem) passim_item = passim_item_new();
if (fu_device_has_flag(device, FWUPD_DEVICE_FLAG_NEEDS_REBOOT))
if (fu_device_has_flag(device, FWUPD_DEVICE_FLAG_NEEDS_REBOOT) ||
fu_device_has_flag(device, FWUPD_DEVICE_FLAG_NEEDS_SHUTDOWN))
passim_item_add_flag(passim_item, PASSIM_ITEM_FLAG_NEXT_REBOOT);
passim_item_set_max_age(passim_item, 30 * 24 * 60 * 60);
passim_item_set_share_limit(passim_item, 50);
Expand Down Expand Up @@ -1942,6 +1943,7 @@ fu_engine_install_release_version_check(FuEngine *self,
if (version_rel != NULL && fu_version_compare(version_old, version_rel, fmt) != 0 &&
fu_version_compare(version_old, fu_device_get_version(device), fmt) == 0 &&
!fu_device_has_flag(device, FWUPD_DEVICE_FLAG_NEEDS_REBOOT) &&
!fu_device_has_flag(device, FWUPD_DEVICE_FLAG_NEEDS_SHUTDOWN) &&
!fu_device_has_flag(device, FWUPD_DEVICE_FLAG_NEEDS_ACTIVATION)) {
fu_device_set_update_state(device, FWUPD_UPDATE_STATE_FAILED);
g_set_error(error,
Expand Down

0 comments on commit 47d89dc

Please sign in to comment.