aboutsummaryrefslogtreecommitdiff
path: root/sysutils/fwupd/files
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/fwupd/files')
-rw-r--r--sysutils/fwupd/files/extrapatch14-meson.build10
-rw-r--r--sysutils/fwupd/files/patch-libfwupdplugin_fu-common-freebsd.c57
-rw-r--r--sysutils/fwupd/files/patch-libfwupdplugin_fu-freebsd-efivars.c16
-rw-r--r--sysutils/fwupd/files/patch-libfwupdplugin_fu-kernel.c12
4 files changed, 77 insertions, 18 deletions
diff --git a/sysutils/fwupd/files/extrapatch14-meson.build b/sysutils/fwupd/files/extrapatch14-meson.build
deleted file mode 100644
index 3065b094040c..000000000000
--- a/sysutils/fwupd/files/extrapatch14-meson.build
+++ /dev/null
@@ -1,10 +0,0 @@
---- meson.build.orig 2025-09-12 09:55:19 UTC
-+++ meson.build
-@@ -484,6 +484,7 @@ if get_option('default_library') != 'static'
- endif
- if host_machine.system() == 'freebsd'
- platform_deps += dependency('efivar')
-+ platform_deps += dependency('libinotify')
- endif
- endif
-
diff --git a/sysutils/fwupd/files/patch-libfwupdplugin_fu-common-freebsd.c b/sysutils/fwupd/files/patch-libfwupdplugin_fu-common-freebsd.c
new file mode 100644
index 000000000000..b7c9824d6f76
--- /dev/null
+++ b/sysutils/fwupd/files/patch-libfwupdplugin_fu-common-freebsd.c
@@ -0,0 +1,57 @@
+--- libfwupdplugin/fu-common-freebsd.c.orig 2025-09-12 09:55:19 UTC
++++ libfwupdplugin/fu-common-freebsd.c
+@@ -14,6 +14,7 @@
+
+ #include "fu-common-private.h"
+ #include "fu-kenv.h"
++#include "fu-path.h"
+
+ /* bsdisks doesn't provide Manager object */
+ #define UDISKS_DBUS_PATH "/org/freedesktop/UDisks2"
+@@ -122,9 +123,45 @@ fu_common_get_olson_timezone_id_impl(GError **error)
+ gchar *
+ fu_common_get_olson_timezone_id_impl(GError **error)
+ {
++ g_autofree gchar *fn_localtime = fu_path_from_kind(FU_PATH_KIND_LOCALTIME);
++ g_autoptr(GFile) file_localtime = g_file_new_for_path(fn_localtime);
++
++ /* use the last two sections of the symlink target */
++ g_debug("looking for timezone file %s", fn_localtime);
++ if (g_file_query_file_type(file_localtime, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL) ==
++ G_FILE_TYPE_SYMBOLIC_LINK) {
++ const gchar *target;
++ g_autoptr(GFileInfo) info = NULL;
++
++ info = g_file_query_info(file_localtime,
++ G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET,
++ G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
++ NULL,
++ error);
++ if (info == NULL)
++ return NULL;
++ target = g_file_info_get_symlink_target(info);
++ if (target != NULL) {
++ g_auto(GStrv) sections = g_strsplit(target, "/", -1);
++ guint sections_len = g_strv_length(sections);
++ if (sections_len < 2) {
++ g_set_error(error,
++ FWUPD_ERROR,
++ FWUPD_ERROR_NOT_SUPPORTED,
++ "invalid symlink target: %s",
++ target);
++ return NULL;
++ }
++ return g_strdup_printf("%s/%s",
++ sections[sections_len - 2],
++ sections[sections_len - 1]);
++ }
++ }
++
++ /* failed */
+ g_set_error_literal(error,
+ FWUPD_ERROR,
+ FWUPD_ERROR_NOT_SUPPORTED,
+- "getting the Olson timezone ID is not supported on FreeBSD");
++ "no timezone or localtime is available");
+ return NULL;
+ }
diff --git a/sysutils/fwupd/files/patch-libfwupdplugin_fu-freebsd-efivars.c b/sysutils/fwupd/files/patch-libfwupdplugin_fu-freebsd-efivars.c
index b8a904985b6a..338327a4b159 100644
--- a/sysutils/fwupd/files/patch-libfwupdplugin_fu-freebsd-efivars.c
+++ b/sysutils/fwupd/files/patch-libfwupdplugin_fu-freebsd-efivars.c
@@ -1,4 +1,4 @@
---- libfwupdplugin/fu-freebsd-efivars.c.orig 2025-09-12 09:55:19 UTC
+--- libfwupdplugin/fu-freebsd-efivars.c.orig 2025-11-05 16:06:16 UTC
+++ libfwupdplugin/fu-freebsd-efivars.c
@@ -67,7 +67,7 @@ fu_freebsd_efivars_delete_with_glob(FuEfivars *efivars
@@ -15,19 +15,19 @@
efi_str_to_guid(guid, &test);
- while (efi_get_next_variable_name(&guidt, &name)) {
+ while (efi_get_next_variable_name(&guidt, &name) == 1) {
- if (memcmp(&test, guidt, sizeof(test)) == 0) {
+ if (memcmp(&test, guidt, sizeof(test)) == 0)
return TRUE;
- }
-@@ -129,7 +129,7 @@ fu_freebsd_efivars_get_names(FuEfivars *efivars, const
+ }
+@@ -128,7 +128,7 @@ fu_freebsd_efivars_get_names(FuEfivars *efivars, const
efi_str_to_guid(guid, &test);
/* find names with matching GUID */
- while (efi_get_next_variable_name(&guidt, &name)) {
+ while (efi_get_next_variable_name(&guidt, &name) == 1) {
- if (memcmp(&test, guidt, sizeof(test)) == 0) {
+ if (memcmp(&test, guidt, sizeof(test)) == 0)
g_ptr_array_add(names, g_strdup(name));
- }
-@@ -156,7 +156,7 @@ fu_freebsd_efivars_space_used(FuEfivars *efivars, GErr
+ }
+@@ -154,7 +154,7 @@ fu_freebsd_efivars_space_used(FuEfivars *efivars, GErr
efi_guid_t *guidt = NULL;
char *name = NULL;
@@ -36,7 +36,7 @@
size_t size = 0;
if (efi_get_variable_size(*guidt, name, &size) < 0) {
g_set_error_literal(error,
-@@ -184,7 +184,7 @@ fu_freebsd_efivars_set_data(FuEfivars *efivars,
+@@ -182,7 +182,7 @@ fu_freebsd_efivars_set_data(FuEfivars *efivars,
efi_guid_t guidt;
efi_str_to_guid(guid, &guidt);
diff --git a/sysutils/fwupd/files/patch-libfwupdplugin_fu-kernel.c b/sysutils/fwupd/files/patch-libfwupdplugin_fu-kernel.c
new file mode 100644
index 000000000000..47d1e1e0594e
--- /dev/null
+++ b/sysutils/fwupd/files/patch-libfwupdplugin_fu-kernel.c
@@ -0,0 +1,12 @@
+--- libfwupdplugin/fu-kernel.c.orig 2025-09-12 09:55:19 UTC
++++ libfwupdplugin/fu-kernel.c
+@@ -329,6 +329,9 @@ fu_kernel_get_cmdline(GError **error)
+ if (!g_file_get_contents("/proc/cmdline", &buf, &bufsz, error))
+ return NULL;
+ return fu_kernel_parse_cmdline(buf, bufsz);
++#elif defined(__FreeBSD__)
++ // XXX: there is no /proc/cmdline equivalent
++ return fu_kernel_parse_cmdline("", 0);
+ #else
+ g_set_error_literal(error,
+ FWUPD_ERROR,