mirror of
https://git.proxmox.com/git/fwupd
synced 2025-05-25 03:46:47 +00:00
Wait for device reboot when using fwupdtool detach
This commit is contained in:
parent
a346c582cc
commit
448772b73e
@ -26,6 +26,7 @@
|
||||
#include "fu-cabinet.h"
|
||||
#include "fu-context-private.h"
|
||||
#include "fu-debug.h"
|
||||
#include "fu-device-list.h"
|
||||
#include "fu-device-private.h"
|
||||
#include "fu-engine.h"
|
||||
#include "fu-history.h"
|
||||
@ -1521,6 +1522,7 @@ static gboolean
|
||||
fu_util_detach(FuUtilPrivate *priv, gchar **values, GError **error)
|
||||
{
|
||||
g_autoptr(FuDevice) device = NULL;
|
||||
g_autoptr(FuDeviceList) device_list = fu_device_list_new();
|
||||
g_autoptr(FuDeviceLocker) locker = NULL;
|
||||
|
||||
/* load engine */
|
||||
@ -1545,7 +1547,18 @@ fu_util_detach(FuUtilPrivate *priv, gchar **values, GError **error)
|
||||
locker = fu_device_locker_new(device, error);
|
||||
if (locker == NULL)
|
||||
return FALSE;
|
||||
return fu_device_detach_full(device, priv->progress, error);
|
||||
fu_device_list_add(device_list, device);
|
||||
if (!fu_device_detach_full(device, priv->progress, error))
|
||||
return FALSE;
|
||||
|
||||
/* wait for replug */
|
||||
if (!priv->no_safety_check) {
|
||||
if (!fu_device_list_wait_for_replug(device_list, error))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* success */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@ -1618,6 +1631,7 @@ static gboolean
|
||||
fu_util_attach(FuUtilPrivate *priv, gchar **values, GError **error)
|
||||
{
|
||||
g_autoptr(FuDevice) device = NULL;
|
||||
g_autoptr(FuDeviceList) device_list = fu_device_list_new();
|
||||
g_autoptr(FuDeviceLocker) locker = NULL;
|
||||
|
||||
/* load engine */
|
||||
@ -1642,7 +1656,18 @@ fu_util_attach(FuUtilPrivate *priv, gchar **values, GError **error)
|
||||
locker = fu_device_locker_new(device, error);
|
||||
if (locker == NULL)
|
||||
return FALSE;
|
||||
return fu_device_attach_full(device, priv->progress, error);
|
||||
fu_device_list_add(device_list, device);
|
||||
if (!fu_device_attach_full(device, priv->progress, error))
|
||||
return FALSE;
|
||||
|
||||
/* wait for replug */
|
||||
if (!priv->no_safety_check) {
|
||||
if (!fu_device_list_wait_for_replug(device_list, error))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* success */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
Loading…
Reference in New Issue
Block a user