1LIBFWUP(3) Library Functions Manual LIBFWUP(3)
2
3
4
6 libfwup - library to support management of system firmware updates
7
9 #include <fwup.h>
10
11 int fwup_supported(void);
12 - test if firmware updating is supported on the running machine
13
14 typedef struct fwup_resource_s fwup_resource;
15 typedef struct fwup_resource_iter_s fwup_resource_iter;
16
17 int fwup_resource_iter_create(fwup_resource_iter **iter);
18 int fwup_resource_iter_next(fwup_resource_iter *iter,
19 fwup_resource **re);
20 int fwup_resource_iter_destroy(fwup_resource_iter **iter);
21 - iterate the list of updateable firmware images
22
23 int fwup_set_guid(fwup_resource_iter *iter, fwup_resource **re,
24 const efi_guid_t *guid);
25 - manually set a guid for update
26
27 int fwup_set_guid_forced(fwup_resource_iter *iter, fwup_resource **re,
28 const efi_guid_t *guid, bool force);
29 - manually set a guid for update (with a force option)
30
31 void fwup_resource_free(fwup_resource *re);
32 - free resource allocated by fwup_set_guid_forced()
33
34 int fwup_set_up_update(fwup_resource *re, uint64_t hw_inst, int infd);
35 int fwup_clear_status(fwup_resource *re);
36 int fwup_get_guid(fwup_resource *re, efi_guid_t **guid);
37 int fwup_get_fw_version(fwup_resource *re, uint32_t *version);
38 int fwup_get_fw_type(fwup_resource *re, uint32_t *type);
39 int fwup_get_lowest_supported_fw_version(fwup_resource *re,
40 uint32_t *version);
41 int fwup_get_last_attempt_info(fwup_resource *re, uint32_t *version,
42 uint32_t *status, time_t *when);
43 - operate on an individual firmware entry
44
45 int fwup_get_debug_log(char **utf8, size_t *size);
46 - show the debug log from the last update attempt
47
48 void fwup_use_existing_media_path(int use_existing_media_path);
49 - instruct fwupdate on whether to reuse old capsule filenames on the ESP.
50
51 void fwup_set_esp_mountpoint(char *path);
52 - Override detection of the mountpoint for the ESP directory
53
54 const char *fwup_get_esp_mountpoint(void);
55 - Get the current mountpoint for the ESP directory
56
57 int fwup_get_ux_capsule_info(uint32_t *screen_x_size,
58 uint32_t *screen_y_size);
59 - get the dimensions of the screen during boot
60
62 int fwup_supported(void);
63 Tests if the current machine supports firmware updates
64
65 typedef struct fwup_resource_s fwup_resource;
66 typedef struct fwup_resource_iter_s fwup_resource_iter;
67
68 int fwup_resource_iter_create(fwup_resource_iter **iter);
69 Create a new firmware resoure iterator iter.
70
71 int fwup_resource_iter_next(fwup_resource_iter *iter,
72 fwup_resource **re);
73 Get the next firmware resource re from iterator iter.
74
75 int fwup_resource_iter_destroy(fwup_resource_iter **iter);
76 Destroy firmware resource iterator iter.
77
78 int fwup_set_up_update(fwup_resource *re, uint64_t hw_inst, int infd);
79 Set up an update for resource re, hardware instance number hw_inst,
80 with the file referenced by the file descriptor infd. infd must
81 support read[1m(3).
82
83 int fwup_clear_status(fwup_resource *re);
84 Clear the status of the firmware resource re. This removes any pending
85 attempt to update it, as well as clearing any pending error report.
86
87 int fwup_get_guid(fwup_resource *re, efi_guid_t **guid);
88 Set guid to the GUID which uniquely identifies firmware resource re.
89
90 int fwup_get_fw_version(fwup_resource *re, uint32_t *version);
91 Set version to the version of the firmware resource re.
92
93 #define FWUP_RESOURCE_TYPE_UNKNOWN 0
94 #define FWUP_RESOURCE_TYPE_SYSTEM_FIRMWARE 1
95 #define FWUP_RESOURCE_TYPE_DEVICE_FIRMWARE 2
96 #define FWUP_RESOURCE_TYPE_UEFI_DRIVER 3
97 int fwup_get_fw_type(fwup_resource *re, uint32_t *type);
98 Set type to the type of the firmware resource re.
99
100 int fwup_get_lowest_supported_fw_version(fwup_resource *re,
101 uint32_t *version);
102 Set version to the lowest firmware version resource re can be
103 updated to.
104
105 int fwup_get_last_attempt_info(fwup_resource *re, uint32_t *version,
106 uint32_t *status, time_t *when);
107 Get the status for the last attempt to update firmware resource re.
108
109 int fwup_get_debug_log(char **utf8, size_t *size);
110 Get the debug log from the last update attempt. This allocates a buffer
111 which the caller must free.
112
113 void fwup_print_update_info(void);
114 Print the information of firmware update status.
115
116 void fwup_use_existing_media_path(int use_existing_media_path);
117 Instruct fwupdate on whether to reuse old capsule filenames on the ESP.
118
119 void fwup_set_esp_mountpoint(char *path);
120 Override detection of the mountpoint for the ESP directory.
121
122 int fwup_get_ux_capsule_info(uint32_t *screen_x_size,
123 uint32_t *screen_y_size);
124 Get the dimensions of the screen during boot.
125
127 Peter Jones <pjones@redhat.com>
128
130 errno(3), strerror(3), strerror_r(3)
131
132
133
134 Mon 11 May 2015 LIBFWUP(3)