Skip to content

Commit

Permalink
Add a fwupd.conf option to ignore requirements for development
Browse files Browse the repository at this point in the history
  • Loading branch information
hughsie committed May 22, 2024
1 parent bddcbbb commit c756017
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/fwupd.conf.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ The `[fwupd]` section can contain the following parameters:

Ignore power levels of devices when running updates.

**IgnoreRequirements={{IgnoreRequirements}}**

Ignore some device requirements, for instance removing the generic GUID requirement of a CHID,
child, parent or sibling.
This is not recommended for production systems, although it may be useful for firmware development.

**OnlyTrusted={{OnlyTrusted}}**

Only support installing firmware signed with a trusted key.
Expand Down
4 changes: 4 additions & 0 deletions src/fu-daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1906,6 +1906,10 @@ fu_daemon_daemon_method_call(GDBusConnection *connection,
}
helper->stream = fu_unix_seekable_input_stream_new(fd, TRUE);

/* relax these */
if (fu_engine_config_get_ignore_requirements(fu_engine_get_config(self->engine)))
helper->flags |= FWUPD_INSTALL_FLAG_IGNORE_REQUIREMENTS;

/* install all the things in the store */
helper->client = fu_client_list_register(self->client_list, sender);
helper->client_sender_changed_id =
Expand Down
7 changes: 7 additions & 0 deletions src/fu-engine-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,12 @@ fu_engine_config_get_allow_emulation(FuEngineConfig *self)
return fu_config_get_value_bool(FU_CONFIG(self), "fwupd", "AllowEmulation");
}

gboolean
fu_engine_config_get_ignore_requirements(FuEngineConfig *self)
{
return fu_config_get_value_bool(FU_CONFIG(self), "fwupd", "IgnoreRequirements");
}

gboolean
fu_engine_config_get_release_dedupe(FuEngineConfig *self)
{
Expand Down Expand Up @@ -409,6 +415,7 @@ fu_engine_config_init(FuEngineConfig *self)
fu_engine_set_config_default(self, "IdleTimeout", "300"); /* s */
fu_engine_set_config_default(self, "IdleInhibitStartupThreshold", "500"); /* ms */
fu_engine_set_config_default(self, "IgnorePower", "false");
fu_engine_set_config_default(self, "IgnoreRequirements", "false");
fu_engine_set_config_default(self, "OnlyTrusted", "true");
fu_engine_set_config_default(self, "P2pPolicy", FU_DEFAULT_P2P_POLICY);
fu_engine_set_config_default(self, "ReleaseDedupe", "true");
Expand Down
2 changes: 2 additions & 0 deletions src/fu-engine-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ fu_engine_config_get_test_devices(FuEngineConfig *self) G_GNUC_NON_NULL(1);
gboolean
fu_engine_config_get_allow_emulation(FuEngineConfig *self) G_GNUC_NON_NULL(1);
gboolean
fu_engine_config_get_ignore_requirements(FuEngineConfig *self) G_GNUC_NON_NULL(1);
gboolean
fu_engine_config_get_release_dedupe(FuEngineConfig *self) G_GNUC_NON_NULL(1);
FuReleasePriority
fu_engine_config_get_release_priority(FuEngineConfig *self) G_GNUC_NON_NULL(1);
Expand Down

0 comments on commit c756017

Please sign in to comment.