diff --git a/docs/env.md b/docs/env.md index cc1ce247c..6e3d72b96 100644 --- a/docs/env.md +++ b/docs/env.md @@ -20,6 +20,7 @@ with a non-standard filesystem layout. * `FWUPD_DOWNLOAD_VERBOSE` can be used to show wget or curl output * `FWUPD_PROFILE` can be used to set the profile traceback threshold value in ms * `FWUPD_FUZZER_RUNNING` if the firmware format is being fuzzed +* `FWUPD_POLKIT_NOCHECK` if we should not check for polkit policies to be installed * standard glibc variables like `LANG` are also honored for CLI tools that are translated * libcurl respects the session proxy, e.g. `http_proxy`, `all_proxy`, `sftp_proxy` and `no_proxy` diff --git a/src/fu-util.c b/src/fu-util.c index 351ecc318..46903479d 100644 --- a/src/fu-util.c +++ b/src/fu-util.c @@ -3706,9 +3706,14 @@ static gboolean fu_util_check_polkit_actions(GError **error) { #ifdef HAVE_POLKIT - g_autofree gchar *directory = fu_path_from_kind(FU_PATH_KIND_POLKIT_ACTIONS); - g_autofree gchar *filename = - g_build_filename(directory, "org.freedesktop.fwupd.policy", NULL); + g_autofree gchar *directory = NULL; + g_autofree gchar *filename = NULL; + + if (g_getenv("FWUPD_POLKIT_NOCHECK") != NULL) + return TRUE; + + directory = fu_path_from_kind(FU_PATH_KIND_POLKIT_ACTIONS); + filename = g_build_filename(directory, "org.freedesktop.fwupd.policy", NULL); if (!g_file_test(filename, G_FILE_TEST_IS_REGULAR)) { g_set_error_literal( error,