mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-17 22:03:45 +00:00
Dynamically read path to use for /system-update
This allows `fwupdoffline` to work in installations that don't use `/var/lib/fwupd`.
This commit is contained in:
parent
acfa4ef012
commit
e1b4b20978
@ -1,7 +1,7 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Updates device firmware whilst offline
|
Description=Updates device firmware whilst offline
|
||||||
Documentation=man:fwupdmgr
|
Documentation=man:fwupdmgr
|
||||||
ConditionPathExists=/var/lib/fwupd/pending.db
|
ConditionPathExists=@localstatedir@/lib/fwupd/pending.db
|
||||||
DefaultDependencies=false
|
DefaultDependencies=false
|
||||||
Requires=sysinit.target dbus.socket
|
Requires=sysinit.target dbus.socket
|
||||||
After=sysinit.target system-update-pre.target dbus.socket systemd-journald.socket
|
After=sysinit.target system-update-pre.target dbus.socket systemd-journald.socket
|
||||||
|
@ -141,6 +141,7 @@ main (int argc, char *argv[])
|
|||||||
gint vercmp;
|
gint vercmp;
|
||||||
guint cnt = 0;
|
guint cnt = 0;
|
||||||
g_autofree gchar *link = NULL;
|
g_autofree gchar *link = NULL;
|
||||||
|
g_autofree gchar *target = fu_common_get_path (FU_PATH_KIND_LOCALSTATEDIR_PKG);
|
||||||
g_autoptr(FuHistory) history = NULL;
|
g_autoptr(FuHistory) history = NULL;
|
||||||
g_autoptr(FwupdClient) client = NULL;
|
g_autoptr(FwupdClient) client = NULL;
|
||||||
g_autoptr(GError) error = NULL;
|
g_autoptr(GError) error = NULL;
|
||||||
@ -157,7 +158,7 @@ main (int argc, char *argv[])
|
|||||||
link = g_file_read_link (FU_OFFLINE_TRIGGER_FILENAME, NULL);
|
link = g_file_read_link (FU_OFFLINE_TRIGGER_FILENAME, NULL);
|
||||||
if (link == NULL)
|
if (link == NULL)
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
if (g_strcmp0 (link, "/var/lib/fwupd") != 0)
|
if (g_strcmp0 (link, target) != 0)
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
|
|
||||||
/* do this first to avoid a loop if this tool segfaults */
|
/* do this first to avoid a loop if this tool segfaults */
|
||||||
|
@ -863,9 +863,9 @@ fu_plugin_runner_offline_invalidate (GError **error)
|
|||||||
static gboolean
|
static gboolean
|
||||||
fu_plugin_runner_offline_setup (GError **error)
|
fu_plugin_runner_offline_setup (GError **error)
|
||||||
{
|
{
|
||||||
const gchar *symlink_target = "/var/lib/fwupd";
|
|
||||||
gint rc;
|
gint rc;
|
||||||
g_autofree gchar *filename = NULL;
|
g_autofree gchar *filename = NULL;
|
||||||
|
g_autofree gchar *symlink_target = fu_common_get_path (FU_PATH_KIND_LOCALSTATEDIR_PKG);
|
||||||
|
|
||||||
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user