Merge tag '0.7.2' into debian-next
Release fwupd 0.7.2
Mario Limonciello
7 years ago
0 | Version 0.7.2 | |
1 | ~~~~~~~~~~~~~ | |
2 | Released: 2016-06-13 | |
3 | ||
4 | New Features: | |
5 | - Add a GetDetailsLocal() method to eventually replace GetDetails() (Richard Hughes) | |
6 | - Add fu_device_get_alternate() (Richard Hughes) | |
7 | - Allow devices to have multiple assigned GUIDs (Richard Hughes) | |
8 | - Allow metainfo files to match only specific revisions of devices (Richard Hughes) | |
9 | - Show the DFU protocol version in 'dfu-tool list' (Richard Hughes) | |
10 | ||
11 | Bugfixes: | |
12 | - Enforce allowing providers to take away flash abilities (Mario Limonciello) | |
13 | - Only claim the DFU interface when required (Richard Hughes) | |
14 | - Only return updatable devices from GetDevices() (Richard Hughes) | |
15 | ||
16 | Version 0.7.1 | |
17 | ~~~~~~~~~~~~~ | |
18 | Released: 2016-05-13 | |
19 | ||
20 | New Features: | |
21 | - Add a --force flag to override provider warnings (Mario Limonciello) | |
22 | - Add device-added, device-removed and device-changed signals (Richard Hughes) | |
23 | - Add dfu_image_get_element_default() (Richard Hughes) | |
24 | - Add for a new device field "Flashes Left" (Mario Limonciello) | |
25 | - Add fwupd_client_connect() (Richard Hughes) | |
26 | - Add the 'monitor' debugging command for fwupdmgr (Richard Hughes) | |
27 | - Add the 'supported' flag to the FuDevice (Richard Hughes) | |
28 | ||
29 | Bugfixes: | |
30 | - Add summary and name field for Rival SteelSeries (Mario Limonciello) | |
31 | - Fix a critical warning when restarting the daemon (Richard Hughes) | |
32 | - Fix BE issues when reading and writing DFU files (Mario Limonciello, Richard Hughes) | |
33 | - Make the device display name nicer (Richard Hughes, Richard Hughes) | |
34 | - Match the AppStream metadata after a device has been added (Richard Hughes) | |
35 | - Remove non-interactive pinentry setting from fu-keyring (Mario Limonciello) | |
36 | - Return all update descriptions newer than the installed version (Richard Hughes) | |
37 | - Set the device description when parsing local firmware files (Richard Hughes) | |
38 | ||
0 | 39 | Version 0.7.0 |
1 | 40 | ~~~~~~~~~~~~~ |
2 | 41 | Released: 2016-04-01 |
1 | 1 | |
2 | 2 | 1. Write NEWS entries for fwupd in the same format as usual. |
3 | 3 | |
4 | git shortlog 0.6.3.. | grep -i -v trivial | grep -v Merge > NEWS.new | |
4 | git shortlog 0.7.1.. | grep -i -v trivial | grep -v Merge > NEWS.new | |
5 | 5 | |
6 | Version 0.7.0 | |
6 | Version 0.7.2 | |
7 | 7 | ~~~~~~~~~~~~~ |
8 | 8 | Released: 2016-xx-xx |
9 | 9 | |
23 | 23 | 2. Commit changes to git: |
24 | 24 | |
25 | 25 | # MAKE SURE THESE ARE CORRECT |
26 | export release_ver="0.7.0" | |
26 | export release_ver="0.7.2" | |
27 | 27 | |
28 | 28 | git commit -a -m "Release fwupd ${release_ver}" |
29 | 29 | git tag -s -f -m "Release fwupd ${release_ver}" "${release_ver}" |
2 | 2 | |
3 | 3 | m4_define([fwupd_major_version], [0]) |
4 | 4 | m4_define([fwupd_minor_version], [7]) |
5 | m4_define([fwupd_micro_version], [0]) | |
5 | m4_define([fwupd_micro_version], [2]) | |
6 | 6 | m4_define([fwupd_version], |
7 | 7 | [fwupd_major_version.fwupd_minor_version.fwupd_micro_version]) |
8 | 8 |
2 | 2 | |
3 | 3 | <!-- SteelSeries legacy hardware --> |
4 | 4 | <component type="firmware"> |
5 | <name>Rival SteelSeries</name> | |
6 | <summary>Firmware for Rival SteelSeries mice</summary> | |
5 | 7 | <id>com.steelseries.rival-legacy.firmware</id> |
6 | 8 | <provides> |
7 | 9 | <!-- 1038:1702 = Rival 100 --> |
0 | 0 | test_files = \ |
1 | 1 | colorhug-als-3.0.2.cab |
2 | 2 | |
3 | colorhug-als-3.0.2.cab: firmware.bin firmware.bin.asc firmware.inf firmware.metainfo.xml | |
3 | colorhug-als-3.0.2.cab: firmware.bin firmware.bin.asc firmware.metainfo.xml | |
4 | 4 | $(AM_V_GEN) touch -c -m -d"2000-01-01T00:00:00" $?; \ |
5 | 5 | $(GCAB) --create --nopath $@ \ |
6 | 6 | $(srcdir)/firmware.bin \ |
7 | 7 | $(srcdir)/firmware.bin.asc \ |
8 | $(srcdir)/firmware.inf \ | |
9 | 8 | $(srcdir)/firmware.metainfo.xml |
10 | 9 | |
11 | 10 | BUILT_SOURCES = \ |
18 | 17 | $(test_files) \ |
19 | 18 | firmware.bin \ |
20 | 19 | firmware.bin.asc \ |
21 | firmware.inf \ | |
22 | 20 | firmware.metainfo.xml |
23 | 21 | |
24 | 22 | -include $(top_srcdir)/git.mk |
0 | ; Copyright (C) 2015 Hughski Limited | |
1 | ||
2 | [Version] | |
3 | Class=Firmware | |
4 | ClassGuid={f2e7dd72-6468-4e36-b6f1-6488f42c1b52} | |
5 | DriverVer=03/03/2015,3.0.2 | |
6 | ||
7 | [Firmware_CopyFiles] | |
8 | firmware.bin | |
9 | ||
10 | [Firmware_AddReg] | |
11 | HKR,,FirmwareId,,{84f40464-9272-4ef7-9399-cd95f12da696} | |
12 | HKR,,FirmwareVersion,%REG_DWORD%,0x0000000 | |
13 | HKR,,FirmwareFilename,,firmware.bin | |
14 | ||
15 | [Strings] | |
16 | Provider = "Hughski" | |
17 | MfgName = "Hughski Limited" | |
18 | FirmwareDesc = "ColorHugALS Firmware" | |
19 | DiskName = "Firmware for the ColorHugALS Ambient Light Sensor" |
11 | 11 | </description> |
12 | 12 | <provides> |
13 | 13 | <firmware type="flashed">84f40464-9272-4ef7-9399-cd95f12da696</firmware> |
14 | <firmware type="flashed">12345678-1234-1234-1234-123456789012</firmware> | |
14 | 15 | </provides> |
15 | 16 | <url type="homepage">http://www.hughski.com/</url> |
16 | 17 | <metadata_license>CC0-1.0</metadata_license> |
0 | fwupd (0.7.2-1) UNRELEASED; urgency=medium | |
1 | ||
2 | * New upstream version (0.7.2) | |
3 | ||
4 | -- Mario Limonciello <mario_limonciello@dell.com> Tue, 28 Jun 2016 08:45:42 -0500 | |
5 | ||
0 | 6 | fwupd (0.7.0-1) unstable; urgency=medium |
1 | 7 | |
2 | 8 | * New upstream version (0.7.0) |
154 | 154 | return "xtea"; |
155 | 155 | return NULL; |
156 | 156 | } |
157 | ||
158 | /** | |
159 | * dfu_version_to_string: | |
160 | * @version: a #DfuVersion, e.g. %DFU_VERSION_DFU_1_1 | |
161 | * | |
162 | * Converts an enumerated value to a string. | |
163 | * | |
164 | * Return value: a string | |
165 | * | |
166 | * Since: 0.7.2 | |
167 | **/ | |
168 | const gchar * | |
169 | dfu_version_to_string (DfuVersion version) | |
170 | { | |
171 | if (version == DFU_VERSION_DFU_1_0) | |
172 | return "1.0"; | |
173 | if (version == DFU_VERSION_DFU_1_1) | |
174 | return "1.1"; | |
175 | if (version == DFU_VERSION_DFUSE) | |
176 | return "DfuSe"; | |
177 | return NULL; | |
178 | } |
154 | 154 | DFU_CIPHER_KIND_LAST |
155 | 155 | } DfuCipherKind; |
156 | 156 | |
157 | /** | |
158 | * DfuVersion: | |
159 | * @DFU_VERSION_UNKNOWN: Format unknown | |
160 | * @DFU_VERSION_DFU_1_0: DFU 1.0 | |
161 | * @DFU_VERSION_DFU_1_1: DFU 1.1 | |
162 | * @DFU_VERSION_DFUSE: DfuSe | |
163 | * | |
164 | * The known versions of the DFU standard in BCD format. | |
165 | **/ | |
166 | typedef enum { | |
167 | DFU_VERSION_UNKNOWN = 0, | |
168 | DFU_VERSION_DFU_1_0 = 0x0100, | |
169 | DFU_VERSION_DFU_1_1 = 0x0110, | |
170 | DFU_VERSION_DFUSE = 0x011a, | |
171 | /*< private >*/ | |
172 | DFU_VERSION_LAST | |
173 | } DfuVersion; | |
174 | ||
157 | 175 | #define DFU_METADATA_KEY_LICENSE "License" |
158 | 176 | #define DFU_METADATA_KEY_COPYRIGHT "Copyright" |
159 | 177 | #define DFU_METADATA_KEY_CIPHER_KIND "CipherKind" |
162 | 180 | const gchar *dfu_status_to_string (DfuStatus status); |
163 | 181 | const gchar *dfu_mode_to_string (DfuMode mode); |
164 | 182 | const gchar *dfu_cipher_kind_to_string (DfuCipherKind cipher_kind); |
183 | const gchar *dfu_version_to_string (DfuVersion version); | |
165 | 184 | |
166 | 185 | G_END_DECLS |
167 | 186 |
44 | 44 | GUsbDevice *dev, |
45 | 45 | GCancellable *cancellable, |
46 | 46 | GError **error); |
47 | gboolean dfu_device_ensure_interface (DfuDevice *device, | |
48 | GError **error); | |
47 | 49 | |
48 | 50 | G_END_DECLS |
49 | 51 |
61 | 61 | gboolean open_new_dev; /* if set new GUsbDevice */ |
62 | 62 | gboolean dfuse_supported; |
63 | 63 | gboolean done_upload_or_download; |
64 | gboolean claimed_interface; | |
64 | 65 | gchar *display_name; |
65 | 66 | gchar *platform_id; |
67 | guint16 version; | |
66 | 68 | guint16 runtime_pid; |
67 | 69 | guint16 runtime_vid; |
68 | 70 | guint16 runtime_release; |
180 | 182 | } |
181 | 183 | |
182 | 184 | /** |
185 | * dfu_device_get_version: | |
186 | * @device: a #GUsbDevice | |
187 | * | |
188 | * Gets the DFU specification version supported by the device. | |
189 | * | |
190 | * Return value: integer, or 0 for unknown, e.g. %DFU_VERSION_DFU_1_1 | |
191 | * | |
192 | * Since: 0.7.2 | |
193 | **/ | |
194 | guint16 | |
195 | dfu_device_get_version (DfuDevice *device) | |
196 | { | |
197 | DfuDevicePrivate *priv = GET_PRIVATE (device); | |
198 | g_return_val_if_fail (DFU_IS_DEVICE (device), 0xffff); | |
199 | return priv->version; | |
200 | } | |
201 | ||
202 | /** | |
183 | 203 | * dfu_device_get_download_timeout: |
184 | 204 | * @device: a #GUsbDevice |
185 | 205 | * |
252 | 272 | DfuDevicePrivate *priv = GET_PRIVATE (device); |
253 | 273 | const DfuFuncDescriptor *desc; |
254 | 274 | gsize iface_data_length; |
255 | guint16 dfu_version; | |
256 | 275 | |
257 | 276 | /* parse the functional descriptor */ |
258 | 277 | desc = g_bytes_get_data (iface_data, &iface_data_length); |
276 | 295 | } |
277 | 296 | |
278 | 297 | /* check DFU version */ |
279 | dfu_version = GUINT16_FROM_LE (desc->bcdDFUVersion); | |
298 | priv->version = GUINT16_FROM_LE (desc->bcdDFUVersion); | |
280 | 299 | if (priv->quirks & DFU_DEVICE_QUIRK_IGNORE_INVALID_VERSION) { |
281 | 300 | g_debug ("ignoring quirked DFU version"); |
282 | 301 | } else { |
283 | if (dfu_version == 0x0100 || | |
284 | dfu_version == 0x0110) { | |
302 | if (priv->version == DFU_VERSION_DFU_1_0 || | |
303 | priv->version == DFU_VERSION_DFU_1_1) { | |
285 | 304 | g_debug ("basic DFU, no DfuSe support"); |
286 | 305 | priv->dfuse_supported = FALSE; |
287 | } else if (dfu_version == 0x011a) { | |
306 | } else if (priv->version == DFU_VERSION_DFUSE) { | |
288 | 307 | g_debug ("DfuSe support"); |
289 | 308 | priv->dfuse_supported = TRUE; |
290 | 309 | } else { |
291 | 310 | g_warning ("DFU version is invalid: 0x%04x", |
292 | dfu_version); | |
311 | priv->version); | |
293 | 312 | } |
294 | 313 | } |
295 | 314 | |
902 | 921 | } |
903 | 922 | |
904 | 923 | /** |
924 | * dfu_device_ensure_interface: | |
925 | **/ | |
926 | gboolean | |
927 | dfu_device_ensure_interface (DfuDevice *device, GError **error) | |
928 | { | |
929 | DfuDevicePrivate *priv = GET_PRIVATE (device); | |
930 | g_autoptr(GError) error_local = NULL; | |
931 | ||
932 | /* already done */ | |
933 | if (priv->claimed_interface) | |
934 | return TRUE; | |
935 | ||
936 | /* nothing set */ | |
937 | if (priv->iface_number == 0xff) | |
938 | return TRUE; | |
939 | ||
940 | /* claim, without detaching kernel driver */ | |
941 | if (!g_usb_device_claim_interface (priv->dev, | |
942 | (gint) priv->iface_number, | |
943 | 0, &error_local)) { | |
944 | g_set_error (error, | |
945 | DFU_ERROR, | |
946 | DFU_ERROR_INVALID_DEVICE, | |
947 | "cannot claim interface %i: %s", | |
948 | priv->iface_number, error_local->message); | |
949 | return FALSE; | |
950 | } | |
951 | ||
952 | /* success */ | |
953 | priv->claimed_interface = TRUE; | |
954 | return TRUE; | |
955 | } | |
956 | ||
957 | /** | |
905 | 958 | * dfu_device_refresh: |
906 | 959 | * @device: a #DfuDevice |
907 | 960 | * @cancellable: a #GCancellable, or %NULL |
942 | 995 | "not supported as no DFU runtime"); |
943 | 996 | return FALSE; |
944 | 997 | } |
998 | ||
999 | /* ensure interface is claimed */ | |
1000 | if (!dfu_device_ensure_interface (device, error)) | |
1001 | return FALSE; | |
945 | 1002 | |
946 | 1003 | if (!g_usb_device_control_transfer (priv->dev, |
947 | 1004 | G_USB_DEVICE_DIRECTION_DEVICE_TO_HOST, |
1037 | 1094 | "not supported as no DFU runtime"); |
1038 | 1095 | return FALSE; |
1039 | 1096 | } |
1097 | ||
1098 | /* ensure interface is claimed */ | |
1099 | if (!dfu_device_ensure_interface (device, error)) | |
1100 | return FALSE; | |
1040 | 1101 | |
1041 | 1102 | /* inform UI there's going to be a detach:attach */ |
1042 | 1103 | dfu_device_set_state (device, DFU_STATE_APP_DETACH); |
1111 | 1172 | return FALSE; |
1112 | 1173 | } |
1113 | 1174 | |
1175 | /* ensure interface is claimed */ | |
1176 | if (!dfu_device_ensure_interface (device, error)) | |
1177 | return FALSE; | |
1178 | ||
1114 | 1179 | if (!g_usb_device_control_transfer (priv->dev, |
1115 | 1180 | G_USB_DEVICE_DIRECTION_HOST_TO_DEVICE, |
1116 | 1181 | G_USB_DEVICE_REQUEST_TYPE_CLASS, |
1174 | 1239 | "not supported as no DFU runtime"); |
1175 | 1240 | return FALSE; |
1176 | 1241 | } |
1242 | ||
1243 | /* ensure interface is claimed */ | |
1244 | if (!dfu_device_ensure_interface (device, error)) | |
1245 | return FALSE; | |
1177 | 1246 | |
1178 | 1247 | if (!g_usb_device_control_transfer (priv->dev, |
1179 | 1248 | G_USB_DEVICE_DIRECTION_HOST_TO_DEVICE, |
1274 | 1343 | return FALSE; |
1275 | 1344 | } |
1276 | 1345 | |
1277 | /* claim the correct interface if set */ | |
1278 | if (priv->iface_number != 0xff) { | |
1279 | if (!g_usb_device_claim_interface (priv->dev, | |
1280 | (gint) priv->iface_number, | |
1281 | 0, | |
1282 | &error_local)) { | |
1283 | g_set_error (error, | |
1284 | DFU_ERROR, | |
1285 | DFU_ERROR_INVALID_DEVICE, | |
1286 | "cannot claim interface %i: %s", | |
1287 | priv->iface_number, error_local->message); | |
1288 | return FALSE; | |
1289 | } | |
1290 | } | |
1291 | ||
1292 | 1346 | /* get product name if it exists */ |
1293 | 1347 | idx = g_usb_device_get_product_index (priv->dev); |
1294 | 1348 | if (idx != 0x00) |
1368 | 1422 | error_local->message); |
1369 | 1423 | return FALSE; |
1370 | 1424 | } |
1425 | priv->claimed_interface = FALSE; | |
1371 | 1426 | priv->open_new_dev = FALSE; |
1372 | 1427 | return TRUE; |
1373 | 1428 | } |
1392 | 1447 | g_debug ("invalidating backing GUsbDevice"); |
1393 | 1448 | g_clear_object (&priv->dev); |
1394 | 1449 | g_ptr_array_set_size (priv->targets, 0); |
1450 | priv->claimed_interface = FALSE; | |
1395 | 1451 | return TRUE; |
1396 | 1452 | } |
1397 | 1453 | |
1686 | 1742 | return NULL; |
1687 | 1743 | } |
1688 | 1744 | |
1745 | /* ensure interface is claimed */ | |
1746 | if (!dfu_device_ensure_interface (device, error)) | |
1747 | return FALSE; | |
1748 | ||
1689 | 1749 | /* create ahead of time */ |
1690 | 1750 | firmware = dfu_firmware_new (); |
1691 | 1751 | dfu_firmware_set_vid (firmware, priv->runtime_vid); |
1802 | 1862 | priv->platform_id); |
1803 | 1863 | return FALSE; |
1804 | 1864 | } |
1865 | ||
1866 | /* ensure interface is claimed */ | |
1867 | if (!dfu_device_ensure_interface (device, error)) | |
1868 | return FALSE; | |
1805 | 1869 | |
1806 | 1870 | /* do we allow wildcard VID:PID matches */ |
1807 | 1871 | if ((flags & DFU_TARGET_TRANSFER_FLAG_WILDCARD_VID) == 0) { |
176 | 176 | DfuState dfu_device_get_state (DfuDevice *device); |
177 | 177 | DfuStatus dfu_device_get_status (DfuDevice *device); |
178 | 178 | guint16 dfu_device_get_transfer_size (DfuDevice *device); |
179 | guint16 dfu_device_get_version (DfuDevice *device); | |
179 | 180 | guint dfu_device_get_timeout (DfuDevice *device); |
180 | 181 | gboolean dfu_device_can_upload (DfuDevice *device); |
181 | 182 | gboolean dfu_device_can_download (DfuDevice *device); |
841 | 841 | prefix = (DfuSePrefix *) buf; |
842 | 842 | memcpy (prefix->sig, "DfuSe", 5); |
843 | 843 | prefix->ver = 0x01; |
844 | prefix->image_size = offset + image_size_total; | |
844 | prefix->image_size = GUINT32_TO_LE (offset + image_size_total); | |
845 | 845 | prefix->targets = priv->images->len; |
846 | 846 | |
847 | 847 | /* copy images */ |
876 | 876 | dfu_firmware_parse_metadata (DfuFirmware *firmware, |
877 | 877 | const guint8 *data, |
878 | 878 | guint data_length, |
879 | guint32 footer_size, | |
879 | guint8 footer_size, | |
880 | 880 | GError **error) |
881 | 881 | { |
882 | 882 | guint i; |
964 | 964 | const gchar *cipher_str; |
965 | 965 | gsize len; |
966 | 966 | guint32 crc_new; |
967 | guint32 size; | |
968 | 967 | guint8 *data; |
969 | 968 | g_autoptr(GBytes) contents = NULL; |
970 | 969 | |
973 | 972 | g_return_val_if_fail (error == NULL || *error == NULL, FALSE); |
974 | 973 | |
975 | 974 | /* sanity check */ |
976 | g_assert_cmpint(sizeof(DfuSePrefix), ==, 11); | |
975 | g_assert_cmpint (sizeof(DfuFirmwareFooter), ==, 16); | |
976 | g_assert_cmpint (sizeof(DfuSePrefix), ==, 11); | |
977 | 977 | |
978 | 978 | /* set defaults */ |
979 | 979 | priv->vid = 0xffff; |
992 | 992 | } |
993 | 993 | |
994 | 994 | /* check for DFU signature */ |
995 | ftr = (DfuFirmwareFooter *) &data[len-sizeof(DfuFirmwareFooter)]; | |
995 | ftr = (DfuFirmwareFooter *) &data[len - sizeof(DfuFirmwareFooter)]; | |
996 | 996 | if (memcmp (ftr->sig, "UFD", 3) != 0) { |
997 | 997 | priv->format = DFU_FIRMWARE_FORMAT_RAW; |
998 | 998 | return dfu_firmware_add_binary (firmware, bytes, error); |
1032 | 1032 | dfu_firmware_set_release (firmware, GUINT16_FROM_LE (ftr->release)); |
1033 | 1033 | |
1034 | 1034 | /* check reported length */ |
1035 | size = GUINT16_FROM_LE (ftr->len); | |
1036 | if (size > len) { | |
1035 | if (ftr->len > len) { | |
1037 | 1036 | g_set_error (error, |
1038 | 1037 | DFU_ERROR, |
1039 | 1038 | DFU_ERROR_INTERNAL, |
1040 | 1039 | "reported firmware size %04x larger than file %04x", |
1041 | (guint) size, (guint) len); | |
1040 | (guint) ftr->len, (guint) len); | |
1042 | 1041 | return FALSE; |
1043 | 1042 | } |
1044 | 1043 | |
1045 | 1044 | /* parse the optional metadata segment */ |
1046 | 1045 | if ((flags & DFU_FIRMWARE_PARSE_FLAG_NO_METADATA) == 0) { |
1047 | if (!dfu_firmware_parse_metadata (firmware, data, len, size, error)) | |
1046 | if (!dfu_firmware_parse_metadata (firmware, data, len, ftr->len, error)) | |
1048 | 1047 | return FALSE; |
1049 | 1048 | } |
1050 | 1049 | |
1058 | 1057 | } |
1059 | 1058 | |
1060 | 1059 | /* parse DfuSe prefix */ |
1061 | contents = g_bytes_new_from_bytes (bytes, 0, len - size); | |
1060 | contents = g_bytes_new_from_bytes (bytes, 0, len - ftr->len); | |
1062 | 1061 | if (priv->format == DFU_FIRMWARE_FORMAT_DFUSE) |
1063 | 1062 | return dfu_firmware_add_dfuse (firmware, contents, error); |
1064 | 1063 | |
1257 | 1256 | const guint8 *data_md; |
1258 | 1257 | gsize length_bin = 0; |
1259 | 1258 | gsize length_md = 0; |
1259 | guint32 crc_new; | |
1260 | 1260 | guint8 *buf; |
1261 | 1261 | g_autoptr(GBytes) metadata_table = NULL; |
1262 | 1262 | |
1280 | 1280 | ftr->pid = GUINT16_TO_LE (priv->pid); |
1281 | 1281 | ftr->vid = GUINT16_TO_LE (priv->vid); |
1282 | 1282 | ftr->ver = GUINT16_TO_LE (priv->format); |
1283 | ftr->len = GUINT16_TO_LE (0x10 + length_md); | |
1283 | ftr->len = sizeof (DfuFirmwareFooter) + length_md; | |
1284 | 1284 | memcpy(ftr->sig, "UFD", 3); |
1285 | ftr->crc = dfu_firmware_generate_crc32 (buf, length_bin + length_md + 12); | |
1285 | crc_new = dfu_firmware_generate_crc32 (buf, length_bin + length_md + 12); | |
1286 | ftr->crc = GUINT32_TO_LE (crc_new); | |
1286 | 1287 | |
1287 | 1288 | /* return all data */ |
1288 | 1289 | return g_bytes_new_take (buf, length_bin + length_md + 0x10); |
143 | 143 | if (idx >= priv->elements->len) |
144 | 144 | return NULL; |
145 | 145 | return g_ptr_array_index (priv->elements, idx); |
146 | } | |
147 | ||
148 | /** | |
149 | * dfu_image_get_element_default: | |
150 | * @image: a #DfuImage | |
151 | * | |
152 | * Gets the default element. | |
153 | * | |
154 | * Return value: (transfer none): element data, or %NULL for invalid | |
155 | * | |
156 | * Since: 0.7.1 | |
157 | **/ | |
158 | DfuElement * | |
159 | dfu_image_get_element_default (DfuImage *image) | |
160 | { | |
161 | DfuImagePrivate *priv = GET_PRIVATE (image); | |
162 | g_return_val_if_fail (DFU_IS_IMAGE (image), NULL); | |
163 | if (priv->elements->len == 0) | |
164 | return NULL; | |
165 | return g_ptr_array_index (priv->elements, 0); | |
146 | 166 | } |
147 | 167 | |
148 | 168 | /** |
335 | 355 | { |
336 | 356 | DfuImagePrivate *priv; |
337 | 357 | DfuSeImagePrefix *im; |
358 | guint32 elements; | |
338 | 359 | guint32 offset = sizeof(DfuSeImagePrefix); |
339 | 360 | guint j; |
340 | 361 | g_autoptr(DfuImage) image = NULL; |
365 | 386 | image = dfu_image_new (); |
366 | 387 | priv = GET_PRIVATE (image); |
367 | 388 | priv->alt_setting = im->alt_setting; |
368 | if (im->target_named == 0x01) | |
389 | if (GUINT32_FROM_LE (im->target_named) == 0x01) | |
369 | 390 | memcpy (priv->name, im->target_name, 255); |
370 | 391 | |
371 | 392 | /* parse elements */ |
372 | 393 | length -= offset; |
373 | for (j = 0; j < im->elements; j++) { | |
394 | elements = GUINT32_FROM_LE (im->elements); | |
395 | for (j = 0; j < elements; j++) { | |
374 | 396 | guint32 consumed_local; |
375 | 397 | g_autoptr(DfuElement) element = NULL; |
376 | 398 | element = dfu_element_from_dfuse (data + offset, length, |
425 | 447 | memcpy (im->sig, "Target", 6); |
426 | 448 | im->alt_setting = priv->alt_setting; |
427 | 449 | if (priv->name != NULL) { |
428 | im->target_named = 0x01; | |
450 | im->target_named = GUINT32_TO_LE (0x01); | |
429 | 451 | memcpy (im->target_name, priv->name, 255); |
430 | 452 | } |
431 | im->target_size = length_total; | |
432 | im->elements = priv->elements->len; | |
453 | im->target_size = GUINT32_TO_LE (length_total); | |
454 | im->elements = GUINT32_TO_LE (priv->elements->len); | |
433 | 455 | |
434 | 456 | /* copy data */ |
435 | 457 | for (i = 0; i < element_array->len; i++) { |
52 | 52 | GPtrArray *dfu_image_get_elements (DfuImage *image); |
53 | 53 | DfuElement *dfu_image_get_element (DfuImage *image, |
54 | 54 | guint8 idx); |
55 | DfuElement *dfu_image_get_element_default (DfuImage *image); | |
55 | 56 | guint8 dfu_image_get_alt_setting (DfuImage *image); |
56 | 57 | const gchar *dfu_image_get_name (DfuImage *image); |
57 | 58 | guint32 dfu_image_get_size (DfuImage *image); |
564 | 564 | g_return_val_if_fail (DFU_IS_TARGET (target), FALSE); |
565 | 565 | g_return_val_if_fail (error == NULL || *error == NULL, FALSE); |
566 | 566 | |
567 | /* ensure interface is claimed */ | |
568 | if (!dfu_device_ensure_interface (priv->device, error)) | |
569 | return FALSE; | |
570 | ||
567 | 571 | /* use the correct setting */ |
568 | 572 | dev = dfu_device_get_usb_dev (priv->device); |
569 | 573 | if (dfu_device_get_mode (priv->device) == DFU_MODE_DFU) { |
1176 | 1176 | gpointer user_data) |
1177 | 1177 | { |
1178 | 1178 | DfuToolPrivate *priv = (DfuToolPrivate *) user_data; |
1179 | g_autofree gchar *tmp; | |
1180 | tmp = dfu_tool_get_device_string (priv, device); | |
1179 | g_autofree gchar *tmp = dfu_tool_get_device_string (priv, device); | |
1181 | 1180 | /* TRANSLATORS: this is when a device is hotplugged */ |
1182 | 1181 | dfu_tool_print_indent (_("Added"), tmp, 0); |
1183 | 1182 | } |
1191 | 1190 | gpointer user_data) |
1192 | 1191 | { |
1193 | 1192 | DfuToolPrivate *priv = (DfuToolPrivate *) user_data; |
1194 | g_autofree gchar *tmp; | |
1195 | tmp = dfu_tool_get_device_string (priv, device); | |
1193 | g_autofree gchar *tmp = dfu_tool_get_device_string (priv, device); | |
1196 | 1194 | /* TRANSLATORS: this is when a device is hotplugged */ |
1197 | 1195 | dfu_tool_print_indent (_("Removed"), tmp, 0); |
1198 | 1196 | } |
1204 | 1202 | dfu_tool_device_changed_cb (DfuContext *context, DfuDevice *device, gpointer user_data) |
1205 | 1203 | { |
1206 | 1204 | DfuToolPrivate *priv = (DfuToolPrivate *) user_data; |
1207 | g_autofree gchar *tmp; | |
1208 | tmp = dfu_tool_get_device_string (priv, device); | |
1205 | g_autofree gchar *tmp = dfu_tool_get_device_string (priv, device); | |
1209 | 1206 | /* TRANSLATORS: this is when a device is hotplugged */ |
1210 | 1207 | dfu_tool_print_indent (_("Changed"), tmp, 0); |
1211 | 1208 | } |
1927 | 1924 | g_usb_device_get_vid (dev), |
1928 | 1925 | g_usb_device_get_pid (dev), |
1929 | 1926 | version); |
1927 | ||
1928 | tmp = dfu_version_to_string (dfu_device_get_version (device)); | |
1929 | if (tmp != NULL) { | |
1930 | /* TRANSLATORS: DFU protocol version, e.g. 1.1 */ | |
1931 | dfu_tool_print_indent (_("Protocol"), tmp, 1); | |
1932 | } | |
1930 | 1933 | |
1931 | 1934 | /* open */ |
1932 | 1935 | if (!dfu_device_open (device, |
0 | Planned API Changes | |
1 | =================== | |
2 | ||
3 | When we next bump soname the following changes are planned: | |
4 | ||
5 | * {sa{sv}} -> {a{sv}} -- we don't always want to send the device ID | |
6 | * Rename FU_DEVICE_FLAG -> FWUPD_DEVICE_FLAG | |
7 | * Remove all deprecated API |
50 | 50 | enum { |
51 | 51 | SIGNAL_CHANGED, |
52 | 52 | SIGNAL_STATUS_CHANGED, |
53 | SIGNAL_DEVICE_ADDED, | |
54 | SIGNAL_DEVICE_REMOVED, | |
55 | SIGNAL_DEVICE_CHANGED, | |
53 | 56 | SIGNAL_LAST |
54 | 57 | }; |
55 | 58 | |
133 | 136 | GVariant *parameters, |
134 | 137 | FwupdClient *client) |
135 | 138 | { |
136 | g_debug ("Emitting ::changed()"); | |
137 | g_signal_emit (client, signals[SIGNAL_CHANGED], 0); | |
138 | } | |
139 | ||
140 | /** | |
141 | * fwupd_client_startup: | |
142 | **/ | |
143 | static gboolean | |
144 | fwupd_client_startup (FwupdClient *client, GCancellable *cancellable, GError **error) | |
139 | g_autoptr(FwupdResult) res = NULL; | |
140 | if (g_strcmp0 (signal_name, "Changed") == 0) { | |
141 | g_debug ("Emitting ::changed()"); | |
142 | g_signal_emit (client, signals[SIGNAL_CHANGED], 0); | |
143 | return; | |
144 | } | |
145 | if (g_strcmp0 (signal_name, "DeviceAdded") == 0) { | |
146 | res = fwupd_result_new_from_data (parameters); | |
147 | g_debug ("Emitting ::device-added(%s)", | |
148 | fwupd_result_get_device_id (res)); | |
149 | g_signal_emit (client, signals[SIGNAL_DEVICE_ADDED], 0, res); | |
150 | return; | |
151 | } | |
152 | if (g_strcmp0 (signal_name, "DeviceRemoved") == 0) { | |
153 | res = fwupd_result_new_from_data (parameters); | |
154 | g_signal_emit (client, signals[SIGNAL_DEVICE_REMOVED], 0, res); | |
155 | g_debug ("Emitting ::device-removed(%s)", | |
156 | fwupd_result_get_device_id (res)); | |
157 | return; | |
158 | } | |
159 | if (g_strcmp0 (signal_name, "DeviceChanged") == 0) { | |
160 | res = fwupd_result_new_from_data (parameters); | |
161 | g_signal_emit (client, signals[SIGNAL_DEVICE_CHANGED], 0, res); | |
162 | g_debug ("Emitting ::device-changed(%s)", | |
163 | fwupd_result_get_device_id (res)); | |
164 | return; | |
165 | } | |
166 | g_warning ("Unknown signal name '%s' from %s", | |
167 | signal_name, sender_name); | |
168 | } | |
169 | ||
170 | /** | |
171 | * fwupd_client_connect: | |
172 | * @client: A #FwupdClient | |
173 | * @cancellable: the #GCancellable, or %NULL | |
174 | * @error: the #GError, or %NULL | |
175 | * | |
176 | * Sets up the client ready for use. Most other methods call this | |
177 | * for you, and do you only need to call this if you are just watching | |
178 | * the client. | |
179 | * | |
180 | * Returns: %TRUE for success | |
181 | * | |
182 | * Since: 0.7.1 | |
183 | **/ | |
184 | gboolean | |
185 | fwupd_client_connect (FwupdClient *client, GCancellable *cancellable, GError **error) | |
145 | 186 | { |
146 | 187 | FwupdClientPrivate *priv = GET_PRIVATE (client); |
147 | 188 | |
243 | 284 | g_return_val_if_fail (error == NULL || *error == NULL, NULL); |
244 | 285 | |
245 | 286 | /* connect */ |
246 | if (!fwupd_client_startup (client, cancellable, error)) | |
287 | if (!fwupd_client_connect (client, cancellable, error)) | |
247 | 288 | return NULL; |
248 | 289 | |
249 | 290 | /* call into daemon */ |
285 | 326 | g_return_val_if_fail (error == NULL || *error == NULL, NULL); |
286 | 327 | |
287 | 328 | /* connect */ |
288 | if (!fwupd_client_startup (client, cancellable, error)) | |
329 | if (!fwupd_client_connect (client, cancellable, error)) | |
289 | 330 | return NULL; |
290 | 331 | |
291 | 332 | /* call into daemon */ |
347 | 388 | g_return_val_if_fail (error == NULL || *error == NULL, FALSE); |
348 | 389 | |
349 | 390 | /* connect */ |
350 | if (!fwupd_client_startup (client, cancellable, error)) | |
391 | if (!fwupd_client_connect (client, cancellable, error)) | |
351 | 392 | return FALSE; |
352 | 393 | |
353 | 394 | /* call into daemon */ |
396 | 437 | g_return_val_if_fail (error == NULL || *error == NULL, FALSE); |
397 | 438 | |
398 | 439 | /* connect */ |
399 | if (!fwupd_client_startup (client, cancellable, error)) | |
440 | if (!fwupd_client_connect (client, cancellable, error)) | |
400 | 441 | return FALSE; |
401 | 442 | |
402 | 443 | /* call into daemon */ |
445 | 486 | g_return_val_if_fail (error == NULL || *error == NULL, FALSE); |
446 | 487 | |
447 | 488 | /* connect */ |
448 | if (!fwupd_client_startup (client, cancellable, error)) | |
489 | if (!fwupd_client_connect (client, cancellable, error)) | |
449 | 490 | return FALSE; |
450 | 491 | |
451 | 492 | /* call into daemon */ |
494 | 535 | g_return_val_if_fail (error == NULL || *error == NULL, NULL); |
495 | 536 | |
496 | 537 | /* connect */ |
497 | if (!fwupd_client_startup (client, cancellable, error)) | |
538 | if (!fwupd_client_connect (client, cancellable, error)) | |
498 | 539 | return NULL; |
499 | 540 | |
500 | 541 | /* call into daemon */ |
578 | 619 | g_return_val_if_fail (error == NULL || *error == NULL, FALSE); |
579 | 620 | |
580 | 621 | /* connect */ |
581 | if (!fwupd_client_startup (client, cancellable, error)) | |
622 | if (!fwupd_client_connect (client, cancellable, error)) | |
582 | 623 | return FALSE; |
583 | 624 | |
584 | 625 | /* set options */ |
598 | 639 | if (install_flags & FWUPD_INSTALL_FLAG_ALLOW_REINSTALL) { |
599 | 640 | g_variant_builder_add (&builder, "{sv}", |
600 | 641 | "allow-reinstall", g_variant_new_boolean (TRUE)); |
642 | } | |
643 | if (install_flags & FWUPD_INSTALL_FLAG_FORCE) { | |
644 | g_variant_builder_add (&builder, "{sv}", | |
645 | "force", g_variant_new_boolean (TRUE)); | |
601 | 646 | } |
602 | 647 | |
603 | 648 | /* open file */ |
676 | 721 | g_return_val_if_fail (error == NULL || *error == NULL, NULL); |
677 | 722 | |
678 | 723 | /* connect */ |
679 | if (!fwupd_client_startup (client, cancellable, error)) | |
724 | if (!fwupd_client_connect (client, cancellable, error)) | |
680 | 725 | return NULL; |
681 | 726 | |
682 | 727 | /* open file */ |
728 | 773 | } |
729 | 774 | |
730 | 775 | /** |
776 | * fwupd_client_get_details_local: | |
777 | * @client: A #FwupdClient | |
778 | * @filename: the firmware filename, e.g. "firmware.cab" | |
779 | * @cancellable: the #GCancellable, or %NULL | |
780 | * @error: the #GError, or %NULL | |
781 | * | |
782 | * Gets details about a specific firmware file. | |
783 | * | |
784 | * Returns: (transfer container) (element-type FwupdResult): an array of results | |
785 | * | |
786 | * Since: 0.7.2 | |
787 | **/ | |
788 | GPtrArray * | |
789 | fwupd_client_get_details_local (FwupdClient *client, const gchar *filename, | |
790 | GCancellable *cancellable, GError **error) | |
791 | { | |
792 | FwupdClientPrivate *priv = GET_PRIVATE (client); | |
793 | GVariant *body; | |
794 | gint fd; | |
795 | gint retval; | |
796 | g_autoptr(FwupdClientHelper) helper = NULL; | |
797 | g_autoptr(GDBusMessage) request = NULL; | |
798 | g_autoptr(GUnixFDList) fd_list = NULL; | |
799 | ||
800 | g_return_val_if_fail (FWUPD_IS_CLIENT (client), NULL); | |
801 | g_return_val_if_fail (filename != NULL, NULL); | |
802 | g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); | |
803 | g_return_val_if_fail (error == NULL || *error == NULL, NULL); | |
804 | ||
805 | /* connect */ | |
806 | if (!fwupd_client_connect (client, cancellable, error)) | |
807 | return NULL; | |
808 | ||
809 | /* open file */ | |
810 | fd = open (filename, O_RDONLY); | |
811 | if (fd < 0) { | |
812 | g_set_error (error, | |
813 | FWUPD_ERROR, | |
814 | FWUPD_ERROR_INVALID_FILE, | |
815 | "failed to open %s", | |
816 | filename); | |
817 | return NULL; | |
818 | } | |
819 | ||
820 | /* set out of band file descriptor */ | |
821 | fd_list = g_unix_fd_list_new (); | |
822 | retval = g_unix_fd_list_append (fd_list, fd, NULL); | |
823 | g_assert (retval != -1); | |
824 | request = g_dbus_message_new_method_call (FWUPD_DBUS_SERVICE, | |
825 | FWUPD_DBUS_PATH, | |
826 | FWUPD_DBUS_INTERFACE, | |
827 | "GetDetailsLocal"); | |
828 | g_dbus_message_set_unix_fd_list (request, fd_list); | |
829 | ||
830 | /* g_unix_fd_list_append did a dup() already */ | |
831 | close (fd); | |
832 | ||
833 | /* call into daemon */ | |
834 | helper = fwupd_client_helper_new (); | |
835 | body = g_variant_new ("(h)", fd > -1 ? 0 : -1); | |
836 | g_dbus_message_set_body (request, body); | |
837 | ||
838 | g_dbus_connection_send_message_with_reply (priv->conn, | |
839 | request, | |
840 | G_DBUS_SEND_MESSAGE_FLAGS_NONE, | |
841 | -1, | |
842 | NULL, | |
843 | cancellable, | |
844 | fwupd_client_send_message_cb, | |
845 | helper); | |
846 | g_main_loop_run (helper->loop); | |
847 | if (!helper->ret) { | |
848 | g_propagate_error (error, helper->error); | |
849 | helper->error = NULL; | |
850 | return NULL; | |
851 | } | |
852 | ||
853 | /* return results */ | |
854 | return fwupd_client_parse_results_from_data (helper->val); | |
855 | } | |
856 | ||
857 | /** | |
731 | 858 | * fwupd_client_update_metadata: |
732 | 859 | * @client: A #FwupdClient |
733 | 860 | * @metadata_fn: the XML metadata filename |
765 | 892 | g_return_val_if_fail (error == NULL || *error == NULL, FALSE); |
766 | 893 | |
767 | 894 | /* connect */ |
768 | if (!fwupd_client_startup (client, cancellable, error)) | |
895 | if (!fwupd_client_connect (client, cancellable, error)) | |
769 | 896 | return FALSE; |
770 | 897 | |
771 | 898 | /* open file */ |
909 | 1036 | G_TYPE_NONE, 1, G_TYPE_UINT); |
910 | 1037 | |
911 | 1038 | /** |
1039 | * FwupdClient::device-added: | |
1040 | * @client: the #FwupdClient instance that emitted the signal | |
1041 | * @result: the #FwupdResult | |
1042 | * | |
1043 | * The ::device-added signal is emitted when a device has been | |
1044 | * added. | |
1045 | * | |
1046 | * Since: 0.7.1 | |
1047 | **/ | |
1048 | signals [SIGNAL_DEVICE_ADDED] = | |
1049 | g_signal_new ("device-added", | |
1050 | G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, | |
1051 | G_STRUCT_OFFSET (FwupdClientClass, device_added), | |
1052 | NULL, NULL, g_cclosure_marshal_generic, | |
1053 | G_TYPE_NONE, 1, FWUPD_TYPE_RESULT); | |
1054 | ||
1055 | /** | |
1056 | * FwupdClient::device-removed: | |
1057 | * @client: the #FwupdClient instance that emitted the signal | |
1058 | * @result: the #FwupdResult | |
1059 | * | |
1060 | * The ::device-removed signal is emitted when a device has been | |
1061 | * removed. | |
1062 | * | |
1063 | * Since: 0.7.1 | |
1064 | **/ | |
1065 | signals [SIGNAL_DEVICE_REMOVED] = | |
1066 | g_signal_new ("device-removed", | |
1067 | G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, | |
1068 | G_STRUCT_OFFSET (FwupdClientClass, device_removed), | |
1069 | NULL, NULL, g_cclosure_marshal_generic, | |
1070 | G_TYPE_NONE, 1, FWUPD_TYPE_RESULT); | |
1071 | ||
1072 | /** | |
1073 | * FwupdClient::device-changed: | |
1074 | * @client: the #FwupdClient instance that emitted the signal | |
1075 | * @result: the #FwupdResult | |
1076 | * | |
1077 | * The ::device-changed signal is emitted when a device has been | |
1078 | * changed in some way, e.g. the version number is updated. | |
1079 | * | |
1080 | * Since: 0.7.1 | |
1081 | **/ | |
1082 | signals [SIGNAL_DEVICE_CHANGED] = | |
1083 | g_signal_new ("device-changed", | |
1084 | G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, | |
1085 | G_STRUCT_OFFSET (FwupdClientClass, device_changed), | |
1086 | NULL, NULL, g_cclosure_marshal_generic, | |
1087 | G_TYPE_NONE, 1, FWUPD_TYPE_RESULT); | |
1088 | ||
1089 | /** | |
912 | 1090 | * FwupdClient:status: |
913 | 1091 | * |
914 | 1092 | * The last-reported status of the daemon. |
38 | 38 | void (*changed) (FwupdClient *client); |
39 | 39 | void (*status_changed) (FwupdClient *client, |
40 | 40 | FwupdStatus status); |
41 | void (*device_added) (FwupdClient *client, | |
42 | FwupdResult *result); | |
43 | void (*device_removed) (FwupdClient *client, | |
44 | FwupdResult *result); | |
45 | void (*device_changed) (FwupdClient *client, | |
46 | FwupdResult *result); | |
41 | 47 | /*< private >*/ |
42 | 48 | void (*_fwupd_reserved1) (void); |
43 | 49 | void (*_fwupd_reserved2) (void); |
44 | 50 | void (*_fwupd_reserved3) (void); |
45 | 51 | void (*_fwupd_reserved4) (void); |
46 | void (*_fwupd_reserved5) (void); | |
47 | void (*_fwupd_reserved6) (void); | |
48 | void (*_fwupd_reserved7) (void); | |
49 | 52 | }; |
50 | 53 | |
51 | 54 | FwupdClient *fwupd_client_new (void); |
55 | gboolean fwupd_client_connect (FwupdClient *client, | |
56 | GCancellable *cancellable, | |
57 | GError **error); | |
52 | 58 | GPtrArray *fwupd_client_get_devices (FwupdClient *client, |
53 | 59 | GCancellable *cancellable, |
54 | 60 | GError **error); |
55 | 61 | GPtrArray *fwupd_client_get_updates (FwupdClient *client, |
62 | GCancellable *cancellable, | |
63 | GError **error); | |
64 | GPtrArray *fwupd_client_get_details_local (FwupdClient *client, | |
65 | const gchar *filename, | |
56 | 66 | GCancellable *cancellable, |
57 | 67 | GError **error); |
58 | 68 | gboolean fwupd_client_verify (FwupdClient *client, |
71 | 81 | const gchar *device_id, |
72 | 82 | GCancellable *cancellable, |
73 | 83 | GError **error); |
84 | G_DEPRECATED_FOR(fwupd_client_get_details_local) | |
74 | 85 | FwupdResult *fwupd_client_get_details (FwupdClient *client, |
75 | 86 | const gchar *filename, |
76 | 87 | GCancellable *cancellable, |
29 | 29 | #define FWUPD_RESULT_KEY_DEVICE_CHECKSUM_KIND "DeviceChecksumKind" /* u */ |
30 | 30 | #define FWUPD_RESULT_KEY_DEVICE_MODIFIED "Modified" /* t */ |
31 | 31 | #define FWUPD_RESULT_KEY_DEVICE_NAME "DisplayName" /* s */ |
32 | #define FWUPD_RESULT_KEY_DEVICE_ID "DeviceID" /* s */ | |
32 | 33 | #define FWUPD_RESULT_KEY_DEVICE_PROVIDER "Provider" /* s */ |
33 | 34 | #define FWUPD_RESULT_KEY_DEVICE_VERSION "Version" /* s */ |
34 | 35 | #define FWUPD_RESULT_KEY_DEVICE_VERSION_LOWEST "VersionLowest" /* s */ |
36 | #define FWUPD_RESULT_KEY_DEVICE_FLASHES_LEFT "FlashesLeft" /* u */ | |
35 | 37 | #define FWUPD_RESULT_KEY_DEVICE_VENDOR "DeviceVendor" /* s */ |
36 | 38 | #define FWUPD_RESULT_KEY_GUID "Guid" /* s */ |
37 | 39 | #define FWUPD_RESULT_KEY_UPDATE_DESCRIPTION "UpdateDescription" /* s */ |
111 | 111 | return "require-ac"; |
112 | 112 | if (device_flag == FU_DEVICE_FLAG_LOCKED) |
113 | 113 | return "locked"; |
114 | if (device_flag == FU_DEVICE_FLAG_SUPPORTED) | |
115 | return "supported"; | |
114 | 116 | return NULL; |
115 | 117 | } |
116 | 118 | |
139 | 141 | return FU_DEVICE_FLAG_REQUIRE_AC; |
140 | 142 | if (g_strcmp0 (device_flag, "locked") == 0) |
141 | 143 | return FU_DEVICE_FLAG_LOCKED; |
144 | if (g_strcmp0 (device_flag, "supported") == 0) | |
145 | return FU_DEVICE_FLAG_SUPPORTED; | |
142 | 146 | return FU_DEVICE_FLAG_LAST; |
143 | 147 | } |
144 | 148 |
75 | 75 | * FwupdDeviceFlags: |
76 | 76 | * @FU_DEVICE_FLAG_NONE: No flags set |
77 | 77 | * @FU_DEVICE_FLAG_INTERNAL: Device cannot be removed easily |
78 | * @FU_DEVICE_FLAG_ALLOW_ONLINE: Permits 'live' updating | |
79 | * @FU_DEVICE_FLAG_ALLOW_OFFLINE: Permits 'offline' updating | |
78 | * @FU_DEVICE_FLAG_ALLOW_ONLINE: Is capable of 'live' updating | |
79 | * @FU_DEVICE_FLAG_ALLOW_OFFLINE: Is capable of 'offline' updating | |
80 | 80 | * @FU_DEVICE_FLAG_REQUIRE_AC: Requires AC power |
81 | 81 | * @FU_DEVICE_FLAG_LOCKED: Is locked and can be unlocked |
82 | * @FU_DEVICE_FLAG_SUPPORTED: Is found in current metadata | |
82 | 83 | * |
83 | 84 | * FIXME: rename FU_DEVICE_ -> FWUPD_DEVICE_ when we break API |
84 | 85 | * |
91 | 92 | FU_DEVICE_FLAG_ALLOW_OFFLINE = 1 << 2, /* Since: 0.1.3 */ |
92 | 93 | FU_DEVICE_FLAG_REQUIRE_AC = 1 << 3, /* Since: 0.6.3 */ |
93 | 94 | FU_DEVICE_FLAG_LOCKED = 1 << 4, /* Since: 0.6.3 */ |
95 | FU_DEVICE_FLAG_SUPPORTED = 1 << 5, /* Since: 0.7.1 */ | |
94 | 96 | /*< private >*/ |
95 | 97 | FU_DEVICE_FLAG_LAST |
96 | 98 | } FwupdDeviceFlags; |
109 | 111 | FWUPD_INSTALL_FLAG_OFFLINE = 1, /* Since: 0.7.0 */ |
110 | 112 | FWUPD_INSTALL_FLAG_ALLOW_REINSTALL = 2, /* Since: 0.7.0 */ |
111 | 113 | FWUPD_INSTALL_FLAG_ALLOW_OLDER = 4, /* Since: 0.7.0 */ |
114 | FWUPD_INSTALL_FLAG_FORCE = 8, /* Since: 0.7.1 */ | |
112 | 115 | /*< private >*/ |
113 | 116 | FWUPD_INSTALL_FLAG_LAST |
114 | 117 | } FwupdInstallFlags; |
36 | 36 | * Private #FwupdResult data |
37 | 37 | **/ |
38 | 38 | typedef struct { |
39 | gchar *guid; | |
39 | GPtrArray *guids; | |
40 | 40 | |
41 | 41 | /* device-specific */ |
42 | 42 | gchar *device_checksum; |
48 | 48 | gchar *device_vendor; |
49 | 49 | gchar *device_version; |
50 | 50 | gchar *device_version_lowest; |
51 | guint32 device_flashes_left; | |
51 | 52 | guint64 device_created; |
52 | 53 | guint64 device_flags; |
53 | 54 | guint64 device_modified; |
121 | 122 | } |
122 | 123 | |
123 | 124 | /** |
125 | * fwupd_result_get_guids: | |
126 | * @result: A #FwupdResult | |
127 | * | |
128 | * Gets the GUIDs. | |
129 | * | |
130 | * Returns: (element-type utf8) (transfer none): the GUIDs | |
131 | * | |
132 | * Since: 0.7.2 | |
133 | **/ | |
134 | GPtrArray * | |
135 | fwupd_result_get_guids (FwupdResult *result) | |
136 | { | |
137 | FwupdResultPrivate *priv = GET_PRIVATE (result); | |
138 | g_return_val_if_fail (FWUPD_IS_RESULT (result), NULL); | |
139 | return priv->guids; | |
140 | } | |
141 | ||
142 | /** | |
143 | * fwupd_result_has_guid: | |
144 | * @result: A #FwupdResult | |
145 | * @guid: the GUID, e.g. "2082b5e0-7a64-478a-b1b2-e3404fab6dad" | |
146 | * | |
147 | * Finds out if the device has this specific GUID. | |
148 | * | |
149 | * Returns: %TRUE if the GUID is found | |
150 | * | |
151 | * Since: 0.7.2 | |
152 | **/ | |
153 | gboolean | |
154 | fwupd_result_has_guid (FwupdResult *result, const gchar *guid) | |
155 | { | |
156 | FwupdResultPrivate *priv = GET_PRIVATE (result); | |
157 | guint i; | |
158 | ||
159 | g_return_val_if_fail (FWUPD_IS_RESULT (result), FALSE); | |
160 | ||
161 | for (i = 0; i < priv->guids->len; i++) { | |
162 | const gchar *guid_tmp = g_ptr_array_index (priv->guids, i); | |
163 | if (g_strcmp0 (guid, guid_tmp) == 0) | |
164 | return TRUE; | |
165 | } | |
166 | return FALSE; | |
167 | } | |
168 | ||
169 | /** | |
170 | * fwupd_result_add_guid: | |
171 | * @result: A #FwupdResult | |
172 | * @guid: the GUID, e.g. "2082b5e0-7a64-478a-b1b2-e3404fab6dad" | |
173 | * | |
174 | * Adds the GUID if it does not already exist. | |
175 | * | |
176 | * Since: 0.7.2 | |
177 | **/ | |
178 | void | |
179 | fwupd_result_add_guid (FwupdResult *result, const gchar *guid) | |
180 | { | |
181 | FwupdResultPrivate *priv = GET_PRIVATE (result); | |
182 | g_return_if_fail (FWUPD_IS_RESULT (result)); | |
183 | if (fwupd_result_has_guid (result, guid)) | |
184 | return; | |
185 | g_ptr_array_add (priv->guids, g_strdup (guid)); | |
186 | } | |
187 | ||
188 | /** | |
189 | * fwupd_result_get_guid_default: | |
190 | * @result: A #FwupdResult | |
191 | * | |
192 | * Gets the default GUID. | |
193 | * | |
194 | * Returns: the GUID, or %NULL if unset | |
195 | * | |
196 | * Since: 0.7.2 | |
197 | **/ | |
198 | const gchar * | |
199 | fwupd_result_get_guid_default (FwupdResult *result) | |
200 | { | |
201 | FwupdResultPrivate *priv = GET_PRIVATE (result); | |
202 | g_return_val_if_fail (FWUPD_IS_RESULT (result), NULL); | |
203 | if (priv->guids->len == 0) | |
204 | return NULL; | |
205 | return g_ptr_array_index (priv->guids, 0); | |
206 | } | |
207 | ||
208 | /** | |
124 | 209 | * fwupd_result_get_guid: |
125 | 210 | * @result: A #FwupdResult |
126 | 211 | * |
128 | 213 | * |
129 | 214 | * Returns: the GUID, or %NULL if unset |
130 | 215 | * |
216 | * This function has been deprecated since 0.7.2. | |
217 | * | |
131 | 218 | * Since: 0.7.0 |
132 | 219 | **/ |
133 | 220 | const gchar * |
134 | 221 | fwupd_result_get_guid (FwupdResult *result) |
135 | 222 | { |
136 | FwupdResultPrivate *priv = GET_PRIVATE (result); | |
137 | g_return_val_if_fail (FWUPD_IS_RESULT (result), NULL); | |
138 | return priv->guid; | |
223 | return fwupd_result_get_guid_default (result); | |
139 | 224 | } |
140 | 225 | |
141 | 226 | /** |
145 | 230 | * |
146 | 231 | * Sets the GUID. |
147 | 232 | * |
233 | * This function has been deprecated since 0.7.2. | |
234 | * | |
148 | 235 | * Since: 0.7.0 |
149 | 236 | **/ |
150 | 237 | void |
151 | 238 | fwupd_result_set_guid (FwupdResult *result, const gchar *guid) |
152 | 239 | { |
153 | FwupdResultPrivate *priv = GET_PRIVATE (result); | |
154 | g_return_if_fail (FWUPD_IS_RESULT (result)); | |
155 | g_free (priv->guid); | |
156 | priv->guid = g_strdup (guid); | |
240 | fwupd_result_add_guid (result, guid); | |
157 | 241 | } |
158 | 242 | |
159 | 243 | /** |
355 | 439 | } |
356 | 440 | |
357 | 441 | /** |
442 | * fwupd_result_device_get_flashes_left: | |
443 | * @result: A #FwupdResult | |
444 | * | |
445 | * Gets the number of flash cycles left on the device | |
446 | * | |
447 | * Returns: the flash cycles left, or %NULL if unset | |
448 | * | |
449 | * Since: 0.7.1 | |
450 | **/ | |
451 | guint32 | |
452 | fwupd_result_get_device_flashes_left (FwupdResult *result) | |
453 | { | |
454 | FwupdResultPrivate *priv = GET_PRIVATE (result); | |
455 | g_return_val_if_fail (FWUPD_IS_RESULT (result), 0); | |
456 | return priv->device_flashes_left; | |
457 | } | |
458 | ||
459 | /** | |
460 | * fwupd_result_device_set_flashes_left: | |
461 | * @result: A #FwupdResult | |
462 | * @flashes_left: the description | |
463 | * | |
464 | * Sets the number of flash cycles left on the device | |
465 | * | |
466 | * Since: 0.7.1 | |
467 | **/ | |
468 | void | |
469 | fwupd_result_set_device_flashes_left (FwupdResult *result, guint32 flashes_left) | |
470 | { | |
471 | FwupdResultPrivate *priv = GET_PRIVATE (result); | |
472 | g_return_if_fail (FWUPD_IS_RESULT (result)); | |
473 | priv->device_flashes_left = flashes_left; | |
474 | } | |
475 | ||
476 | /** | |
358 | 477 | * fwupd_result_set_update_version: |
359 | 478 | * @result: A #FwupdResult |
360 | 479 | * @update_version: the update version, e.g. "1.2.4" |
1179 | 1298 | |
1180 | 1299 | /* create an array with all the metadata in */ |
1181 | 1300 | g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY); |
1182 | if (priv->guid != NULL) { | |
1301 | if (priv->guids->len > 0) { | |
1302 | guint i; | |
1303 | g_autoptr(GString) str = g_string_new (""); | |
1304 | for (i = 0; i < priv->guids->len; i++) { | |
1305 | const gchar *guid = g_ptr_array_index (priv->guids, i); | |
1306 | g_string_append_printf (str, "%s,", guid); | |
1307 | } | |
1308 | if (str->len > 0) | |
1309 | g_string_truncate (str, str->len - 1); | |
1183 | 1310 | g_variant_builder_add (&builder, "{sv}", |
1184 | 1311 | FWUPD_RESULT_KEY_GUID, |
1185 | g_variant_new_string (priv->guid)); | |
1312 | g_variant_new_string (str->str)); | |
1186 | 1313 | } |
1187 | 1314 | if (priv->device_name != NULL) { |
1188 | 1315 | g_variant_builder_add (&builder, "{sv}", |
1316 | 1443 | FWUPD_RESULT_KEY_DEVICE_VERSION_LOWEST, |
1317 | 1444 | g_variant_new_string (priv->device_version_lowest)); |
1318 | 1445 | } |
1446 | if (priv->device_flashes_left > 0) { | |
1447 | g_variant_builder_add (&builder, "{sv}", | |
1448 | FWUPD_RESULT_KEY_DEVICE_FLASHES_LEFT, | |
1449 | g_variant_new_uint32 (priv->device_flashes_left)); | |
1450 | } | |
1319 | 1451 | |
1320 | 1452 | /* supported types */ |
1321 | if (g_strcmp0 (type_string, "{sa{sv}}") == 0) | |
1322 | return g_variant_new ("{sa{sv}}", priv->device_id, &builder); | |
1453 | if (g_strcmp0 (type_string, "{sa{sv}}") == 0) { | |
1454 | const gchar *device_id = priv->device_id; | |
1455 | if (device_id == NULL) | |
1456 | device_id = ""; | |
1457 | return g_variant_new ("{sa{sv}}", device_id, &builder); | |
1458 | } | |
1323 | 1459 | if (g_strcmp0 (type_string, "(a{sv})") == 0) |
1324 | 1460 | return g_variant_new ("(a{sv})", &builder); |
1325 | 1461 | return NULL; |
1344 | 1480 | return; |
1345 | 1481 | } |
1346 | 1482 | if (g_strcmp0 (key, FWUPD_RESULT_KEY_GUID) == 0) { |
1347 | fwupd_result_set_guid (result, g_variant_get_string (value, NULL)); | |
1483 | guint i; | |
1484 | const gchar *guids = g_variant_get_string (value, NULL); | |
1485 | g_auto(GStrv) split = g_strsplit (guids, ",", -1); | |
1486 | for (i = 0; split[i] != NULL; i++) | |
1487 | fwupd_result_add_guid (result, split[i]); | |
1348 | 1488 | return; |
1349 | 1489 | } |
1350 | 1490 | if (g_strcmp0 (key, FWUPD_RESULT_KEY_DEVICE_NAME) == 0) { |
1450 | 1590 | fwupd_result_set_device_version_lowest (result, g_variant_get_string (value, NULL)); |
1451 | 1591 | return; |
1452 | 1592 | } |
1593 | if (g_strcmp0 (key, FWUPD_RESULT_KEY_DEVICE_FLASHES_LEFT) == 0) { | |
1594 | fwupd_result_set_device_flashes_left (result, g_variant_get_uint32 (value)); | |
1595 | return; | |
1596 | } | |
1453 | 1597 | } |
1454 | 1598 | |
1455 | 1599 | /** |
1510 | 1654 | if (value == 0) |
1511 | 1655 | return; |
1512 | 1656 | tmp = g_format_size (value); |
1657 | fwupd_pad_kv_str (str, key, tmp); | |
1658 | } | |
1659 | ||
1660 | /** | |
1661 | * fwupd_pad_kv_int: | |
1662 | **/ | |
1663 | static void | |
1664 | fwupd_pad_kv_int (GString *str, const gchar *key, guint32 value) | |
1665 | { | |
1666 | g_autofree gchar *tmp = NULL; | |
1667 | ||
1668 | /* ignore */ | |
1669 | if (value == 0) | |
1670 | return; | |
1671 | tmp = g_strdup_printf("%d", value); | |
1513 | 1672 | fwupd_pad_kv_str (str, key, tmp); |
1514 | 1673 | } |
1515 | 1674 | |
1592 | 1751 | { |
1593 | 1752 | FwupdResultPrivate *priv = GET_PRIVATE (result); |
1594 | 1753 | GString *str; |
1754 | guint i; | |
1595 | 1755 | |
1596 | 1756 | g_return_val_if_fail (FWUPD_IS_RESULT (result), NULL); |
1597 | 1757 | |
1598 | 1758 | str = g_string_new (""); |
1599 | 1759 | |
1600 | 1760 | /* not set when using GetDetails */ |
1601 | if (priv->device_id != NULL) | |
1602 | g_string_append_printf (str, "%s\n", priv->device_id); | |
1761 | if (priv->device_name != NULL) | |
1762 | g_string_append_printf (str, "%s\n", priv->device_name); | |
1763 | else | |
1764 | g_string_append_printf (str, "%s\n", "Unknown Device"); | |
1603 | 1765 | |
1604 | 1766 | /* device */ |
1605 | fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_GUID, priv->guid); | |
1606 | fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_DEVICE_NAME, priv->device_name); | |
1767 | for (i = 0; i < priv->guids->len; i++) { | |
1768 | const gchar *guid = g_ptr_array_index (priv->guids, i); | |
1769 | fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_GUID, guid); | |
1770 | } | |
1771 | fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_DEVICE_ID, priv->device_id); | |
1607 | 1772 | fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_DEVICE_DESCRIPTION, priv->device_description); |
1608 | 1773 | fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_DEVICE_PROVIDER, priv->device_provider); |
1609 | 1774 | fwupd_pad_kv_dfl (str, FWUPD_RESULT_KEY_DEVICE_FLAGS, priv->device_flags); |
1613 | 1778 | fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_DEVICE_VENDOR, priv->device_vendor); |
1614 | 1779 | fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_DEVICE_VERSION, priv->device_version); |
1615 | 1780 | fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_DEVICE_VERSION_LOWEST, priv->device_version_lowest); |
1781 | fwupd_pad_kv_int (str, FWUPD_RESULT_KEY_DEVICE_FLASHES_LEFT, priv->device_flashes_left); | |
1616 | 1782 | fwupd_pad_kv_unx (str, FWUPD_RESULT_KEY_DEVICE_CREATED, priv->device_created); |
1617 | 1783 | fwupd_pad_kv_unx (str, FWUPD_RESULT_KEY_DEVICE_MODIFIED, priv->device_modified); |
1618 | 1784 | |
1633 | 1799 | fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_UPDATE_VENDOR, priv->update_vendor); |
1634 | 1800 | fwupd_pad_kv_ups (str, FWUPD_RESULT_KEY_UPDATE_STATE, priv->update_state); |
1635 | 1801 | fwupd_pad_kv_str (str, FWUPD_RESULT_KEY_UPDATE_ERROR, priv->update_error); |
1636 | fwupd_pad_kv_tfl (str, FWUPD_RESULT_KEY_UPDATE_TRUST_FLAGS, priv->update_trust_flags); | |
1802 | if (priv->update_version != NULL) | |
1803 | fwupd_pad_kv_tfl (str, FWUPD_RESULT_KEY_UPDATE_TRUST_FLAGS, priv->update_trust_flags); | |
1637 | 1804 | |
1638 | 1805 | return g_string_free (str, FALSE); |
1639 | 1806 | } |
1713 | 1880 | FwupdResultPrivate *priv = GET_PRIVATE (result); |
1714 | 1881 | priv->device_checksum_kind = G_CHECKSUM_SHA1; |
1715 | 1882 | priv->update_checksum_kind = G_CHECKSUM_SHA1; |
1883 | priv->guids = g_ptr_array_new_with_free_func (g_free); | |
1716 | 1884 | } |
1717 | 1885 | |
1718 | 1886 | /** |
1724 | 1892 | FwupdResult *result = FWUPD_RESULT (object); |
1725 | 1893 | FwupdResultPrivate *priv = GET_PRIVATE (result); |
1726 | 1894 | |
1895 | g_ptr_array_unref (priv->guids); | |
1727 | 1896 | g_free (priv->device_description); |
1728 | 1897 | g_free (priv->device_checksum); |
1729 | 1898 | g_free (priv->device_id); |
1732 | 1901 | g_free (priv->device_provider); |
1733 | 1902 | g_free (priv->device_version); |
1734 | 1903 | g_free (priv->device_version_lowest); |
1735 | g_free (priv->guid); | |
1736 | 1904 | g_free (priv->update_description); |
1737 | 1905 | g_free (priv->update_error); |
1738 | 1906 | g_free (priv->update_filename); |
46 | 46 | FwupdResult *fwupd_result_new (void); |
47 | 47 | FwupdResult *fwupd_result_new_from_data (GVariant *data); |
48 | 48 | |
49 | /* matches */ | |
50 | void fwupd_result_add_guid (FwupdResult *result, | |
51 | const gchar *guid); | |
52 | gboolean fwupd_result_has_guid (FwupdResult *result, | |
53 | const gchar *guid); | |
54 | GPtrArray *fwupd_result_get_guids (FwupdResult *result); | |
55 | const gchar *fwupd_result_get_guid_default (FwupdResult *result); | |
56 | ||
49 | 57 | /* device-specific */ |
50 | const gchar *fwupd_result_get_guid (FwupdResult *result); | |
51 | void fwupd_result_set_guid (FwupdResult *result, | |
52 | const gchar *guid); | |
53 | 58 | const gchar *fwupd_result_get_device_id (FwupdResult *result); |
54 | 59 | void fwupd_result_set_device_id (FwupdResult *result, |
55 | 60 | const gchar *device_id); |
65 | 70 | const gchar *fwupd_result_get_device_version_lowest (FwupdResult *result); |
66 | 71 | void fwupd_result_set_device_version_lowest (FwupdResult *result, |
67 | 72 | const gchar *device_version_lowest); |
73 | guint32 fwupd_result_get_device_flashes_left (FwupdResult *result); | |
74 | void fwupd_result_set_device_flashes_left (FwupdResult *result, | |
75 | guint32 flashes_left); | |
68 | 76 | guint64 fwupd_result_get_device_flags (FwupdResult *result); |
69 | 77 | void fwupd_result_set_device_flags (FwupdResult *result, |
70 | 78 | guint64 device_flags); |
146 | 154 | const gchar *type_string); |
147 | 155 | gchar *fwupd_result_to_string (FwupdResult *result); |
148 | 156 | |
157 | /* deprecated */ | |
158 | G_DEPRECATED_FOR(fwupd_result_get_guids) | |
159 | const gchar *fwupd_result_get_guid (FwupdResult *result); | |
160 | G_DEPRECATED_FOR(fwupd_result_add_guid) | |
161 | void fwupd_result_set_guid (FwupdResult *result, | |
162 | const gchar *guid); | |
163 | ||
149 | 164 | G_END_DECLS |
150 | 165 | |
151 | 166 | #endif /* __FWUPD_RESULT_H */ |
111 | 111 | fwupd_result_set_device_id (result, "USB:foo"); |
112 | 112 | fwupd_result_set_device_modified (result, 60 * 60 * 24); |
113 | 113 | fwupd_result_set_device_name (result, "ColorHug2"); |
114 | fwupd_result_set_guid (result, "2082b5e0-7a64-478a-b1b2-e3404fab6dad"); | |
114 | fwupd_result_add_guid (result, "2082b5e0-7a64-478a-b1b2-e3404fab6dad"); | |
115 | fwupd_result_add_guid (result, "00000000-0000-0000-0000-000000000000"); | |
115 | 116 | fwupd_result_set_update_checksum (result, "deadbeef"); |
116 | 117 | fwupd_result_set_update_description (result, "<p>Hi there!</p>"); |
117 | 118 | fwupd_result_set_update_filename (result, "firmware.bin"); |
118 | 119 | fwupd_result_set_update_id (result, "org.dave.ColorHug.firmware"); |
119 | 120 | fwupd_result_set_update_size (result, 1024); |
120 | 121 | fwupd_result_set_update_uri (result, "http://foo.com"); |
122 | fwupd_result_set_update_version (result, "1.2.3"); | |
121 | 123 | fwupd_result_add_device_flag (result, FU_DEVICE_FLAG_REQUIRE_AC); |
122 | 124 | fwupd_result_set_update_trust_flags (result, FWUPD_TRUST_FLAG_PAYLOAD); |
123 | 125 | str = fwupd_result_to_string (result); |
124 | 126 | g_print ("\n%s", str); |
125 | 127 | |
128 | /* check GUIDs */ | |
129 | g_assert (fwupd_result_has_guid (result, "2082b5e0-7a64-478a-b1b2-e3404fab6dad")); | |
130 | g_assert (fwupd_result_has_guid (result, "00000000-0000-0000-0000-000000000000")); | |
131 | g_assert (!fwupd_result_has_guid (result, "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")); | |
132 | ||
126 | 133 | ret = as_test_compare_lines (str, |
127 | "USB:foo\n" | |
134 | "ColorHug2\n" | |
128 | 135 | " Guid: 2082b5e0-7a64-478a-b1b2-e3404fab6dad\n" |
129 | " DisplayName: ColorHug2\n" | |
136 | " Guid: 00000000-0000-0000-0000-000000000000\n" | |
137 | " DeviceID: USB:foo\n" | |
130 | 138 | " Flags: allow-offline|require-ac\n" |
131 | 139 | " FirmwareHash: beefdead\n" |
132 | 140 | " DeviceChecksumKind: sha256\n" |
134 | 142 | " Modified: 1970-01-02\n" |
135 | 143 | " AppstreamId: org.dave.ColorHug.firmware\n" |
136 | 144 | " UpdateDescription: <p>Hi there!</p>\n" |
145 | " UpdateVersion: 1.2.3\n" | |
137 | 146 | " FilenameCab: firmware.bin\n" |
138 | 147 | " UpdateHash: deadbeef\n" |
139 | 148 | " UpdateChecksumKind: sha1\n" |
164 | 173 | /* check device */ |
165 | 174 | res = g_ptr_array_index (array, 0); |
166 | 175 | g_assert (FWUPD_IS_RESULT (res)); |
167 | g_assert_cmpstr (fwupd_result_get_guid (res), !=, NULL); | |
176 | g_assert_cmpstr (fwupd_result_get_guid_default (res), !=, NULL); | |
168 | 177 | g_assert_cmpstr (fwupd_result_get_device_id (res), !=, NULL); |
169 | 178 | } |
170 | 179 | |
188 | 197 | /* check device */ |
189 | 198 | res = g_ptr_array_index (array, 0); |
190 | 199 | g_assert (FWUPD_IS_RESULT (res)); |
191 | g_assert_cmpstr (fwupd_result_get_guid (res), !=, NULL); | |
200 | g_assert_cmpstr (fwupd_result_get_guid_default (res), !=, NULL); | |
192 | 201 | g_assert_cmpstr (fwupd_result_get_device_id (res), !=, NULL); |
193 | 202 | } |
194 | 203 |
7 | 7 | msgstr "" |
8 | 8 | "Project-Id-Version: fwupd\n" |
9 | 9 | "Report-Msgid-Bugs-To: \n" |
10 | "POT-Creation-Date: 2016-04-01 14:38+0100\n" | |
11 | "PO-Revision-Date: 2016-04-01 13:38+0000\n" | |
10 | "POT-Creation-Date: 2016-06-13 13:29+0100\n" | |
11 | "PO-Revision-Date: 2016-06-13 12:29+0000\n" | |
12 | 12 | "Last-Translator: Richard Hughes <richard@hughsie.com>\n" |
13 | 13 | "Language-Team: Czech (http://www.transifex.com/hughsie/fwupd/language/cs/)\n" |
14 | 14 | "MIME-Version: 1.0\n" |
95 | 95 | msgstr "Odebráno" |
96 | 96 | |
97 | 97 | #. TRANSLATORS: this is when a device is hotplugged |
98 | #. TRANSLATORS: this is when the daemon state changes | |
98 | 99 | msgid "Changed" |
99 | 100 | msgstr "Změněno" |
100 | 101 | |
121 | 122 | #. TRANSLATORS: detected a DFU device |
122 | 123 | msgid "Found" |
123 | 124 | msgstr "Nalezeno" |
125 | ||
126 | #. TRANSLATORS: DFU protocol version, e.g. 1.1 | |
127 | msgid "Protocol" | |
128 | msgstr "" | |
124 | 129 | |
125 | 130 | #. TRANSLATORS: probably not run as root... |
126 | 131 | #. TRANSLATORS: device has failed to report status |
321 | 326 | msgid "%s has firmware updates:" |
322 | 327 | msgstr "%s má aktualizace firmwaru:" |
323 | 328 | |
324 | #. TRANSLATORS: a GUID for the hardware | |
325 | 329 | msgid "GUID" |
326 | 330 | msgstr "GUID" |
327 | 331 | |
328 | 332 | #. TRANSLATORS: section header for firmware version |
329 | msgid "Version" | |
330 | msgstr "Verze" | |
333 | msgid "Update Version" | |
334 | msgstr "" | |
331 | 335 | |
332 | 336 | #. TRANSLATORS: section header for firmware checksum |
333 | msgid "Checksum" | |
334 | msgstr "Kontrolní součet" | |
335 | ||
336 | msgid "Checksum Type" | |
337 | msgid "Update Checksum" | |
338 | msgstr "" | |
339 | ||
340 | msgid "Update Checksum Type" | |
337 | 341 | msgstr "" |
338 | 342 | |
339 | 343 | #. TRANSLATORS: section header for firmware remote http:// |
340 | msgid "Location" | |
341 | msgstr "Umístění" | |
344 | msgid "Update Location" | |
345 | msgstr "" | |
342 | 346 | |
343 | 347 | #. TRANSLATORS: section header for long firmware desc |
344 | msgid "Description" | |
345 | msgstr "Popis" | |
348 | msgid "Update Description" | |
349 | msgstr "" | |
350 | ||
351 | #. TRANSLATORS: this is when a device is hotplugged | |
352 | msgid "Device added:" | |
353 | msgstr "" | |
354 | ||
355 | #. TRANSLATORS: this is when a device is hotplugged | |
356 | msgid "Device removed:" | |
357 | msgstr "" | |
358 | ||
359 | #. TRANSLATORS: this is when a device has been updated | |
360 | msgid "Device changed:" | |
361 | msgstr "" | |
346 | 362 | |
347 | 363 | #. TRANSLATORS: command line option |
348 | 364 | msgid "Show extra debugging information" |
360 | 376 | msgid "Allow downgrading firmware versions" |
361 | 377 | msgstr "Povolit ponížení verze firmwaru" |
362 | 378 | |
379 | #. TRANSLATORS: command line option | |
380 | msgid "Override provider warning" | |
381 | msgstr "" | |
382 | ||
363 | 383 | #. TRANSLATORS: command description |
364 | 384 | msgid "Get all devices that support firmware updates" |
365 | 385 | msgstr "Zjistit všechna zařízení podporující aktualizaci firmwaru" |
411 | 431 | #. TRANSLATORS: command description |
412 | 432 | msgid "Update the stored metadata with current ROM contents" |
413 | 433 | msgstr "Aktualizovat uložená metadata pomocí aktuálního obsahu ROM" |
434 | ||
435 | #. TRANSLATORS: command description | |
436 | msgid "Monitor the daemon for events" | |
437 | msgstr "" | |
414 | 438 | |
415 | 439 | #. TRANSLATORS: program name |
416 | 440 | msgid "Firmware Utility" |
8 | 8 | msgstr "" |
9 | 9 | "Project-Id-Version: fwupd\n" |
10 | 10 | "Report-Msgid-Bugs-To: \n" |
11 | "POT-Creation-Date: 2016-04-01 14:38+0100\n" | |
12 | "PO-Revision-Date: 2016-04-01 13:38+0000\n" | |
11 | "POT-Creation-Date: 2016-06-13 13:29+0100\n" | |
12 | "PO-Revision-Date: 2016-06-13 12:29+0000\n" | |
13 | 13 | "Last-Translator: Richard Hughes <richard@hughsie.com>\n" |
14 | 14 | "Language-Team: German (http://www.transifex.com/hughsie/fwupd/language/de/)\n" |
15 | 15 | "MIME-Version: 1.0\n" |
96 | 96 | msgstr "Entfernt" |
97 | 97 | |
98 | 98 | #. TRANSLATORS: this is when a device is hotplugged |
99 | #. TRANSLATORS: this is when the daemon state changes | |
99 | 100 | msgid "Changed" |
100 | 101 | msgstr "Geändert" |
101 | 102 | |
122 | 123 | #. TRANSLATORS: detected a DFU device |
123 | 124 | msgid "Found" |
124 | 125 | msgstr "Gefunden" |
126 | ||
127 | #. TRANSLATORS: DFU protocol version, e.g. 1.1 | |
128 | msgid "Protocol" | |
129 | msgstr "" | |
125 | 130 | |
126 | 131 | #. TRANSLATORS: probably not run as root... |
127 | 132 | #. TRANSLATORS: device has failed to report status |
322 | 327 | msgid "%s has firmware updates:" |
323 | 328 | msgstr "Firmwareaktualisierungen für %s verfügbar:" |
324 | 329 | |
325 | #. TRANSLATORS: a GUID for the hardware | |
326 | 330 | msgid "GUID" |
327 | 331 | msgstr "GUID" |
328 | 332 | |
329 | 333 | #. TRANSLATORS: section header for firmware version |
330 | msgid "Version" | |
331 | msgstr "Version" | |
334 | msgid "Update Version" | |
335 | msgstr "" | |
332 | 336 | |
333 | 337 | #. TRANSLATORS: section header for firmware checksum |
334 | msgid "Checksum" | |
335 | msgstr "Prüfsumme" | |
336 | ||
337 | msgid "Checksum Type" | |
338 | msgid "Update Checksum" | |
339 | msgstr "" | |
340 | ||
341 | msgid "Update Checksum Type" | |
338 | 342 | msgstr "" |
339 | 343 | |
340 | 344 | #. TRANSLATORS: section header for firmware remote http:// |
341 | msgid "Location" | |
342 | msgstr "Ort" | |
345 | msgid "Update Location" | |
346 | msgstr "" | |
343 | 347 | |
344 | 348 | #. TRANSLATORS: section header for long firmware desc |
345 | msgid "Description" | |
346 | msgstr "Beschreibung" | |
349 | msgid "Update Description" | |
350 | msgstr "" | |
351 | ||
352 | #. TRANSLATORS: this is when a device is hotplugged | |
353 | msgid "Device added:" | |
354 | msgstr "" | |
355 | ||
356 | #. TRANSLATORS: this is when a device is hotplugged | |
357 | msgid "Device removed:" | |
358 | msgstr "" | |
359 | ||
360 | #. TRANSLATORS: this is when a device has been updated | |
361 | msgid "Device changed:" | |
362 | msgstr "" | |
347 | 363 | |
348 | 364 | #. TRANSLATORS: command line option |
349 | 365 | msgid "Show extra debugging information" |
361 | 377 | msgid "Allow downgrading firmware versions" |
362 | 378 | msgstr "Einspielen niedrigerer Firmwareversionen zulassen (Downgrade)" |
363 | 379 | |
380 | #. TRANSLATORS: command line option | |
381 | msgid "Override provider warning" | |
382 | msgstr "" | |
383 | ||
364 | 384 | #. TRANSLATORS: command description |
365 | 385 | msgid "Get all devices that support firmware updates" |
366 | 386 | msgstr "Alle Geräte ermitteln, die Firmware-Aktualisierungen unterstützen" |
412 | 432 | #. TRANSLATORS: command description |
413 | 433 | msgid "Update the stored metadata with current ROM contents" |
414 | 434 | msgstr "Gespeicherte Metadaten mit dem aktuellen ROM-Inhalt aktualisieren" |
435 | ||
436 | #. TRANSLATORS: command description | |
437 | msgid "Monitor the daemon for events" | |
438 | msgstr "" | |
415 | 439 | |
416 | 440 | #. TRANSLATORS: program name |
417 | 441 | msgid "Firmware Utility" |
7 | 7 | msgstr "" |
8 | 8 | "Project-Id-Version: fwupd\n" |
9 | 9 | "Report-Msgid-Bugs-To: \n" |
10 | "POT-Creation-Date: 2016-04-01 14:38+0100\n" | |
11 | "PO-Revision-Date: 2016-04-01 13:38+0000\n" | |
10 | "POT-Creation-Date: 2016-06-13 13:29+0100\n" | |
11 | "PO-Revision-Date: 2016-06-13 12:29+0000\n" | |
12 | 12 | "Last-Translator: Richard Hughes <richard@hughsie.com>\n" |
13 | 13 | "Language-Team: English (United Kingdom) (http://www.transifex.com/hughsie/fwupd/language/en_GB/)\n" |
14 | 14 | "MIME-Version: 1.0\n" |
95 | 95 | msgstr "Removed" |
96 | 96 | |
97 | 97 | #. TRANSLATORS: this is when a device is hotplugged |
98 | #. TRANSLATORS: this is when the daemon state changes | |
98 | 99 | msgid "Changed" |
99 | 100 | msgstr "Changed" |
100 | 101 | |
121 | 122 | #. TRANSLATORS: detected a DFU device |
122 | 123 | msgid "Found" |
123 | 124 | msgstr "Found" |
125 | ||
126 | #. TRANSLATORS: DFU protocol version, e.g. 1.1 | |
127 | msgid "Protocol" | |
128 | msgstr "" | |
124 | 129 | |
125 | 130 | #. TRANSLATORS: probably not run as root... |
126 | 131 | #. TRANSLATORS: device has failed to report status |
321 | 326 | msgid "%s has firmware updates:" |
322 | 327 | msgstr "%s has firmware updates:" |
323 | 328 | |
324 | #. TRANSLATORS: a GUID for the hardware | |
325 | 329 | msgid "GUID" |
326 | 330 | msgstr "GUID" |
327 | 331 | |
328 | 332 | #. TRANSLATORS: section header for firmware version |
329 | msgid "Version" | |
330 | msgstr "Version" | |
333 | msgid "Update Version" | |
334 | msgstr "" | |
331 | 335 | |
332 | 336 | #. TRANSLATORS: section header for firmware checksum |
333 | msgid "Checksum" | |
334 | msgstr "Checksum" | |
335 | ||
336 | msgid "Checksum Type" | |
337 | msgid "Update Checksum" | |
338 | msgstr "" | |
339 | ||
340 | msgid "Update Checksum Type" | |
337 | 341 | msgstr "" |
338 | 342 | |
339 | 343 | #. TRANSLATORS: section header for firmware remote http:// |
340 | msgid "Location" | |
341 | msgstr "Location" | |
344 | msgid "Update Location" | |
345 | msgstr "" | |
342 | 346 | |
343 | 347 | #. TRANSLATORS: section header for long firmware desc |
344 | msgid "Description" | |
345 | msgstr "Description" | |
348 | msgid "Update Description" | |
349 | msgstr "" | |
350 | ||
351 | #. TRANSLATORS: this is when a device is hotplugged | |
352 | msgid "Device added:" | |
353 | msgstr "" | |
354 | ||
355 | #. TRANSLATORS: this is when a device is hotplugged | |
356 | msgid "Device removed:" | |
357 | msgstr "" | |
358 | ||
359 | #. TRANSLATORS: this is when a device has been updated | |
360 | msgid "Device changed:" | |
361 | msgstr "" | |
346 | 362 | |
347 | 363 | #. TRANSLATORS: command line option |
348 | 364 | msgid "Show extra debugging information" |
360 | 376 | msgid "Allow downgrading firmware versions" |
361 | 377 | msgstr "Allow downgrading firmware versions" |
362 | 378 | |
379 | #. TRANSLATORS: command line option | |
380 | msgid "Override provider warning" | |
381 | msgstr "" | |
382 | ||
363 | 383 | #. TRANSLATORS: command description |
364 | 384 | msgid "Get all devices that support firmware updates" |
365 | 385 | msgstr "Get all devices that support firmware updates" |
411 | 431 | #. TRANSLATORS: command description |
412 | 432 | msgid "Update the stored metadata with current ROM contents" |
413 | 433 | msgstr "Update the stored metadata with current ROM contents" |
434 | ||
435 | #. TRANSLATORS: command description | |
436 | msgid "Monitor the daemon for events" | |
437 | msgstr "" | |
414 | 438 | |
415 | 439 | #. TRANSLATORS: program name |
416 | 440 | msgid "Firmware Utility" |
7 | 7 | msgstr "" |
8 | 8 | "Project-Id-Version: fwupd\n" |
9 | 9 | "Report-Msgid-Bugs-To: \n" |
10 | "POT-Creation-Date: 2016-04-01 14:38+0100\n" | |
11 | "PO-Revision-Date: 2016-04-01 13:38+0000\n" | |
10 | "POT-Creation-Date: 2016-06-13 13:29+0100\n" | |
11 | "PO-Revision-Date: 2016-06-13 12:29+0000\n" | |
12 | 12 | "Last-Translator: Richard Hughes <richard@hughsie.com>\n" |
13 | 13 | "Language-Team: French (http://www.transifex.com/hughsie/fwupd/language/fr/)\n" |
14 | 14 | "MIME-Version: 1.0\n" |
95 | 95 | msgstr "" |
96 | 96 | |
97 | 97 | #. TRANSLATORS: this is when a device is hotplugged |
98 | #. TRANSLATORS: this is when the daemon state changes | |
98 | 99 | msgid "Changed" |
99 | 100 | msgstr "" |
100 | 101 | |
120 | 121 | |
121 | 122 | #. TRANSLATORS: detected a DFU device |
122 | 123 | msgid "Found" |
124 | msgstr "" | |
125 | ||
126 | #. TRANSLATORS: DFU protocol version, e.g. 1.1 | |
127 | msgid "Protocol" | |
123 | 128 | msgstr "" |
124 | 129 | |
125 | 130 | #. TRANSLATORS: probably not run as root... |
321 | 326 | msgid "%s has firmware updates:" |
322 | 327 | msgstr "" |
323 | 328 | |
324 | #. TRANSLATORS: a GUID for the hardware | |
325 | 329 | msgid "GUID" |
326 | 330 | msgstr "" |
327 | 331 | |
328 | 332 | #. TRANSLATORS: section header for firmware version |
329 | msgid "Version" | |
333 | msgid "Update Version" | |
330 | 334 | msgstr "" |
331 | 335 | |
332 | 336 | #. TRANSLATORS: section header for firmware checksum |
333 | msgid "Checksum" | |
334 | msgstr "" | |
335 | ||
336 | msgid "Checksum Type" | |
337 | msgid "Update Checksum" | |
338 | msgstr "" | |
339 | ||
340 | msgid "Update Checksum Type" | |
337 | 341 | msgstr "" |
338 | 342 | |
339 | 343 | #. TRANSLATORS: section header for firmware remote http:// |
340 | msgid "Location" | |
344 | msgid "Update Location" | |
341 | 345 | msgstr "" |
342 | 346 | |
343 | 347 | #. TRANSLATORS: section header for long firmware desc |
344 | msgid "Description" | |
348 | msgid "Update Description" | |
349 | msgstr "" | |
350 | ||
351 | #. TRANSLATORS: this is when a device is hotplugged | |
352 | msgid "Device added:" | |
353 | msgstr "" | |
354 | ||
355 | #. TRANSLATORS: this is when a device is hotplugged | |
356 | msgid "Device removed:" | |
357 | msgstr "" | |
358 | ||
359 | #. TRANSLATORS: this is when a device has been updated | |
360 | msgid "Device changed:" | |
345 | 361 | msgstr "" |
346 | 362 | |
347 | 363 | #. TRANSLATORS: command line option |
360 | 376 | msgid "Allow downgrading firmware versions" |
361 | 377 | msgstr "" |
362 | 378 | |
379 | #. TRANSLATORS: command line option | |
380 | msgid "Override provider warning" | |
381 | msgstr "" | |
382 | ||
363 | 383 | #. TRANSLATORS: command description |
364 | 384 | msgid "Get all devices that support firmware updates" |
365 | 385 | msgstr "Obtenir la liste des périphériques supportant les mises à jour de micrologiciel" |
412 | 432 | msgid "Update the stored metadata with current ROM contents" |
413 | 433 | msgstr "" |
414 | 434 | |
435 | #. TRANSLATORS: command description | |
436 | msgid "Monitor the daemon for events" | |
437 | msgstr "" | |
438 | ||
415 | 439 | #. TRANSLATORS: program name |
416 | 440 | msgid "Firmware Utility" |
417 | 441 | msgstr "" |
8 | 8 | msgstr "" |
9 | 9 | "Project-Id-Version: fwupd\n" |
10 | 10 | "Report-Msgid-Bugs-To: \n" |
11 | "POT-Creation-Date: 2016-04-01 14:38+0100\n" | |
12 | "PO-Revision-Date: 2016-04-01 13:38+0000\n" | |
11 | "POT-Creation-Date: 2016-06-13 13:29+0100\n" | |
12 | "PO-Revision-Date: 2016-06-13 12:29+0000\n" | |
13 | 13 | "Last-Translator: Richard Hughes <richard@hughsie.com>\n" |
14 | 14 | "Language-Team: Hebrew (http://www.transifex.com/hughsie/fwupd/language/he/)\n" |
15 | 15 | "MIME-Version: 1.0\n" |
96 | 96 | msgstr "" |
97 | 97 | |
98 | 98 | #. TRANSLATORS: this is when a device is hotplugged |
99 | #. TRANSLATORS: this is when the daemon state changes | |
99 | 100 | msgid "Changed" |
100 | 101 | msgstr "" |
101 | 102 | |
121 | 122 | |
122 | 123 | #. TRANSLATORS: detected a DFU device |
123 | 124 | msgid "Found" |
125 | msgstr "" | |
126 | ||
127 | #. TRANSLATORS: DFU protocol version, e.g. 1.1 | |
128 | msgid "Protocol" | |
124 | 129 | msgstr "" |
125 | 130 | |
126 | 131 | #. TRANSLATORS: probably not run as root... |
322 | 327 | msgid "%s has firmware updates:" |
323 | 328 | msgstr "ישנם עדכוני קושחה עבור %s:" |
324 | 329 | |
325 | #. TRANSLATORS: a GUID for the hardware | |
326 | 330 | msgid "GUID" |
327 | 331 | msgstr "" |
328 | 332 | |
329 | 333 | #. TRANSLATORS: section header for firmware version |
330 | msgid "Version" | |
331 | msgstr "גרסא" | |
334 | msgid "Update Version" | |
335 | msgstr "" | |
332 | 336 | |
333 | 337 | #. TRANSLATORS: section header for firmware checksum |
334 | msgid "Checksum" | |
335 | msgstr "סכום ביקורת" | |
336 | ||
337 | msgid "Checksum Type" | |
338 | msgid "Update Checksum" | |
339 | msgstr "" | |
340 | ||
341 | msgid "Update Checksum Type" | |
338 | 342 | msgstr "" |
339 | 343 | |
340 | 344 | #. TRANSLATORS: section header for firmware remote http:// |
341 | msgid "Location" | |
342 | msgstr "מיקום" | |
345 | msgid "Update Location" | |
346 | msgstr "" | |
343 | 347 | |
344 | 348 | #. TRANSLATORS: section header for long firmware desc |
345 | msgid "Description" | |
346 | msgstr "תיאור" | |
349 | msgid "Update Description" | |
350 | msgstr "" | |
351 | ||
352 | #. TRANSLATORS: this is when a device is hotplugged | |
353 | msgid "Device added:" | |
354 | msgstr "" | |
355 | ||
356 | #. TRANSLATORS: this is when a device is hotplugged | |
357 | msgid "Device removed:" | |
358 | msgstr "" | |
359 | ||
360 | #. TRANSLATORS: this is when a device has been updated | |
361 | msgid "Device changed:" | |
362 | msgstr "" | |
347 | 363 | |
348 | 364 | #. TRANSLATORS: command line option |
349 | 365 | msgid "Show extra debugging information" |
361 | 377 | msgid "Allow downgrading firmware versions" |
362 | 378 | msgstr "" |
363 | 379 | |
380 | #. TRANSLATORS: command line option | |
381 | msgid "Override provider warning" | |
382 | msgstr "" | |
383 | ||
364 | 384 | #. TRANSLATORS: command description |
365 | 385 | msgid "Get all devices that support firmware updates" |
366 | 386 | msgstr "מציג כל המכשירים התומכים בעדכוני קושחה" |
413 | 433 | msgid "Update the stored metadata with current ROM contents" |
414 | 434 | msgstr "" |
415 | 435 | |
436 | #. TRANSLATORS: command description | |
437 | msgid "Monitor the daemon for events" | |
438 | msgstr "" | |
439 | ||
416 | 440 | #. TRANSLATORS: program name |
417 | 441 | msgid "Firmware Utility" |
418 | 442 | msgstr "" |
7 | 7 | msgstr "" |
8 | 8 | "Project-Id-Version: fwupd\n" |
9 | 9 | "Report-Msgid-Bugs-To: \n" |
10 | "POT-Creation-Date: 2016-04-01 14:38+0100\n" | |
11 | "PO-Revision-Date: 2016-04-01 13:38+0000\n" | |
10 | "POT-Creation-Date: 2016-06-13 13:29+0100\n" | |
11 | "PO-Revision-Date: 2016-06-13 12:29+0000\n" | |
12 | 12 | "Last-Translator: Richard Hughes <richard@hughsie.com>\n" |
13 | 13 | "Language-Team: Hindi (India) (http://www.transifex.com/hughsie/fwupd/language/hi_IN/)\n" |
14 | 14 | "MIME-Version: 1.0\n" |
95 | 95 | msgstr "" |
96 | 96 | |
97 | 97 | #. TRANSLATORS: this is when a device is hotplugged |
98 | #. TRANSLATORS: this is when the daemon state changes | |
98 | 99 | msgid "Changed" |
99 | 100 | msgstr "" |
100 | 101 | |
120 | 121 | |
121 | 122 | #. TRANSLATORS: detected a DFU device |
122 | 123 | msgid "Found" |
124 | msgstr "" | |
125 | ||
126 | #. TRANSLATORS: DFU protocol version, e.g. 1.1 | |
127 | msgid "Protocol" | |
123 | 128 | msgstr "" |
124 | 129 | |
125 | 130 | #. TRANSLATORS: probably not run as root... |
321 | 326 | msgid "%s has firmware updates:" |
322 | 327 | msgstr "" |
323 | 328 | |
324 | #. TRANSLATORS: a GUID for the hardware | |
325 | 329 | msgid "GUID" |
326 | 330 | msgstr "" |
327 | 331 | |
328 | 332 | #. TRANSLATORS: section header for firmware version |
329 | msgid "Version" | |
333 | msgid "Update Version" | |
330 | 334 | msgstr "" |
331 | 335 | |
332 | 336 | #. TRANSLATORS: section header for firmware checksum |
333 | msgid "Checksum" | |
334 | msgstr "" | |
335 | ||
336 | msgid "Checksum Type" | |
337 | msgid "Update Checksum" | |
338 | msgstr "" | |
339 | ||
340 | msgid "Update Checksum Type" | |
337 | 341 | msgstr "" |
338 | 342 | |
339 | 343 | #. TRANSLATORS: section header for firmware remote http:// |
340 | msgid "Location" | |
344 | msgid "Update Location" | |
341 | 345 | msgstr "" |
342 | 346 | |
343 | 347 | #. TRANSLATORS: section header for long firmware desc |
344 | msgid "Description" | |
348 | msgid "Update Description" | |
349 | msgstr "" | |
350 | ||
351 | #. TRANSLATORS: this is when a device is hotplugged | |
352 | msgid "Device added:" | |
353 | msgstr "" | |
354 | ||
355 | #. TRANSLATORS: this is when a device is hotplugged | |
356 | msgid "Device removed:" | |
357 | msgstr "" | |
358 | ||
359 | #. TRANSLATORS: this is when a device has been updated | |
360 | msgid "Device changed:" | |
345 | 361 | msgstr "" |
346 | 362 | |
347 | 363 | #. TRANSLATORS: command line option |
360 | 376 | msgid "Allow downgrading firmware versions" |
361 | 377 | msgstr "" |
362 | 378 | |
379 | #. TRANSLATORS: command line option | |
380 | msgid "Override provider warning" | |
381 | msgstr "" | |
382 | ||
363 | 383 | #. TRANSLATORS: command description |
364 | 384 | msgid "Get all devices that support firmware updates" |
365 | 385 | msgstr "फर्मवेयर अपडेट का समर्थन करने वाली सभी युक्तियाँ प्राप्त करें " |
412 | 432 | msgid "Update the stored metadata with current ROM contents" |
413 | 433 | msgstr "" |
414 | 434 | |
435 | #. TRANSLATORS: command description | |
436 | msgid "Monitor the daemon for events" | |
437 | msgstr "" | |
438 | ||
415 | 439 | #. TRANSLATORS: program name |
416 | 440 | msgid "Firmware Utility" |
417 | 441 | msgstr "" |
9 | 9 | msgstr "" |
10 | 10 | "Project-Id-Version: fwupd\n" |
11 | 11 | "Report-Msgid-Bugs-To: \n" |
12 | "POT-Creation-Date: 2016-04-01 14:38+0100\n" | |
13 | "PO-Revision-Date: 2016-04-01 13:38+0000\n" | |
12 | "POT-Creation-Date: 2016-06-13 13:29+0100\n" | |
13 | "PO-Revision-Date: 2016-06-13 12:29+0000\n" | |
14 | 14 | "Last-Translator: Richard Hughes <richard@hughsie.com>\n" |
15 | 15 | "Language-Team: Hungarian (http://www.transifex.com/hughsie/fwupd/language/hu/)\n" |
16 | 16 | "MIME-Version: 1.0\n" |
97 | 97 | msgstr "Eltávolítva" |
98 | 98 | |
99 | 99 | #. TRANSLATORS: this is when a device is hotplugged |
100 | #. TRANSLATORS: this is when the daemon state changes | |
100 | 101 | msgid "Changed" |
101 | 102 | msgstr "Módosítva" |
102 | 103 | |
123 | 124 | #. TRANSLATORS: detected a DFU device |
124 | 125 | msgid "Found" |
125 | 126 | msgstr "Megtalálva" |
127 | ||
128 | #. TRANSLATORS: DFU protocol version, e.g. 1.1 | |
129 | msgid "Protocol" | |
130 | msgstr "" | |
126 | 131 | |
127 | 132 | #. TRANSLATORS: probably not run as root... |
128 | 133 | #. TRANSLATORS: device has failed to report status |
323 | 328 | msgid "%s has firmware updates:" |
324 | 329 | msgstr "%s firmware frissítésekkel rendelkezik:" |
325 | 330 | |
326 | #. TRANSLATORS: a GUID for the hardware | |
327 | 331 | msgid "GUID" |
328 | 332 | msgstr "GUID" |
329 | 333 | |
330 | 334 | #. TRANSLATORS: section header for firmware version |
331 | msgid "Version" | |
332 | msgstr "Verzió" | |
335 | msgid "Update Version" | |
336 | msgstr "Frissítés verziója" | |
333 | 337 | |
334 | 338 | #. TRANSLATORS: section header for firmware checksum |
335 | msgid "Checksum" | |
336 | msgstr "Ellenőrzőösszeg" | |
337 | ||
338 | msgid "Checksum Type" | |
339 | msgstr "" | |
339 | msgid "Update Checksum" | |
340 | msgstr "Frissítés ellenőrzőösszege" | |
341 | ||
342 | msgid "Update Checksum Type" | |
343 | msgstr "Frissítés ellenőrzőösszegének típusa" | |
340 | 344 | |
341 | 345 | #. TRANSLATORS: section header for firmware remote http:// |
342 | msgid "Location" | |
343 | msgstr "Hely" | |
346 | msgid "Update Location" | |
347 | msgstr "Frissítés helye" | |
344 | 348 | |
345 | 349 | #. TRANSLATORS: section header for long firmware desc |
346 | msgid "Description" | |
347 | msgstr "Leírás" | |
350 | msgid "Update Description" | |
351 | msgstr "Frissítés leírása" | |
352 | ||
353 | #. TRANSLATORS: this is when a device is hotplugged | |
354 | msgid "Device added:" | |
355 | msgstr "Eszköz hozzáadva:" | |
356 | ||
357 | #. TRANSLATORS: this is when a device is hotplugged | |
358 | msgid "Device removed:" | |
359 | msgstr "Eszköz eltávolítva:" | |
360 | ||
361 | #. TRANSLATORS: this is when a device has been updated | |
362 | msgid "Device changed:" | |
363 | msgstr "Eszköz módosítva:" | |
348 | 364 | |
349 | 365 | #. TRANSLATORS: command line option |
350 | 366 | msgid "Show extra debugging information" |
362 | 378 | msgid "Allow downgrading firmware versions" |
363 | 379 | msgstr "Firmware verziók visszafejlesztésének engedélyezése" |
364 | 380 | |
381 | #. TRANSLATORS: command line option | |
382 | msgid "Override provider warning" | |
383 | msgstr "Szolgáltatói figyelmeztetés felülbírálása" | |
384 | ||
365 | 385 | #. TRANSLATORS: command description |
366 | 386 | msgid "Get all devices that support firmware updates" |
367 | 387 | msgstr "Minden eszköz lekérése, amelyek támogatják a firmware frissítéseket" |
413 | 433 | #. TRANSLATORS: command description |
414 | 434 | msgid "Update the stored metadata with current ROM contents" |
415 | 435 | msgstr "A tárolt metaadatok frissítése a jelenlegi ROM tartalmával" |
436 | ||
437 | #. TRANSLATORS: command description | |
438 | msgid "Monitor the daemon for events" | |
439 | msgstr "A démon eseményeinek figyelése" | |
416 | 440 | |
417 | 441 | #. TRANSLATORS: program name |
418 | 442 | msgid "Firmware Utility" |
7 | 7 | msgstr "" |
8 | 8 | "Project-Id-Version: fwupd\n" |
9 | 9 | "Report-Msgid-Bugs-To: \n" |
10 | "POT-Creation-Date: 2016-04-01 14:38+0100\n" | |
11 | "PO-Revision-Date: 2016-04-01 13:38+0000\n" | |
10 | "POT-Creation-Date: 2016-06-13 13:29+0100\n" | |
11 | "PO-Revision-Date: 2016-06-13 12:29+0000\n" | |
12 | 12 | "Last-Translator: Richard Hughes <richard@hughsie.com>\n" |
13 | 13 | "Language-Team: Dutch (Netherlands) (http://www.transifex.com/hughsie/fwupd/language/nl_NL/)\n" |
14 | 14 | "MIME-Version: 1.0\n" |
95 | 95 | msgstr "Verwijderd" |
96 | 96 | |
97 | 97 | #. TRANSLATORS: this is when a device is hotplugged |
98 | #. TRANSLATORS: this is when the daemon state changes | |
98 | 99 | msgid "Changed" |
99 | 100 | msgstr "Gewijzigd" |
100 | 101 | |
121 | 122 | #. TRANSLATORS: detected a DFU device |
122 | 123 | msgid "Found" |
123 | 124 | msgstr "Gevonden" |
125 | ||
126 | #. TRANSLATORS: DFU protocol version, e.g. 1.1 | |
127 | msgid "Protocol" | |
128 | msgstr "" | |
124 | 129 | |
125 | 130 | #. TRANSLATORS: probably not run as root... |
126 | 131 | #. TRANSLATORS: device has failed to report status |
321 | 326 | msgid "%s has firmware updates:" |
322 | 327 | msgstr "%s heeft firmware-updates:" |
323 | 328 | |
324 | #. TRANSLATORS: a GUID for the hardware | |
325 | 329 | msgid "GUID" |
326 | 330 | msgstr "GUID" |
327 | 331 | |
328 | 332 | #. TRANSLATORS: section header for firmware version |
329 | msgid "Version" | |
330 | msgstr "Versie" | |
333 | msgid "Update Version" | |
334 | msgstr "" | |
331 | 335 | |
332 | 336 | #. TRANSLATORS: section header for firmware checksum |
333 | msgid "Checksum" | |
334 | msgstr "Controlesom" | |
335 | ||
336 | msgid "Checksum Type" | |
337 | msgid "Update Checksum" | |
338 | msgstr "" | |
339 | ||
340 | msgid "Update Checksum Type" | |
337 | 341 | msgstr "" |
338 | 342 | |
339 | 343 | #. TRANSLATORS: section header for firmware remote http:// |
340 | msgid "Location" | |
341 | msgstr "Locatie" | |
344 | msgid "Update Location" | |
345 | msgstr "" | |
342 | 346 | |
343 | 347 | #. TRANSLATORS: section header for long firmware desc |
344 | msgid "Description" | |
345 | msgstr "Omschrijving" | |
348 | msgid "Update Description" | |
349 | msgstr "" | |
350 | ||
351 | #. TRANSLATORS: this is when a device is hotplugged | |
352 | msgid "Device added:" | |
353 | msgstr "" | |
354 | ||
355 | #. TRANSLATORS: this is when a device is hotplugged | |
356 | msgid "Device removed:" | |
357 | msgstr "" | |
358 | ||
359 | #. TRANSLATORS: this is when a device has been updated | |
360 | msgid "Device changed:" | |
361 | msgstr "" | |
346 | 362 | |
347 | 363 | #. TRANSLATORS: command line option |
348 | 364 | msgid "Show extra debugging information" |
360 | 376 | msgid "Allow downgrading firmware versions" |
361 | 377 | msgstr "Afwaarderen van oude firmware-versies toestaan" |
362 | 378 | |
379 | #. TRANSLATORS: command line option | |
380 | msgid "Override provider warning" | |
381 | msgstr "" | |
382 | ||
363 | 383 | #. TRANSLATORS: command description |
364 | 384 | msgid "Get all devices that support firmware updates" |
365 | 385 | msgstr "Alle apparaten verkrijgen die firmware-updates ondersteunen" |
411 | 431 | #. TRANSLATORS: command description |
412 | 432 | msgid "Update the stored metadata with current ROM contents" |
413 | 433 | msgstr "De opgeslagen metadata bijwerken met de huidige ROM-inhoud" |
434 | ||
435 | #. TRANSLATORS: command description | |
436 | msgid "Monitor the daemon for events" | |
437 | msgstr "" | |
414 | 438 | |
415 | 439 | #. TRANSLATORS: program name |
416 | 440 | msgid "Firmware Utility" |
3 | 3 | # |
4 | 4 | # Translators: |
5 | 5 | # Cédric Valmary <cvalmary@yahoo.fr>, 2016 |
6 | # Cédric Valmary <cvalmary@yahoo.fr>, 2016 | |
6 | 7 | msgid "" |
7 | 8 | msgstr "" |
8 | 9 | "Project-Id-Version: fwupd\n" |
9 | 10 | "Report-Msgid-Bugs-To: \n" |
10 | "POT-Creation-Date: 2016-04-01 14:38+0100\n" | |
11 | "PO-Revision-Date: 2016-04-01 13:38+0000\n" | |
11 | "POT-Creation-Date: 2016-06-13 13:29+0100\n" | |
12 | "PO-Revision-Date: 2016-06-13 12:29+0000\n" | |
12 | 13 | "Last-Translator: Richard Hughes <richard@hughsie.com>\n" |
13 | 14 | "Language-Team: Occitan (post 1500) (http://www.transifex.com/hughsie/fwupd/language/oc/)\n" |
14 | 15 | "MIME-Version: 1.0\n" |
64 | 65 | |
65 | 66 | #. TRANSLATORS: error message |
66 | 67 | msgid "Command not found" |
67 | msgstr "" | |
68 | msgstr "Comanda pas trobada" | |
68 | 69 | |
69 | 70 | #. TRANSLATORS: when an action has completed |
70 | 71 | msgid "OK" |
95 | 96 | msgstr "Suprimit" |
96 | 97 | |
97 | 98 | #. TRANSLATORS: this is when a device is hotplugged |
99 | #. TRANSLATORS: this is when the daemon state changes | |
98 | 100 | msgid "Changed" |
99 | 101 | msgstr "Cambiat" |
100 | 102 | |
121 | 123 | #. TRANSLATORS: detected a DFU device |
122 | 124 | msgid "Found" |
123 | 125 | msgstr "Trobat" |
126 | ||
127 | #. TRANSLATORS: DFU protocol version, e.g. 1.1 | |
128 | msgid "Protocol" | |
129 | msgstr "" | |
124 | 130 | |
125 | 131 | #. TRANSLATORS: probably not run as root... |
126 | 132 | #. TRANSLATORS: device has failed to report status |
142 | 148 | #. TRANSLATORS: device quirks, i.e. things that |
143 | 149 | #. * it does that we have to work around |
144 | 150 | msgid "Quirks" |
145 | msgstr "" | |
151 | msgstr "Quirks" | |
146 | 152 | |
147 | 153 | #. TRANSLATORS: command description |
148 | 154 | msgid "Convert firmware to DFU format" |
297 | 303 | #. * e.g. "1.2.3" |
298 | 304 | #, c-format |
299 | 305 | msgid "Reinstalling %s with %s... " |
300 | msgstr "Reïnstallacion de %s en %s" | |
306 | msgstr "Reïnstallacion de %s en %s " | |
301 | 307 | |
302 | 308 | #. TRANSLATORS: the first replacement is a display name |
303 | 309 | #. * e.g. "ColorHugALS" and the second and third are |
304 | 310 | #. * version numbers e.g. "1.2.3" |
305 | 311 | #, c-format |
306 | 312 | msgid "Downgrading %s from %s to %s... " |
307 | msgstr "Retrogradacion de %s de %s en %s" | |
313 | msgstr "Retrogradacion de %s de %s en %s " | |
308 | 314 | |
309 | 315 | #. TRANSLATORS: the first replacement is a display name |
310 | 316 | #. * e.g. "ColorHugALS" and the second and third are |
311 | 317 | #. * version numbers e.g. "1.2.3" |
312 | 318 | #, c-format |
313 | 319 | msgid "Updating %s from %s to %s... " |
314 | msgstr "Mesa a jorn de %s de %s en %s" | |
320 | msgstr "Mesa a jorn de %s de %s en %s " | |
315 | 321 | |
316 | 322 | msgid "Done!" |
317 | 323 | msgstr "Acabat !" |
321 | 327 | msgid "%s has firmware updates:" |
322 | 328 | msgstr "" |
323 | 329 | |
324 | #. TRANSLATORS: a GUID for the hardware | |
325 | 330 | msgid "GUID" |
326 | 331 | msgstr "GUID" |
327 | 332 | |
328 | 333 | #. TRANSLATORS: section header for firmware version |
329 | msgid "Version" | |
330 | msgstr "Version" | |
334 | msgid "Update Version" | |
335 | msgstr "" | |
331 | 336 | |
332 | 337 | #. TRANSLATORS: section header for firmware checksum |
333 | msgid "Checksum" | |
334 | msgstr "Soma de contraròtle" | |
335 | ||
336 | msgid "Checksum Type" | |
338 | msgid "Update Checksum" | |
339 | msgstr "" | |
340 | ||
341 | msgid "Update Checksum Type" | |
337 | 342 | msgstr "" |
338 | 343 | |
339 | 344 | #. TRANSLATORS: section header for firmware remote http:// |
340 | msgid "Location" | |
341 | msgstr "Emplaçament" | |
345 | msgid "Update Location" | |
346 | msgstr "" | |
342 | 347 | |
343 | 348 | #. TRANSLATORS: section header for long firmware desc |
344 | msgid "Description" | |
345 | msgstr "Descripcion" | |
349 | msgid "Update Description" | |
350 | msgstr "" | |
351 | ||
352 | #. TRANSLATORS: this is when a device is hotplugged | |
353 | msgid "Device added:" | |
354 | msgstr "" | |
355 | ||
356 | #. TRANSLATORS: this is when a device is hotplugged | |
357 | msgid "Device removed:" | |
358 | msgstr "" | |
359 | ||
360 | #. TRANSLATORS: this is when a device has been updated | |
361 | msgid "Device changed:" | |
362 | msgstr "" | |
346 | 363 | |
347 | 364 | #. TRANSLATORS: command line option |
348 | 365 | msgid "Show extra debugging information" |
349 | msgstr "Mòstra d'informations de desbugatge complementàrias" | |
366 | msgstr "Mòstra d'informacions de desbugatge complementàrias" | |
350 | 367 | |
351 | 368 | #. TRANSLATORS: command line option |
352 | 369 | msgid "Perform the installation offline where possible" |
360 | 377 | msgid "Allow downgrading firmware versions" |
361 | 378 | msgstr "" |
362 | 379 | |
380 | #. TRANSLATORS: command line option | |
381 | msgid "Override provider warning" | |
382 | msgstr "" | |
383 | ||
363 | 384 | #. TRANSLATORS: command description |
364 | 385 | msgid "Get all devices that support firmware updates" |
365 | 386 | msgstr "Obténer la lista dels periferics que supòrtan las mesas a jorn de micrologicial" |
412 | 433 | msgid "Update the stored metadata with current ROM contents" |
413 | 434 | msgstr "" |
414 | 435 | |
436 | #. TRANSLATORS: command description | |
437 | msgid "Monitor the daemon for events" | |
438 | msgstr "" | |
439 | ||
415 | 440 | #. TRANSLATORS: program name |
416 | 441 | msgid "Firmware Utility" |
417 | 442 | msgstr "" |
7 | 7 | msgstr "" |
8 | 8 | "Project-Id-Version: fwupd\n" |
9 | 9 | "Report-Msgid-Bugs-To: \n" |
10 | "POT-Creation-Date: 2016-04-01 14:38+0100\n" | |
11 | "PO-Revision-Date: 2016-04-01 13:38+0000\n" | |
10 | "POT-Creation-Date: 2016-06-13 13:29+0100\n" | |
11 | "PO-Revision-Date: 2016-06-13 12:29+0000\n" | |
12 | 12 | "Last-Translator: Richard Hughes <richard@hughsie.com>\n" |
13 | 13 | "Language-Team: Polish (http://www.transifex.com/hughsie/fwupd/language/pl/)\n" |
14 | 14 | "MIME-Version: 1.0\n" |
95 | 95 | msgstr "Usunięto" |
96 | 96 | |
97 | 97 | #. TRANSLATORS: this is when a device is hotplugged |
98 | #. TRANSLATORS: this is when the daemon state changes | |
98 | 99 | msgid "Changed" |
99 | 100 | msgstr "Zmieniono" |
100 | 101 | |
121 | 122 | #. TRANSLATORS: detected a DFU device |
122 | 123 | msgid "Found" |
123 | 124 | msgstr "Odnaleziono" |
125 | ||
126 | #. TRANSLATORS: DFU protocol version, e.g. 1.1 | |
127 | msgid "Protocol" | |
128 | msgstr "" | |
124 | 129 | |
125 | 130 | #. TRANSLATORS: probably not run as root... |
126 | 131 | #. TRANSLATORS: device has failed to report status |
321 | 326 | msgid "%s has firmware updates:" |
322 | 327 | msgstr "Dostępne są aktualizacje oprogramowania sprzętowego dla urządzenia %s:" |
323 | 328 | |
324 | #. TRANSLATORS: a GUID for the hardware | |
325 | 329 | msgid "GUID" |
326 | 330 | msgstr "GUID" |
327 | 331 | |
328 | 332 | #. TRANSLATORS: section header for firmware version |
329 | msgid "Version" | |
330 | msgstr "Wersja" | |
333 | msgid "Update Version" | |
334 | msgstr "Wersja aktualizacji" | |
331 | 335 | |
332 | 336 | #. TRANSLATORS: section header for firmware checksum |
333 | msgid "Checksum" | |
334 | msgstr "Suma kontrolna" | |
335 | ||
336 | msgid "Checksum Type" | |
337 | msgstr "" | |
337 | msgid "Update Checksum" | |
338 | msgstr "Suma kontrolna aktualizacji" | |
339 | ||
340 | msgid "Update Checksum Type" | |
341 | msgstr "Typ sumy kontrolnej aktualizacji" | |
338 | 342 | |
339 | 343 | #. TRANSLATORS: section header for firmware remote http:// |
340 | msgid "Location" | |
341 | msgstr "Położenie" | |
344 | msgid "Update Location" | |
345 | msgstr "Położenie aktualizacji" | |
342 | 346 | |
343 | 347 | #. TRANSLATORS: section header for long firmware desc |
344 | msgid "Description" | |
345 | msgstr "Opis" | |
348 | msgid "Update Description" | |
349 | msgstr "Opis aktualizacji" | |
350 | ||
351 | #. TRANSLATORS: this is when a device is hotplugged | |
352 | msgid "Device added:" | |
353 | msgstr "Dodano urządzenie:" | |
354 | ||
355 | #. TRANSLATORS: this is when a device is hotplugged | |
356 | msgid "Device removed:" | |
357 | msgstr "Usunięto urządzenie:" | |
358 | ||
359 | #. TRANSLATORS: this is when a device has been updated | |
360 | msgid "Device changed:" | |
361 | msgstr "Zmieniono urządzenie:" | |
346 | 362 | |
347 | 363 | #. TRANSLATORS: command line option |
348 | 364 | msgid "Show extra debugging information" |
360 | 376 | msgid "Allow downgrading firmware versions" |
361 | 377 | msgstr "Umożliwia instalowanie poprzednich wersji oprogramowania sprzętowego" |
362 | 378 | |
379 | #. TRANSLATORS: command line option | |
380 | msgid "Override provider warning" | |
381 | msgstr "Ignoruje ostrzeżenie dostawcy" | |
382 | ||
363 | 383 | #. TRANSLATORS: command description |
364 | 384 | msgid "Get all devices that support firmware updates" |
365 | 385 | msgstr "Uzyskuje wszystkie urządzenia obsługujące aktualizacje oprogramowania sprzętowego" |
411 | 431 | #. TRANSLATORS: command description |
412 | 432 | msgid "Update the stored metadata with current ROM contents" |
413 | 433 | msgstr "Aktualizuje przechowywane metadane bieżącą zawartością pamięci ROM" |
434 | ||
435 | #. TRANSLATORS: command description | |
436 | msgid "Monitor the daemon for events" | |
437 | msgstr "Monitoruje zdarzenia usługi" | |
414 | 438 | |
415 | 439 | #. TRANSLATORS: program name |
416 | 440 | msgid "Firmware Utility" |
8 | 8 | msgstr "" |
9 | 9 | "Project-Id-Version: fwupd\n" |
10 | 10 | "Report-Msgid-Bugs-To: \n" |
11 | "POT-Creation-Date: 2016-04-01 14:38+0100\n" | |
12 | "PO-Revision-Date: 2016-04-01 13:38+0000\n" | |
11 | "POT-Creation-Date: 2016-06-13 13:29+0100\n" | |
12 | "PO-Revision-Date: 2016-06-13 12:29+0000\n" | |
13 | 13 | "Last-Translator: Richard Hughes <richard@hughsie.com>\n" |
14 | 14 | "Language-Team: Portuguese (Brazil) (http://www.transifex.com/hughsie/fwupd/language/pt_BR/)\n" |
15 | 15 | "MIME-Version: 1.0\n" |
96 | 96 | msgstr "Removido" |
97 | 97 | |
98 | 98 | #. TRANSLATORS: this is when a device is hotplugged |
99 | #. TRANSLATORS: this is when the daemon state changes | |
99 | 100 | msgid "Changed" |
100 | 101 | msgstr "Alterado" |
101 | 102 | |
122 | 123 | #. TRANSLATORS: detected a DFU device |
123 | 124 | msgid "Found" |
124 | 125 | msgstr "Encontrado" |
126 | ||
127 | #. TRANSLATORS: DFU protocol version, e.g. 1.1 | |
128 | msgid "Protocol" | |
129 | msgstr "" | |
125 | 130 | |
126 | 131 | #. TRANSLATORS: probably not run as root... |
127 | 132 | #. TRANSLATORS: device has failed to report status |
322 | 327 | msgid "%s has firmware updates:" |
323 | 328 | msgstr "%s tem atualizações:" |
324 | 329 | |
325 | #. TRANSLATORS: a GUID for the hardware | |
326 | 330 | msgid "GUID" |
327 | 331 | msgstr "GUID" |
328 | 332 | |
329 | 333 | #. TRANSLATORS: section header for firmware version |
330 | msgid "Version" | |
331 | msgstr "Versão" | |
334 | msgid "Update Version" | |
335 | msgstr "" | |
332 | 336 | |
333 | 337 | #. TRANSLATORS: section header for firmware checksum |
334 | msgid "Checksum" | |
335 | msgstr "Soma de verificação" | |
336 | ||
337 | msgid "Checksum Type" | |
338 | msgid "Update Checksum" | |
339 | msgstr "" | |
340 | ||
341 | msgid "Update Checksum Type" | |
338 | 342 | msgstr "" |
339 | 343 | |
340 | 344 | #. TRANSLATORS: section header for firmware remote http:// |
341 | msgid "Location" | |
342 | msgstr "Local" | |
345 | msgid "Update Location" | |
346 | msgstr "" | |
343 | 347 | |
344 | 348 | #. TRANSLATORS: section header for long firmware desc |
345 | msgid "Description" | |
346 | msgstr "Descrição" | |
349 | msgid "Update Description" | |
350 | msgstr "" | |
351 | ||
352 | #. TRANSLATORS: this is when a device is hotplugged | |
353 | msgid "Device added:" | |
354 | msgstr "" | |
355 | ||
356 | #. TRANSLATORS: this is when a device is hotplugged | |
357 | msgid "Device removed:" | |
358 | msgstr "" | |
359 | ||
360 | #. TRANSLATORS: this is when a device has been updated | |
361 | msgid "Device changed:" | |
362 | msgstr "" | |
347 | 363 | |
348 | 364 | #. TRANSLATORS: command line option |
349 | 365 | msgid "Show extra debugging information" |
361 | 377 | msgid "Allow downgrading firmware versions" |
362 | 378 | msgstr "Permitir reverter versões de firmware" |
363 | 379 | |
380 | #. TRANSLATORS: command line option | |
381 | msgid "Override provider warning" | |
382 | msgstr "" | |
383 | ||
364 | 384 | #. TRANSLATORS: command description |
365 | 385 | msgid "Get all devices that support firmware updates" |
366 | 386 | msgstr "Obter todos os dispositivos que suportam atualizações de firmware" |
412 | 432 | #. TRANSLATORS: command description |
413 | 433 | msgid "Update the stored metadata with current ROM contents" |
414 | 434 | msgstr "Atualiza os metadados armazenados com o conteúdo da ROM atual" |
435 | ||
436 | #. TRANSLATORS: command description | |
437 | msgid "Monitor the daemon for events" | |
438 | msgstr "" | |
415 | 439 | |
416 | 440 | #. TRANSLATORS: program name |
417 | 441 | msgid "Firmware Utility" |
7 | 7 | msgstr "" |
8 | 8 | "Project-Id-Version: fwupd\n" |
9 | 9 | "Report-Msgid-Bugs-To: \n" |
10 | "POT-Creation-Date: 2016-04-01 14:38+0100\n" | |
11 | "PO-Revision-Date: 2016-04-01 13:38+0000\n" | |
10 | "POT-Creation-Date: 2016-06-13 13:29+0100\n" | |
11 | "PO-Revision-Date: 2016-06-13 12:29+0000\n" | |
12 | 12 | "Last-Translator: Richard Hughes <richard@hughsie.com>\n" |
13 | 13 | "Language-Team: Russian (http://www.transifex.com/hughsie/fwupd/language/ru/)\n" |
14 | 14 | "MIME-Version: 1.0\n" |
95 | 95 | msgstr "Удалено" |
96 | 96 | |
97 | 97 | #. TRANSLATORS: this is when a device is hotplugged |
98 | #. TRANSLATORS: this is when the daemon state changes | |
98 | 99 | msgid "Changed" |
99 | 100 | msgstr "Изменено" |
100 | 101 | |
121 | 122 | #. TRANSLATORS: detected a DFU device |
122 | 123 | msgid "Found" |
123 | 124 | msgstr "Найдено" |
125 | ||
126 | #. TRANSLATORS: DFU protocol version, e.g. 1.1 | |
127 | msgid "Protocol" | |
128 | msgstr "" | |
124 | 129 | |
125 | 130 | #. TRANSLATORS: probably not run as root... |
126 | 131 | #. TRANSLATORS: device has failed to report status |
321 | 326 | msgid "%s has firmware updates:" |
322 | 327 | msgstr "У %s есть обновления микропрограммы:" |
323 | 328 | |
324 | #. TRANSLATORS: a GUID for the hardware | |
325 | 329 | msgid "GUID" |
326 | 330 | msgstr "GUID" |
327 | 331 | |
328 | 332 | #. TRANSLATORS: section header for firmware version |
329 | msgid "Version" | |
330 | msgstr "Версия" | |
333 | msgid "Update Version" | |
334 | msgstr "Версия обновления" | |
331 | 335 | |
332 | 336 | #. TRANSLATORS: section header for firmware checksum |
333 | msgid "Checksum" | |
334 | msgstr "Контрольная сумма" | |
335 | ||
336 | msgid "Checksum Type" | |
337 | msgstr "" | |
337 | msgid "Update Checksum" | |
338 | msgstr "Контрольная сумма обновления" | |
339 | ||
340 | msgid "Update Checksum Type" | |
341 | msgstr "Тип контрольной суммы обновления" | |
338 | 342 | |
339 | 343 | #. TRANSLATORS: section header for firmware remote http:// |
340 | msgid "Location" | |
341 | msgstr "Расположение" | |
344 | msgid "Update Location" | |
345 | msgstr "Расположение обновления" | |
342 | 346 | |
343 | 347 | #. TRANSLATORS: section header for long firmware desc |
344 | msgid "Description" | |
345 | msgstr "Описание" | |
348 | msgid "Update Description" | |
349 | msgstr "Описание обновления" | |
350 | ||
351 | #. TRANSLATORS: this is when a device is hotplugged | |
352 | msgid "Device added:" | |
353 | msgstr "Добавлено устройство:" | |
354 | ||
355 | #. TRANSLATORS: this is when a device is hotplugged | |
356 | msgid "Device removed:" | |
357 | msgstr "Изъято устройство:" | |
358 | ||
359 | #. TRANSLATORS: this is when a device has been updated | |
360 | msgid "Device changed:" | |
361 | msgstr "Заменено устройство:" | |
346 | 362 | |
347 | 363 | #. TRANSLATORS: command line option |
348 | 364 | msgid "Show extra debugging information" |
360 | 376 | msgid "Allow downgrading firmware versions" |
361 | 377 | msgstr "Разрешить понижение версий микропрограмм" |
362 | 378 | |
379 | #. TRANSLATORS: command line option | |
380 | msgid "Override provider warning" | |
381 | msgstr "Игнорировать предупреждения поставщика" | |
382 | ||
363 | 383 | #. TRANSLATORS: command description |
364 | 384 | msgid "Get all devices that support firmware updates" |
365 | 385 | msgstr "Получить все устройства, которые поддерживают обновления микропрограммы" |
411 | 431 | #. TRANSLATORS: command description |
412 | 432 | msgid "Update the stored metadata with current ROM contents" |
413 | 433 | msgstr "Обновить сохранённые метаданные с текущим содержимым ПЗУ" |
434 | ||
435 | #. TRANSLATORS: command description | |
436 | msgid "Monitor the daemon for events" | |
437 | msgstr "Следить за событиями в фоновой службе" | |
414 | 438 | |
415 | 439 | #. TRANSLATORS: program name |
416 | 440 | msgid "Firmware Utility" |
7 | 7 | msgstr "" |
8 | 8 | "Project-Id-Version: fwupd\n" |
9 | 9 | "Report-Msgid-Bugs-To: \n" |
10 | "POT-Creation-Date: 2016-04-01 14:38+0100\n" | |
11 | "PO-Revision-Date: 2016-04-01 13:38+0000\n" | |
10 | "POT-Creation-Date: 2016-06-13 13:29+0100\n" | |
11 | "PO-Revision-Date: 2016-06-13 12:29+0000\n" | |
12 | 12 | "Last-Translator: Richard Hughes <richard@hughsie.com>\n" |
13 | 13 | "Language-Team: Slovak (http://www.transifex.com/hughsie/fwupd/language/sk/)\n" |
14 | 14 | "MIME-Version: 1.0\n" |
95 | 95 | msgstr "Odstránené" |
96 | 96 | |
97 | 97 | #. TRANSLATORS: this is when a device is hotplugged |
98 | #. TRANSLATORS: this is when the daemon state changes | |
98 | 99 | msgid "Changed" |
99 | 100 | msgstr "Zmenené" |
100 | 101 | |
121 | 122 | #. TRANSLATORS: detected a DFU device |
122 | 123 | msgid "Found" |
123 | 124 | msgstr "Nájdené" |
125 | ||
126 | #. TRANSLATORS: DFU protocol version, e.g. 1.1 | |
127 | msgid "Protocol" | |
128 | msgstr "" | |
124 | 129 | |
125 | 130 | #. TRANSLATORS: probably not run as root... |
126 | 131 | #. TRANSLATORS: device has failed to report status |
321 | 326 | msgid "%s has firmware updates:" |
322 | 327 | msgstr "Pre zariadenie %s sú dostupné aktualizácie firmvéru:" |
323 | 328 | |
324 | #. TRANSLATORS: a GUID for the hardware | |
325 | 329 | msgid "GUID" |
326 | 330 | msgstr "GUID" |
327 | 331 | |
328 | 332 | #. TRANSLATORS: section header for firmware version |
329 | msgid "Version" | |
330 | msgstr "Verzia" | |
333 | msgid "Update Version" | |
334 | msgstr "Verzia aktualizácie" | |
331 | 335 | |
332 | 336 | #. TRANSLATORS: section header for firmware checksum |
333 | msgid "Checksum" | |
334 | msgstr "Kontrolný medzisúčet" | |
335 | ||
336 | msgid "Checksum Type" | |
337 | msgstr "" | |
337 | msgid "Update Checksum" | |
338 | msgstr "Kontrolný medzisúčet aktualizácie" | |
339 | ||
340 | msgid "Update Checksum Type" | |
341 | msgstr "Typ kontrolného medzisúčtu aktualizácie" | |
338 | 342 | |
339 | 343 | #. TRANSLATORS: section header for firmware remote http:// |
340 | msgid "Location" | |
341 | msgstr "Umiestnenie" | |
344 | msgid "Update Location" | |
345 | msgstr "Umiestnenie aktualizácie" | |
342 | 346 | |
343 | 347 | #. TRANSLATORS: section header for long firmware desc |
344 | msgid "Description" | |
345 | msgstr "Popis" | |
348 | msgid "Update Description" | |
349 | msgstr "Popis aktualizácie" | |
350 | ||
351 | #. TRANSLATORS: this is when a device is hotplugged | |
352 | msgid "Device added:" | |
353 | msgstr "Pridané zariadenie:" | |
354 | ||
355 | #. TRANSLATORS: this is when a device is hotplugged | |
356 | msgid "Device removed:" | |
357 | msgstr "Odstránené zariadenie:" | |
358 | ||
359 | #. TRANSLATORS: this is when a device has been updated | |
360 | msgid "Device changed:" | |
361 | msgstr "Zmenené zariadenie:" | |
346 | 362 | |
347 | 363 | #. TRANSLATORS: command line option |
348 | 364 | msgid "Show extra debugging information" |
360 | 376 | msgid "Allow downgrading firmware versions" |
361 | 377 | msgstr "Umožní zníženie verzií firmvéru" |
362 | 378 | |
379 | #. TRANSLATORS: command line option | |
380 | msgid "Override provider warning" | |
381 | msgstr "Nahradí upozornenie poskytovateľa" | |
382 | ||
363 | 383 | #. TRANSLATORS: command description |
364 | 384 | msgid "Get all devices that support firmware updates" |
365 | 385 | msgstr "Získa všetky zariadenia, ktoré podporujú aktualizovanie firmvéru" |
411 | 431 | #. TRANSLATORS: command description |
412 | 432 | msgid "Update the stored metadata with current ROM contents" |
413 | 433 | msgstr "Aktualizuje uložené metaúdaje s aktuálnym obsahom pamäte ROM" |
434 | ||
435 | #. TRANSLATORS: command description | |
436 | msgid "Monitor the daemon for events" | |
437 | msgstr "Sleduje démona kvôli udalostiam" | |
414 | 438 | |
415 | 439 | #. TRANSLATORS: program name |
416 | 440 | msgid "Firmware Utility" |
2 | 2 | # This file is distributed under the same license as the PACKAGE package. |
3 | 3 | # |
4 | 4 | # Translators: |
5 | # Miloš Popović <gpopac@gmail.com>, 2016 | |
5 | 6 | # Марко М. Костић (Marko M. Kostić) <marko.m.kostic@gmail.com>, 2015-2016 |
6 | 7 | msgid "" |
7 | 8 | msgstr "" |
8 | 9 | "Project-Id-Version: fwupd\n" |
9 | 10 | "Report-Msgid-Bugs-To: \n" |
10 | "POT-Creation-Date: 2016-04-01 14:38+0100\n" | |
11 | "PO-Revision-Date: 2016-04-01 13:38+0000\n" | |
11 | "POT-Creation-Date: 2016-06-13 13:29+0100\n" | |
12 | "PO-Revision-Date: 2016-06-13 12:29+0000\n" | |
12 | 13 | "Last-Translator: Richard Hughes <richard@hughsie.com>\n" |
13 | 14 | "Language-Team: Serbian (http://www.transifex.com/hughsie/fwupd/language/sr/)\n" |
14 | 15 | "MIME-Version: 1.0\n" |
95 | 96 | msgstr "Уклонио" |
96 | 97 | |
97 | 98 | #. TRANSLATORS: this is when a device is hotplugged |
99 | #. TRANSLATORS: this is when the daemon state changes | |
98 | 100 | msgid "Changed" |
99 | 101 | msgstr "Променио" |
100 | 102 | |
121 | 123 | #. TRANSLATORS: detected a DFU device |
122 | 124 | msgid "Found" |
123 | 125 | msgstr "Нашао" |
126 | ||
127 | #. TRANSLATORS: DFU protocol version, e.g. 1.1 | |
128 | msgid "Protocol" | |
129 | msgstr "" | |
124 | 130 | |
125 | 131 | #. TRANSLATORS: probably not run as root... |
126 | 132 | #. TRANSLATORS: device has failed to report status |
321 | 327 | msgid "%s has firmware updates:" |
322 | 328 | msgstr "%s има ажурирања за фирмвер:" |
323 | 329 | |
324 | #. TRANSLATORS: a GUID for the hardware | |
325 | 330 | msgid "GUID" |
326 | 331 | msgstr "ГУИД" |
327 | 332 | |
328 | 333 | #. TRANSLATORS: section header for firmware version |
329 | msgid "Version" | |
330 | msgstr "Издање" | |
334 | msgid "Update Version" | |
335 | msgstr "" | |
331 | 336 | |
332 | 337 | #. TRANSLATORS: section header for firmware checksum |
333 | msgid "Checksum" | |
334 | msgstr "Чек-сума" | |
335 | ||
336 | msgid "Checksum Type" | |
338 | msgid "Update Checksum" | |
339 | msgstr "" | |
340 | ||
341 | msgid "Update Checksum Type" | |
337 | 342 | msgstr "" |
338 | 343 | |
339 | 344 | #. TRANSLATORS: section header for firmware remote http:// |
340 | msgid "Location" | |
341 | msgstr "Место" | |
345 | msgid "Update Location" | |
346 | msgstr "" | |
342 | 347 | |
343 | 348 | #. TRANSLATORS: section header for long firmware desc |
344 | msgid "Description" | |
345 | msgstr "Опис" | |
349 | msgid "Update Description" | |
350 | msgstr "" | |
351 | ||
352 | #. TRANSLATORS: this is when a device is hotplugged | |
353 | msgid "Device added:" | |
354 | msgstr "" | |
355 | ||
356 | #. TRANSLATORS: this is when a device is hotplugged | |
357 | msgid "Device removed:" | |
358 | msgstr "" | |
359 | ||
360 | #. TRANSLATORS: this is when a device has been updated | |
361 | msgid "Device changed:" | |
362 | msgstr "" | |
346 | 363 | |
347 | 364 | #. TRANSLATORS: command line option |
348 | 365 | msgid "Show extra debugging information" |
360 | 377 | msgid "Allow downgrading firmware versions" |
361 | 378 | msgstr "Дозволи уназађивање издања фирмвера" |
362 | 379 | |
380 | #. TRANSLATORS: command line option | |
381 | msgid "Override provider warning" | |
382 | msgstr "" | |
383 | ||
363 | 384 | #. TRANSLATORS: command description |
364 | 385 | msgid "Get all devices that support firmware updates" |
365 | 386 | msgstr "Добави све уређаје који подржавају ажурирање фирмвера" |
411 | 432 | #. TRANSLATORS: command description |
412 | 433 | msgid "Update the stored metadata with current ROM contents" |
413 | 434 | msgstr "Ажурирај ускладиштене метаподатке са тренутним садржајима РОМ-а" |
435 | ||
436 | #. TRANSLATORS: command description | |
437 | msgid "Monitor the daemon for events" | |
438 | msgstr "" | |
414 | 439 | |
415 | 440 | #. TRANSLATORS: program name |
416 | 441 | msgid "Firmware Utility" |
7 | 7 | msgstr "" |
8 | 8 | "Project-Id-Version: fwupd\n" |
9 | 9 | "Report-Msgid-Bugs-To: \n" |
10 | "POT-Creation-Date: 2016-04-01 14:38+0100\n" | |
11 | "PO-Revision-Date: 2016-04-01 13:38+0000\n" | |
10 | "POT-Creation-Date: 2016-06-13 13:29+0100\n" | |
11 | "PO-Revision-Date: 2016-06-13 12:29+0000\n" | |
12 | 12 | "Last-Translator: Richard Hughes <richard@hughsie.com>\n" |
13 | 13 | "Language-Team: Swedish (http://www.transifex.com/hughsie/fwupd/language/sv/)\n" |
14 | 14 | "MIME-Version: 1.0\n" |
95 | 95 | msgstr "" |
96 | 96 | |
97 | 97 | #. TRANSLATORS: this is when a device is hotplugged |
98 | #. TRANSLATORS: this is when the daemon state changes | |
98 | 99 | msgid "Changed" |
99 | 100 | msgstr "" |
100 | 101 | |
120 | 121 | |
121 | 122 | #. TRANSLATORS: detected a DFU device |
122 | 123 | msgid "Found" |
124 | msgstr "" | |
125 | ||
126 | #. TRANSLATORS: DFU protocol version, e.g. 1.1 | |
127 | msgid "Protocol" | |
123 | 128 | msgstr "" |
124 | 129 | |
125 | 130 | #. TRANSLATORS: probably not run as root... |
321 | 326 | msgid "%s has firmware updates:" |
322 | 327 | msgstr "%s har uppdateringar för fast programvara:" |
323 | 328 | |
324 | #. TRANSLATORS: a GUID for the hardware | |
325 | 329 | msgid "GUID" |
326 | 330 | msgstr "" |
327 | 331 | |
328 | 332 | #. TRANSLATORS: section header for firmware version |
329 | msgid "Version" | |
330 | msgstr "Version" | |
333 | msgid "Update Version" | |
334 | msgstr "" | |
331 | 335 | |
332 | 336 | #. TRANSLATORS: section header for firmware checksum |
333 | msgid "Checksum" | |
334 | msgstr "Kontrollsumma" | |
335 | ||
336 | msgid "Checksum Type" | |
337 | msgid "Update Checksum" | |
338 | msgstr "" | |
339 | ||
340 | msgid "Update Checksum Type" | |
337 | 341 | msgstr "" |
338 | 342 | |
339 | 343 | #. TRANSLATORS: section header for firmware remote http:// |
340 | msgid "Location" | |
341 | msgstr "Plats" | |
344 | msgid "Update Location" | |
345 | msgstr "" | |
342 | 346 | |
343 | 347 | #. TRANSLATORS: section header for long firmware desc |
344 | msgid "Description" | |
345 | msgstr "Beskrivning" | |
348 | msgid "Update Description" | |
349 | msgstr "" | |
350 | ||
351 | #. TRANSLATORS: this is when a device is hotplugged | |
352 | msgid "Device added:" | |
353 | msgstr "" | |
354 | ||
355 | #. TRANSLATORS: this is when a device is hotplugged | |
356 | msgid "Device removed:" | |
357 | msgstr "" | |
358 | ||
359 | #. TRANSLATORS: this is when a device has been updated | |
360 | msgid "Device changed:" | |
361 | msgstr "" | |
346 | 362 | |
347 | 363 | #. TRANSLATORS: command line option |
348 | 364 | msgid "Show extra debugging information" |
360 | 376 | msgid "Allow downgrading firmware versions" |
361 | 377 | msgstr "" |
362 | 378 | |
379 | #. TRANSLATORS: command line option | |
380 | msgid "Override provider warning" | |
381 | msgstr "" | |
382 | ||
363 | 383 | #. TRANSLATORS: command description |
364 | 384 | msgid "Get all devices that support firmware updates" |
365 | 385 | msgstr "Hämta alla enheter som stödjer uppdateringar av fast programvara" |
412 | 432 | msgid "Update the stored metadata with current ROM contents" |
413 | 433 | msgstr "" |
414 | 434 | |
435 | #. TRANSLATORS: command description | |
436 | msgid "Monitor the daemon for events" | |
437 | msgstr "" | |
438 | ||
415 | 439 | #. TRANSLATORS: program name |
416 | 440 | msgid "Firmware Utility" |
417 | 441 | msgstr "" |
0 | # SOME DESCRIPTIVE TITLE. | |
1 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER | |
2 | # This file is distributed under the same license as the PACKAGE package. | |
3 | # | |
4 | # Translators: | |
5 | # Muhammet Kara <muhammetk@gmail.com>, 2016 | |
6 | msgid "" | |
7 | msgstr "" | |
8 | "Project-Id-Version: fwupd\n" | |
9 | "Report-Msgid-Bugs-To: \n" | |
10 | "POT-Creation-Date: 2016-06-13 13:29+0100\n" | |
11 | "PO-Revision-Date: 2016-06-13 12:29+0000\n" | |
12 | "Last-Translator: Richard Hughes <richard@hughsie.com>\n" | |
13 | "Language-Team: Turkish (Turkey) (http://www.transifex.com/hughsie/fwupd/language/tr_TR/)\n" | |
14 | "MIME-Version: 1.0\n" | |
15 | "Content-Type: text/plain; charset=UTF-8\n" | |
16 | "Content-Transfer-Encoding: 8bit\n" | |
17 | "Language: tr_TR\n" | |
18 | "Plural-Forms: nplurals=1; plural=0;\n" | |
19 | ||
20 | msgid "Install signed system firmware" | |
21 | msgstr "İmzalı sistem ürün yazılımını yükle" | |
22 | ||
23 | #. TRANSLATORS: this is the PolicyKit modal dialog | |
24 | msgid "Authentication is required to update the firmware on this machine" | |
25 | msgstr "Bu makine üzerindeki ürün yazılımını güncellemek için kimlik doğrulama gerekir" | |
26 | ||
27 | msgid "Install unsigned system firmware" | |
28 | msgstr "İmzasız sistem ürün yazılımını yükle" | |
29 | ||
30 | msgid "Install old version of system firmware" | |
31 | msgstr "Eski sürüm sistem ürün yazılımını yükle" | |
32 | ||
33 | #. TRANSLATORS: this is the PolicyKit modal dialog | |
34 | msgid "Authentication is required to downgrade the firmware on this machine" | |
35 | msgstr "Bu makine üzerindeki ürün yazılımının sürümünü indirmek için kimlik doğrulama gerekir" | |
36 | ||
37 | msgid "Install signed device firmware" | |
38 | msgstr "İmzalı aygıt ürün yazılımını yükle" | |
39 | ||
40 | #. TRANSLATORS: this is the PolicyKit modal dialog | |
41 | msgid "" | |
42 | "Authentication is required to update the firmware on a removable device" | |
43 | msgstr "Çıkarılabilir aygıt üzerindeki ürün yazılımını güncellemek için kimlik doğrulama gerekir" | |
44 | ||
45 | msgid "Install unsigned device firmware" | |
46 | msgstr "İmzasız aygıt ürün yazılımını yükle" | |
47 | ||
48 | #. TRANSLATORS: this is the PolicyKit modal dialog | |
49 | msgid "" | |
50 | "Authentication is required to downgrade the firmware on a removable device" | |
51 | msgstr "" | |
52 | ||
53 | msgid "Unlock the device to allow access" | |
54 | msgstr "" | |
55 | ||
56 | #. TRANSLATORS: this is the PolicyKit modal dialog | |
57 | msgid "Authentication is required to unlock a device" | |
58 | msgstr "" | |
59 | ||
60 | #. TRANSLATORS: this is a command alias, e.g. 'get-devices' | |
61 | #, c-format | |
62 | msgid "Alias to %s" | |
63 | msgstr "" | |
64 | ||
65 | #. TRANSLATORS: error message | |
66 | msgid "Command not found" | |
67 | msgstr "" | |
68 | ||
69 | #. TRANSLATORS: when an action has completed | |
70 | msgid "OK" | |
71 | msgstr "Tamam" | |
72 | ||
73 | #. TRANSLATORS: when moving from runtime to DFU mode | |
74 | msgid "Detaching" | |
75 | msgstr "Ayrılıyor" | |
76 | ||
77 | #. TRANSLATORS: when moving from DFU to runtime mode | |
78 | msgid "Attaching" | |
79 | msgstr "Bağlanıyor" | |
80 | ||
81 | #. TRANSLATORS: when copying from host to device | |
82 | msgid "Downloading" | |
83 | msgstr "İndiriliyor" | |
84 | ||
85 | #. TRANSLATORS: when copying from device to host | |
86 | msgid "Uploading" | |
87 | msgstr "Karşıya Yükleniyor" | |
88 | ||
89 | #. TRANSLATORS: this is when a device is hotplugged | |
90 | msgid "Added" | |
91 | msgstr "Eklendi" | |
92 | ||
93 | #. TRANSLATORS: this is when a device is hotplugged | |
94 | msgid "Removed" | |
95 | msgstr "Kaldırıldı" | |
96 | ||
97 | #. TRANSLATORS: this is when a device is hotplugged | |
98 | #. TRANSLATORS: this is when the daemon state changes | |
99 | msgid "Changed" | |
100 | msgstr "Değişti" | |
101 | ||
102 | #. TRANSLATORS: this is when a device ctrl+c's a watch | |
103 | msgid "Cancelled" | |
104 | msgstr "İptal Edildi" | |
105 | ||
106 | #. TRANSLATORS: Appstream ID for the hardware type | |
107 | msgid "ID" | |
108 | msgstr "Kimlik (ID)" | |
109 | ||
110 | #. TRANSLATORS: interface name, e.g. "Flash" | |
111 | msgid "Name" | |
112 | msgstr "İsim" | |
113 | ||
114 | #. TRANSLATORS: this is the encryption method used when writing | |
115 | msgid "Cipher" | |
116 | msgstr "Şifreleme" | |
117 | ||
118 | #. TRANSLATORS: these are areas of memory on the chip | |
119 | msgid "Region" | |
120 | msgstr "Bölge" | |
121 | ||
122 | #. TRANSLATORS: detected a DFU device | |
123 | msgid "Found" | |
124 | msgstr "Bulundu" | |
125 | ||
126 | #. TRANSLATORS: DFU protocol version, e.g. 1.1 | |
127 | msgid "Protocol" | |
128 | msgstr "" | |
129 | ||
130 | #. TRANSLATORS: probably not run as root... | |
131 | #. TRANSLATORS: device has failed to report status | |
132 | #. TRANSLATORS: device status, e.g. "OK" | |
133 | msgid "Status" | |
134 | msgstr "Durum" | |
135 | ||
136 | msgid "Unknown: permission denied" | |
137 | msgstr "Bilinmiyor: izin verilmedi" | |
138 | ||
139 | #. TRANSLATORS: device mode, e.g. runtime or DFU | |
140 | msgid "Mode" | |
141 | msgstr "Kip" | |
142 | ||
143 | #. TRANSLATORS: device state, i.e. appIDLE | |
144 | msgid "State" | |
145 | msgstr "Evre" | |
146 | ||
147 | #. TRANSLATORS: device quirks, i.e. things that | |
148 | #. * it does that we have to work around | |
149 | msgid "Quirks" | |
150 | msgstr "" | |
151 | ||
152 | #. TRANSLATORS: command description | |
153 | msgid "Convert firmware to DFU format" | |
154 | msgstr "Ürün yazılımını DFU biçimine dönüştür" | |
155 | ||
156 | #. TRANSLATORS: command description | |
157 | msgid "Merge multiple firmware files into one" | |
158 | msgstr "Birden çok ürün yazılımı dosyasını tek dosyada birleştir" | |
159 | ||
160 | #. TRANSLATORS: command description | |
161 | msgid "Set vendor ID on firmware file" | |
162 | msgstr "" | |
163 | ||
164 | #. TRANSLATORS: command description | |
165 | msgid "Set product ID on firmware file" | |
166 | msgstr "" | |
167 | ||
168 | #. TRANSLATORS: command description | |
169 | msgid "Set release version on firmware file" | |
170 | msgstr "" | |
171 | ||
172 | #. TRANSLATORS: command description | |
173 | msgid "Set alternative number on firmware file" | |
174 | msgstr "" | |
175 | ||
176 | #. TRANSLATORS: command description | |
177 | msgid "Set alternative name on firmware file" | |
178 | msgstr "" | |
179 | ||
180 | #. TRANSLATORS: command description | |
181 | msgid "Attach DFU capable device back to runtime" | |
182 | msgstr "" | |
183 | ||
184 | #. TRANSLATORS: command description | |
185 | msgid "Read firmware from device into a file" | |
186 | msgstr "" | |
187 | ||
188 | #. TRANSLATORS: command description | |
189 | msgid "Read firmware from one partition into a file" | |
190 | msgstr "" | |
191 | ||
192 | #. TRANSLATORS: command description | |
193 | msgid "Write firmware from file into device" | |
194 | msgstr "" | |
195 | ||
196 | #. TRANSLATORS: command description | |
197 | msgid "Write firmware from file into one partition" | |
198 | msgstr "" | |
199 | ||
200 | #. TRANSLATORS: command description | |
201 | msgid "List currently attached DFU capable devices" | |
202 | msgstr "" | |
203 | ||
204 | #. TRANSLATORS: command description | |
205 | msgid "Detach currently attached DFU capable device" | |
206 | msgstr "" | |
207 | ||
208 | #. TRANSLATORS: command description | |
209 | msgid "Dump details about a firmware file" | |
210 | msgstr "" | |
211 | ||
212 | #. TRANSLATORS: command description | |
213 | msgid "Watch DFU devices being hotplugged" | |
214 | msgstr "" | |
215 | ||
216 | #. TRANSLATORS: command description | |
217 | msgid "Encrypt firmware data" | |
218 | msgstr "" | |
219 | ||
220 | #. TRANSLATORS: command description | |
221 | msgid "Decrypt firmware data" | |
222 | msgstr "" | |
223 | ||
224 | #. TRANSLATORS: command description | |
225 | msgid "Sets metadata on a firmware file" | |
226 | msgstr "" | |
227 | ||
228 | #. TRANSLATORS: DFU stands for device firmware update | |
229 | msgid "DFU Utility" | |
230 | msgstr "" | |
231 | ||
232 | #. TRANSLATORS: the user didn't read the man page | |
233 | msgid "Failed to parse arguments" | |
234 | msgstr "" | |
235 | ||
236 | #. TRANSLATORS: turn on all debugging | |
237 | msgid "Show debugging information for all files" | |
238 | msgstr "" | |
239 | ||
240 | #. TRANSLATORS: for the --verbose arg | |
241 | msgid "Debugging Options" | |
242 | msgstr "" | |
243 | ||
244 | #. TRANSLATORS: for the --verbose arg | |
245 | msgid "Show debugging options" | |
246 | msgstr "" | |
247 | ||
248 | #. TRANSLATORS: exit after we've started up, used for user profiling | |
249 | msgid "Exit after a small delay" | |
250 | msgstr "" | |
251 | ||
252 | #. TRANSLATORS: exit straight away, used for automatic profiling | |
253 | msgid "Exit after the engine has loaded" | |
254 | msgstr "" | |
255 | ||
256 | #. TRANSLATORS: program name | |
257 | msgid "Firmware Update Daemon" | |
258 | msgstr "" | |
259 | ||
260 | #. TRANSLATORS: program summary | |
261 | msgid "Firmware Update D-Bus Service" | |
262 | msgstr "" | |
263 | ||
264 | #. TRANSLATORS: daemon is inactive | |
265 | msgid "Idle" | |
266 | msgstr "" | |
267 | ||
268 | #. TRANSLATORS: decompressing the firmware file | |
269 | msgid "Decompressing firmware" | |
270 | msgstr "" | |
271 | ||
272 | #. TRANSLATORS: parsing the firmware information | |
273 | msgid "Loading firmware" | |
274 | msgstr "" | |
275 | ||
276 | #. TRANSLATORS: restarting the device to pick up new F/W | |
277 | msgid "Restarting device" | |
278 | msgstr "" | |
279 | ||
280 | #. TRANSLATORS: writing to the flash chips | |
281 | msgid "Writing firmware to device" | |
282 | msgstr "" | |
283 | ||
284 | #. TRANSLATORS: verifying we wrote the firmware correctly | |
285 | msgid "Verifying firmware from device" | |
286 | msgstr "" | |
287 | ||
288 | #. TRANSLATORS: scheduing an update to be done on the next boot | |
289 | msgid "Scheduling upgrade" | |
290 | msgstr "" | |
291 | ||
292 | #. TRANSLATORS: nothing attached that can be upgraded | |
293 | msgid "No hardware detected with firmware update capability" | |
294 | msgstr "" | |
295 | ||
296 | #. TRANSLATOR: the provider only supports offline | |
297 | msgid "Retrying as an offline update" | |
298 | msgstr "" | |
299 | ||
300 | #. TRANSLATORS: the first replacement is a display name | |
301 | #. * e.g. "ColorHugALS" and the second is a version number | |
302 | #. * e.g. "1.2.3" | |
303 | #, c-format | |
304 | msgid "Reinstalling %s with %s... " | |
305 | msgstr "" | |
306 | ||
307 | #. TRANSLATORS: the first replacement is a display name | |
308 | #. * e.g. "ColorHugALS" and the second and third are | |
309 | #. * version numbers e.g. "1.2.3" | |
310 | #, c-format | |
311 | msgid "Downgrading %s from %s to %s... " | |
312 | msgstr "" | |
313 | ||
314 | #. TRANSLATORS: the first replacement is a display name | |
315 | #. * e.g. "ColorHugALS" and the second and third are | |
316 | #. * version numbers e.g. "1.2.3" | |
317 | #, c-format | |
318 | msgid "Updating %s from %s to %s... " | |
319 | msgstr "" | |
320 | ||
321 | msgid "Done!" | |
322 | msgstr "" | |
323 | ||
324 | #. TRANSLATORS: first replacement is device name | |
325 | #, c-format | |
326 | msgid "%s has firmware updates:" | |
327 | msgstr "" | |
328 | ||
329 | msgid "GUID" | |
330 | msgstr "" | |
331 | ||
332 | #. TRANSLATORS: section header for firmware version | |
333 | msgid "Update Version" | |
334 | msgstr "" | |
335 | ||
336 | #. TRANSLATORS: section header for firmware checksum | |
337 | msgid "Update Checksum" | |
338 | msgstr "" | |
339 | ||
340 | msgid "Update Checksum Type" | |
341 | msgstr "" | |
342 | ||
343 | #. TRANSLATORS: section header for firmware remote http:// | |
344 | msgid "Update Location" | |
345 | msgstr "" | |
346 | ||
347 | #. TRANSLATORS: section header for long firmware desc | |
348 | msgid "Update Description" | |
349 | msgstr "" | |
350 | ||
351 | #. TRANSLATORS: this is when a device is hotplugged | |
352 | msgid "Device added:" | |
353 | msgstr "" | |
354 | ||
355 | #. TRANSLATORS: this is when a device is hotplugged | |
356 | msgid "Device removed:" | |
357 | msgstr "" | |
358 | ||
359 | #. TRANSLATORS: this is when a device has been updated | |
360 | msgid "Device changed:" | |
361 | msgstr "" | |
362 | ||
363 | #. TRANSLATORS: command line option | |
364 | msgid "Show extra debugging information" | |
365 | msgstr "" | |
366 | ||
367 | #. TRANSLATORS: command line option | |
368 | msgid "Perform the installation offline where possible" | |
369 | msgstr "" | |
370 | ||
371 | #. TRANSLATORS: command line option | |
372 | msgid "Allow re-installing existing firmware versions" | |
373 | msgstr "" | |
374 | ||
375 | #. TRANSLATORS: command line option | |
376 | msgid "Allow downgrading firmware versions" | |
377 | msgstr "" | |
378 | ||
379 | #. TRANSLATORS: command line option | |
380 | msgid "Override provider warning" | |
381 | msgstr "" | |
382 | ||
383 | #. TRANSLATORS: command description | |
384 | msgid "Get all devices that support firmware updates" | |
385 | msgstr "" | |
386 | ||
387 | #. TRANSLATORS: command description | |
388 | msgid "Install prepared updates now" | |
389 | msgstr "" | |
390 | ||
391 | #. TRANSLATORS: command description | |
392 | msgid "Install a firmware file on this hardware" | |
393 | msgstr "" | |
394 | ||
395 | #. TRANSLATORS: command description | |
396 | msgid "Gets details about a firmware file" | |
397 | msgstr "" | |
398 | ||
399 | #. TRANSLATORS: command description | |
400 | msgid "Gets the list of updates for connected hardware" | |
401 | msgstr "" | |
402 | ||
403 | #. TRANSLATORS: command description | |
404 | msgid "Updates all firmware to latest versions available" | |
405 | msgstr "" | |
406 | ||
407 | #. TRANSLATORS: command description | |
408 | msgid "Gets the cryptographic hash of the dumped firmware" | |
409 | msgstr "" | |
410 | ||
411 | #. TRANSLATORS: command description | |
412 | msgid "Unlocks the device for firmware access" | |
413 | msgstr "" | |
414 | ||
415 | #. TRANSLATORS: command description | |
416 | msgid "Clears the results from the last update" | |
417 | msgstr "" | |
418 | ||
419 | #. TRANSLATORS: command description | |
420 | msgid "Gets the results from the last update" | |
421 | msgstr "" | |
422 | ||
423 | #. TRANSLATORS: command description | |
424 | msgid "Refresh metadata from remote server" | |
425 | msgstr "" | |
426 | ||
427 | #. TRANSLATORS: command description | |
428 | msgid "Dump the ROM checksum" | |
429 | msgstr "" | |
430 | ||
431 | #. TRANSLATORS: command description | |
432 | msgid "Update the stored metadata with current ROM contents" | |
433 | msgstr "" | |
434 | ||
435 | #. TRANSLATORS: command description | |
436 | msgid "Monitor the daemon for events" | |
437 | msgstr "" | |
438 | ||
439 | #. TRANSLATORS: program name | |
440 | msgid "Firmware Utility" | |
441 | msgstr "" |
7 | 7 | msgstr "" |
8 | 8 | "Project-Id-Version: fwupd\n" |
9 | 9 | "Report-Msgid-Bugs-To: \n" |
10 | "POT-Creation-Date: 2016-04-01 14:38+0100\n" | |
11 | "PO-Revision-Date: 2016-04-01 13:38+0000\n" | |
10 | "POT-Creation-Date: 2016-06-13 13:29+0100\n" | |
11 | "PO-Revision-Date: 2016-06-13 12:29+0000\n" | |
12 | 12 | "Last-Translator: Richard Hughes <richard@hughsie.com>\n" |
13 | 13 | "Language-Team: Ukrainian (http://www.transifex.com/hughsie/fwupd/language/uk/)\n" |
14 | 14 | "MIME-Version: 1.0\n" |
95 | 95 | msgstr "Вилучено" |
96 | 96 | |
97 | 97 | #. TRANSLATORS: this is when a device is hotplugged |
98 | #. TRANSLATORS: this is when the daemon state changes | |
98 | 99 | msgid "Changed" |
99 | 100 | msgstr "Змінено" |
100 | 101 | |
121 | 122 | #. TRANSLATORS: detected a DFU device |
122 | 123 | msgid "Found" |
123 | 124 | msgstr "Знайдено" |
125 | ||
126 | #. TRANSLATORS: DFU protocol version, e.g. 1.1 | |
127 | msgid "Protocol" | |
128 | msgstr "" | |
124 | 129 | |
125 | 130 | #. TRANSLATORS: probably not run as root... |
126 | 131 | #. TRANSLATORS: device has failed to report status |
321 | 326 | msgid "%s has firmware updates:" |
322 | 327 | msgstr "%s має такі оновлення мікропрограми:" |
323 | 328 | |
324 | #. TRANSLATORS: a GUID for the hardware | |
325 | 329 | msgid "GUID" |
326 | 330 | msgstr "GUID" |
327 | 331 | |
328 | 332 | #. TRANSLATORS: section header for firmware version |
329 | msgid "Version" | |
330 | msgstr "Версія" | |
333 | msgid "Update Version" | |
334 | msgstr "Версія оновлення" | |
331 | 335 | |
332 | 336 | #. TRANSLATORS: section header for firmware checksum |
333 | msgid "Checksum" | |
334 | msgstr "Контрольна сума" | |
335 | ||
336 | msgid "Checksum Type" | |
337 | msgstr "" | |
337 | msgid "Update Checksum" | |
338 | msgstr "Контрольна сума оновлення" | |
339 | ||
340 | msgid "Update Checksum Type" | |
341 | msgstr "Тип контрольної суми оновлення" | |
338 | 342 | |
339 | 343 | #. TRANSLATORS: section header for firmware remote http:// |
340 | msgid "Location" | |
341 | msgstr "Місце" | |
344 | msgid "Update Location" | |
345 | msgstr "Місце оновлення" | |
342 | 346 | |
343 | 347 | #. TRANSLATORS: section header for long firmware desc |
344 | msgid "Description" | |
345 | msgstr "Опис" | |
348 | msgid "Update Description" | |
349 | msgstr "Опис оновлення" | |
350 | ||
351 | #. TRANSLATORS: this is when a device is hotplugged | |
352 | msgid "Device added:" | |
353 | msgstr "Додано пристрій:" | |
354 | ||
355 | #. TRANSLATORS: this is when a device is hotplugged | |
356 | msgid "Device removed:" | |
357 | msgstr "Вилучено пристрій:" | |
358 | ||
359 | #. TRANSLATORS: this is when a device has been updated | |
360 | msgid "Device changed:" | |
361 | msgstr "Змінено пристрій:" | |
346 | 362 | |
347 | 363 | #. TRANSLATORS: command line option |
348 | 364 | msgid "Show extra debugging information" |
360 | 376 | msgid "Allow downgrading firmware versions" |
361 | 377 | msgstr "Дозволити зниження версій мікропрограми" |
362 | 378 | |
379 | #. TRANSLATORS: command line option | |
380 | msgid "Override provider warning" | |
381 | msgstr "Не зважати на попередження надавача" | |
382 | ||
363 | 383 | #. TRANSLATORS: command description |
364 | 384 | msgid "Get all devices that support firmware updates" |
365 | 385 | msgstr "Отримати список усіх пристроїв, у яких передбачено оновлення мікропрограми" |
411 | 431 | #. TRANSLATORS: command description |
412 | 432 | msgid "Update the stored metadata with current ROM contents" |
413 | 433 | msgstr "Оновити збережені метадані на основі поточного вмісту ROM" |
434 | ||
435 | #. TRANSLATORS: command description | |
436 | msgid "Monitor the daemon for events" | |
437 | msgstr "Стежити за подіями у фоновій службі" | |
414 | 438 | |
415 | 439 | #. TRANSLATORS: program name |
416 | 440 | msgid "Firmware Utility" |
2 | 2 | # This file is distributed under the same license as the PACKAGE package. |
3 | 3 | # |
4 | 4 | # Translators: |
5 | # Dz Chen <wsxy162@gmail.com>, 2016 | |
5 | 6 | # Mingye Wang <arthur200126@gmail.com>, 2016 |
6 | 7 | # Mingye Wang <arthur2e5@aosc.xyz>, 2015 |
7 | 8 | msgid "" |
8 | 9 | msgstr "" |
9 | 10 | "Project-Id-Version: fwupd\n" |
10 | 11 | "Report-Msgid-Bugs-To: \n" |
11 | "POT-Creation-Date: 2016-04-01 14:38+0100\n" | |
12 | "PO-Revision-Date: 2016-04-01 13:38+0000\n" | |
12 | "POT-Creation-Date: 2016-06-13 13:29+0100\n" | |
13 | "PO-Revision-Date: 2016-06-13 12:29+0000\n" | |
13 | 14 | "Last-Translator: Richard Hughes <richard@hughsie.com>\n" |
14 | 15 | "Language-Team: Chinese (China) (http://www.transifex.com/hughsie/fwupd/language/zh_CN/)\n" |
15 | 16 | "MIME-Version: 1.0\n" |
52 | 53 | msgstr "需要认证:在可移动设备上降级固件" |
53 | 54 | |
54 | 55 | msgid "Unlock the device to allow access" |
55 | msgstr "" | |
56 | msgstr "解锁设备以允许访问" | |
56 | 57 | |
57 | 58 | #. TRANSLATORS: this is the PolicyKit modal dialog |
58 | 59 | msgid "Authentication is required to unlock a device" |
59 | msgstr "" | |
60 | msgstr "需要认证:解锁设备" | |
60 | 61 | |
61 | 62 | #. TRANSLATORS: this is a command alias, e.g. 'get-devices' |
62 | 63 | #, c-format |
96 | 97 | msgstr "已移除" |
97 | 98 | |
98 | 99 | #. TRANSLATORS: this is when a device is hotplugged |
100 | #. TRANSLATORS: this is when the daemon state changes | |
99 | 101 | msgid "Changed" |
100 | 102 | msgstr "已变更" |
101 | 103 | |
122 | 124 | #. TRANSLATORS: detected a DFU device |
123 | 125 | msgid "Found" |
124 | 126 | msgstr "找到" |
127 | ||
128 | #. TRANSLATORS: DFU protocol version, e.g. 1.1 | |
129 | msgid "Protocol" | |
130 | msgstr "" | |
125 | 131 | |
126 | 132 | #. TRANSLATORS: probably not run as root... |
127 | 133 | #. TRANSLATORS: device has failed to report status |
322 | 328 | msgid "%s has firmware updates:" |
323 | 329 | msgstr "%s 有固件更新:" |
324 | 330 | |
325 | #. TRANSLATORS: a GUID for the hardware | |
326 | 331 | msgid "GUID" |
327 | 332 | msgstr "GUID" |
328 | 333 | |
329 | 334 | #. TRANSLATORS: section header for firmware version |
330 | msgid "Version" | |
331 | msgstr "版本" | |
335 | msgid "Update Version" | |
336 | msgstr "更新版本" | |
332 | 337 | |
333 | 338 | #. TRANSLATORS: section header for firmware checksum |
334 | msgid "Checksum" | |
335 | msgstr "校验和" | |
336 | ||
337 | msgid "Checksum Type" | |
338 | msgstr "" | |
339 | msgid "Update Checksum" | |
340 | msgstr "更新校验和" | |
341 | ||
342 | msgid "Update Checksum Type" | |
343 | msgstr "更新校验和类型" | |
339 | 344 | |
340 | 345 | #. TRANSLATORS: section header for firmware remote http:// |
341 | msgid "Location" | |
342 | msgstr "位置" | |
346 | msgid "Update Location" | |
347 | msgstr "更新位置" | |
343 | 348 | |
344 | 349 | #. TRANSLATORS: section header for long firmware desc |
345 | msgid "Description" | |
346 | msgstr "描述" | |
350 | msgid "Update Description" | |
351 | msgstr "更新说明" | |
352 | ||
353 | #. TRANSLATORS: this is when a device is hotplugged | |
354 | msgid "Device added:" | |
355 | msgstr "已添加设备:" | |
356 | ||
357 | #. TRANSLATORS: this is when a device is hotplugged | |
358 | msgid "Device removed:" | |
359 | msgstr "已移除设备:" | |
360 | ||
361 | #. TRANSLATORS: this is when a device has been updated | |
362 | msgid "Device changed:" | |
363 | msgstr "已更改设备:" | |
347 | 364 | |
348 | 365 | #. TRANSLATORS: command line option |
349 | 366 | msgid "Show extra debugging information" |
361 | 378 | msgid "Allow downgrading firmware versions" |
362 | 379 | msgstr "允许降级固件版本" |
363 | 380 | |
381 | #. TRANSLATORS: command line option | |
382 | msgid "Override provider warning" | |
383 | msgstr "替代提供商警告" | |
384 | ||
364 | 385 | #. TRANSLATORS: command description |
365 | 386 | msgid "Get all devices that support firmware updates" |
366 | 387 | msgstr "获得所有支持更新固件的硬件列表" |
391 | 412 | |
392 | 413 | #. TRANSLATORS: command description |
393 | 414 | msgid "Unlocks the device for firmware access" |
394 | msgstr "" | |
415 | msgstr "为固件访问解锁设备" | |
395 | 416 | |
396 | 417 | #. TRANSLATORS: command description |
397 | 418 | msgid "Clears the results from the last update" |
412 | 433 | #. TRANSLATORS: command description |
413 | 434 | msgid "Update the stored metadata with current ROM contents" |
414 | 435 | msgstr "使用目前的 ROM 内容更新存储的元数据" |
436 | ||
437 | #. TRANSLATORS: command description | |
438 | msgid "Monitor the daemon for events" | |
439 | msgstr "监视守护程序里的事件" | |
415 | 440 | |
416 | 441 | #. TRANSLATORS: program name |
417 | 442 | msgid "Firmware Utility" |
5 | 5 | |
6 | 6 | AM_CPPFLAGS = \ |
7 | 7 | $(APPSTREAM_GLIB_CFLAGS) \ |
8 | $(COLORHUG_CFLAGS) \ | |
9 | 8 | $(GUSB_CFLAGS) \ |
10 | 9 | $(GCAB_CFLAGS) \ |
11 | 10 | $(GLIB_CFLAGS) \ |
12 | 11 | $(GUDEV_CFLAGS) \ |
13 | 12 | $(PIE_CFLAGS) \ |
14 | 13 | $(POLKIT_CFLAGS) \ |
15 | $(UEFI_CFLAGS) \ | |
16 | 14 | $(GPGME_CFLAGS) \ |
17 | 15 | $(SOUP_CFLAGS) \ |
18 | 16 | $(ARCHIVE_CFLAGS) \ |
114 | 112 | fu-rom.h \ |
115 | 113 | fu-main.c |
116 | 114 | |
117 | if HAVE_COLORHUG | |
118 | fwupd_SOURCES += \ | |
119 | fu-provider-chug.c \ | |
120 | fu-provider-chug.h | |
121 | endif | |
122 | ||
123 | if HAVE_UEFI | |
124 | fwupd_SOURCES += \ | |
125 | fu-provider-uefi.c \ | |
126 | fu-provider-uefi.h | |
127 | endif | |
128 | ||
129 | 115 | fwupd_LDADD = \ |
130 | 116 | $(FWUPD_LIBS) \ |
131 | 117 | $(DFU_LIBS) \ |
132 | 118 | $(APPSTREAM_GLIB_LIBS) \ |
133 | $(COLORHUG_LIBS) \ | |
134 | 119 | $(GUSB_LIBS) \ |
135 | 120 | $(GCAB_LIBS) \ |
136 | 121 | $(GLIB_LIBS) \ |
138 | 123 | $(POLKIT_LIBS) \ |
139 | 124 | $(SQLITE_LIBS) \ |
140 | 125 | $(GPGME_LIBS) \ |
141 | $(ARCHIVE_LIBS) \ | |
126 | $(ARCHIVE_LIBS) | |
127 | ||
128 | if HAVE_COLORHUG | |
129 | fwupd_SOURCES += \ | |
130 | fu-provider-chug.c \ | |
131 | fu-provider-chug.h | |
132 | fwupd_LDADD += \ | |
133 | $(COLORHUG_LIBS) | |
134 | AM_CPPFLAGS += \ | |
135 | $(COLORHUG_CFLAGS) | |
136 | endif | |
137 | ||
138 | if HAVE_UEFI | |
139 | fwupd_SOURCES += \ | |
140 | fu-provider-uefi.c \ | |
141 | fu-provider-uefi.h | |
142 | AM_CPPFLAGS += \ | |
143 | $(UEFI_CFLAGS) | |
144 | fwupd_LDADD += \ | |
142 | 145 | $(UEFI_LIBS) |
146 | endif | |
143 | 147 | |
144 | 148 | fwupd_LDFLAGS = \ |
145 | 149 | $(PIE_LDFLAGS) \ |
20 | 20 | |
21 | 21 | #include "config.h" |
22 | 22 | |
23 | #include <appstream-glib.h> | |
23 | 24 | #include <glib-object.h> |
24 | 25 | #include <gio/gio.h> |
25 | 26 | |
34 | 35 | **/ |
35 | 36 | typedef struct { |
36 | 37 | gchar *equivalent_id; |
38 | FuDevice *alternate; | |
37 | 39 | GHashTable *metadata; |
38 | 40 | } FuDevicePrivate; |
39 | 41 | |
64 | 66 | } |
65 | 67 | |
66 | 68 | /** |
69 | * fu_device_get_alternate: | |
70 | **/ | |
71 | FuDevice * | |
72 | fu_device_get_alternate (FuDevice *device) | |
73 | { | |
74 | FuDevicePrivate *priv = GET_PRIVATE (device); | |
75 | g_return_val_if_fail (FU_IS_DEVICE (device), NULL); | |
76 | return priv->alternate; | |
77 | } | |
78 | ||
79 | /** | |
80 | * fu_device_set_alternate: | |
81 | **/ | |
82 | void | |
83 | fu_device_set_alternate (FuDevice *device, FuDevice *alternate) | |
84 | { | |
85 | FuDevicePrivate *priv = GET_PRIVATE (device); | |
86 | g_return_if_fail (FU_IS_DEVICE (device)); | |
87 | g_set_object (&priv->alternate, alternate); | |
88 | } | |
89 | ||
90 | /** | |
91 | * fu_device_add_guid: | |
92 | **/ | |
93 | void | |
94 | fu_device_add_guid (FuDevice *device, const gchar *guid) | |
95 | { | |
96 | /* make valid */ | |
97 | if (!as_utils_guid_is_valid (guid)) { | |
98 | g_autofree gchar *tmp = as_utils_guid_from_string (guid); | |
99 | g_debug ("using %s for %s", tmp, guid); | |
100 | fwupd_result_add_guid (FWUPD_RESULT (device), tmp); | |
101 | return; | |
102 | } | |
103 | ||
104 | /* already valid */ | |
105 | fwupd_result_add_guid (FWUPD_RESULT (device), guid); | |
106 | } | |
107 | ||
108 | /** | |
67 | 109 | * fu_device_get_metadata: |
68 | 110 | **/ |
69 | 111 | const gchar * |
76 | 118 | } |
77 | 119 | |
78 | 120 | /** |
79 | * fu_device_get_id: | |
121 | * fu_device_set_metadata: | |
80 | 122 | **/ |
81 | 123 | void |
82 | 124 | fu_device_set_metadata (FuDevice *device, const gchar *key, const gchar *value) |
86 | 128 | g_return_if_fail (key != NULL); |
87 | 129 | g_return_if_fail (value != NULL); |
88 | 130 | g_hash_table_insert (priv->metadata, g_strdup (key), g_strdup (value)); |
131 | } | |
132 | ||
133 | /** | |
134 | * fu_device_set_name: | |
135 | **/ | |
136 | void | |
137 | fu_device_set_name (FuDevice *device, const gchar *value) | |
138 | { | |
139 | g_autoptr(GString) new = g_string_new (value); | |
140 | g_strdelimit (new->str, "_", ' '); | |
141 | as_utils_string_replace (new, "(TM)", "™"); | |
142 | fwupd_result_set_device_name (FWUPD_RESULT (device), new->str); | |
89 | 143 | } |
90 | 144 | |
91 | 145 | /** |
118 | 172 | FuDevice *device = FU_DEVICE (object); |
119 | 173 | FuDevicePrivate *priv = GET_PRIVATE (device); |
120 | 174 | |
175 | if (priv->alternate != NULL) | |
176 | g_object_unref (priv->alternate); | |
121 | 177 | g_hash_table_unref (priv->metadata); |
122 | 178 | |
123 | 179 | G_OBJECT_CLASS (fu_device_parent_class)->finalize (object); |
47 | 47 | #define fu_device_set_created(d,v) fwupd_result_set_device_created(FWUPD_RESULT(d),v) |
48 | 48 | #define fu_device_set_description(d,v) fwupd_result_set_device_description(FWUPD_RESULT(d),v) |
49 | 49 | #define fu_device_set_flags(d,v) fwupd_result_set_device_flags(FWUPD_RESULT(d),v) |
50 | #define fu_device_set_guid(d,v) fwupd_result_set_guid(FWUPD_RESULT(d),v) | |
50 | #define fu_device_has_guid(d,v) fwupd_result_has_guid(FWUPD_RESULT(d),v) | |
51 | 51 | #define fu_device_set_id(d,v) fwupd_result_set_device_id(FWUPD_RESULT(d),v) |
52 | 52 | #define fu_device_set_modified(d,v) fwupd_result_set_device_modified(FWUPD_RESULT(d),v) |
53 | #define fu_device_set_name(d,v) fwupd_result_set_device_name(FWUPD_RESULT(d),v) | |
54 | 53 | #define fu_device_set_provider(d,v) fwupd_result_set_device_provider(FWUPD_RESULT(d),v) |
55 | 54 | #define fu_device_set_update_checksum(d,v) fwupd_result_set_update_checksum(FWUPD_RESULT(d),v) |
56 | 55 | #define fu_device_set_update_description(d,v) fwupd_result_set_update_description(FWUPD_RESULT(d),v) |
68 | 67 | #define fu_device_set_vendor(d,v) fwupd_result_set_device_vendor(FWUPD_RESULT(d),v) |
69 | 68 | #define fu_device_set_version(d,v) fwupd_result_set_device_version(FWUPD_RESULT(d),v) |
70 | 69 | #define fu_device_set_version_lowest(d,v) fwupd_result_set_device_version_lowest(FWUPD_RESULT(d),v) |
70 | #define fu_device_set_flashes_left(d,v) fwupd_result_set_device_flashes_left(FWUPD_RESULT(d),v) | |
71 | 71 | |
72 | 72 | /* compat getters */ |
73 | 73 | #define fu_device_get_checksum(d) fwupd_result_get_device_checksum(FWUPD_RESULT(d)) |
74 | 74 | #define fu_device_get_flags(d) fwupd_result_get_device_flags(FWUPD_RESULT(d)) |
75 | #define fu_device_get_guid(d) fwupd_result_get_guid(FWUPD_RESULT(d)) | |
75 | #define fu_device_get_guids(d) fwupd_result_get_guids(FWUPD_RESULT(d)) | |
76 | #define fu_device_get_guid_default(d) fwupd_result_get_guid_default(FWUPD_RESULT(d)) | |
77 | #define fu_device_get_name(d) fwupd_result_get_device_name(FWUPD_RESULT(d)) | |
76 | 78 | #define fu_device_get_id(d) fwupd_result_get_device_id(FWUPD_RESULT(d)) |
77 | 79 | #define fu_device_get_provider(d) fwupd_result_get_device_provider(FWUPD_RESULT(d)) |
78 | 80 | #define fu_device_get_update_checksum(d) fwupd_result_get_update_checksum(FWUPD_RESULT(d)) |
82 | 84 | #define fu_device_get_update_version(d) fwupd_result_get_update_version(FWUPD_RESULT(d)) |
83 | 85 | #define fu_device_get_version(d) fwupd_result_get_device_version(FWUPD_RESULT(d)) |
84 | 86 | #define fu_device_get_version_lowest(d) fwupd_result_get_device_version_lowest(FWUPD_RESULT(d)) |
87 | #define fu_device_get_flashes_left(d) fwupd_result_get_device_flashes_left(FWUPD_RESULT(d)) | |
85 | 88 | |
86 | 89 | /* accessors */ |
87 | 90 | const gchar *fu_device_get_equivalent_id (FuDevice *device); |
88 | 91 | void fu_device_set_equivalent_id (FuDevice *device, |
89 | 92 | const gchar *equivalent_id); |
93 | void fu_device_add_guid (FuDevice *device, | |
94 | const gchar *guid); | |
95 | FuDevice *fu_device_get_alternate (FuDevice *device); | |
96 | void fu_device_set_alternate (FuDevice *device, | |
97 | FuDevice *alternate); | |
90 | 98 | const gchar *fu_device_get_metadata (FuDevice *device, |
91 | 99 | const gchar *key); |
92 | 100 | void fu_device_set_metadata (FuDevice *device, |
93 | 101 | const gchar *key, |
102 | const gchar *value); | |
103 | void fu_device_set_name (FuDevice *device, | |
94 | 104 | const gchar *value); |
95 | 105 | |
96 | 106 | G_END_DECLS |
93 | 93 | |
94 | 94 | /* enable armor mode */ |
95 | 95 | gpgme_set_armor (priv->ctx, TRUE); |
96 | ||
97 | /* never interactive */ | |
98 | gpgme_set_pinentry_mode (priv->ctx, GPGME_PINENTRY_MODE_ERROR); | |
99 | 96 | |
100 | 97 | return TRUE; |
101 | 98 | } |
83 | 83 | FuProvider *provider; |
84 | 84 | } FuDeviceItem; |
85 | 85 | |
86 | static gboolean fu_main_get_updates_item_update (FuMainPrivate *priv, FuDeviceItem *item); | |
87 | ||
86 | 88 | /** |
87 | 89 | * fu_main_emit_changed: |
88 | 90 | **/ |
98 | 100 | FWUPD_DBUS_INTERFACE, |
99 | 101 | "Changed", |
100 | 102 | NULL, NULL); |
103 | } | |
104 | ||
105 | /** | |
106 | * fu_main_emit_device_added: | |
107 | **/ | |
108 | static void | |
109 | fu_main_emit_device_added (FuMainPrivate *priv, FuDevice *device) | |
110 | { | |
111 | GVariant *val; | |
112 | ||
113 | /* not yet connected */ | |
114 | if (priv->connection == NULL) | |
115 | return; | |
116 | val = fwupd_result_to_data (FWUPD_RESULT (device), "(a{sv})"); | |
117 | g_dbus_connection_emit_signal (priv->connection, | |
118 | NULL, | |
119 | FWUPD_DBUS_PATH, | |
120 | FWUPD_DBUS_INTERFACE, | |
121 | "DeviceAdded", | |
122 | val, NULL); | |
123 | } | |
124 | ||
125 | /** | |
126 | * fu_main_emit_device_removed: | |
127 | **/ | |
128 | static void | |
129 | fu_main_emit_device_removed (FuMainPrivate *priv, FuDevice *device) | |
130 | { | |
131 | GVariant *val; | |
132 | ||
133 | /* not yet connected */ | |
134 | if (priv->connection == NULL) | |
135 | return; | |
136 | val = fwupd_result_to_data (FWUPD_RESULT (device), "(a{sv})"); | |
137 | g_dbus_connection_emit_signal (priv->connection, | |
138 | NULL, | |
139 | FWUPD_DBUS_PATH, | |
140 | FWUPD_DBUS_INTERFACE, | |
141 | "DeviceRemoved", | |
142 | val, NULL); | |
143 | } | |
144 | ||
145 | /** | |
146 | * fu_main_emit_device_changed: | |
147 | **/ | |
148 | static void | |
149 | fu_main_emit_device_changed (FuMainPrivate *priv, FuDevice *device) | |
150 | { | |
151 | GVariant *val; | |
152 | ||
153 | /* not yet connected */ | |
154 | if (priv->connection == NULL) | |
155 | return; | |
156 | val = fwupd_result_to_data (FWUPD_RESULT (device), "(a{sv})"); | |
157 | g_dbus_connection_emit_signal (priv->connection, | |
158 | NULL, | |
159 | FWUPD_DBUS_PATH, | |
160 | FWUPD_DBUS_INTERFACE, | |
161 | "DeviceChanged", | |
162 | val, NULL); | |
101 | 163 | } |
102 | 164 | |
103 | 165 | /** |
294 | 356 | |
295 | 357 | for (i = 0; i < priv->devices->len; i++) { |
296 | 358 | item = g_ptr_array_index (priv->devices, i); |
297 | if (g_strcmp0 (fu_device_get_guid (item->device), guid) == 0) | |
359 | if (fu_device_has_guid (item->device, guid)) | |
298 | 360 | return item; |
299 | 361 | } |
300 | 362 | return NULL; |
473 | 535 | return FALSE; |
474 | 536 | |
475 | 537 | /* make the UI update */ |
538 | fu_main_emit_device_changed (helper->priv, item->device); | |
476 | 539 | fu_main_emit_changed (helper->priv); |
477 | 540 | return TRUE; |
478 | 541 | } |
494 | 557 | FWUPD_ERROR_INVALID_FILE, |
495 | 558 | "device %s was removed", |
496 | 559 | fu_device_get_id (helper->device)); |
560 | return FALSE; | |
561 | } | |
562 | ||
563 | /* The provider might have taken away update abilities */ | |
564 | if (!fu_device_has_flag (item->device, FU_DEVICE_FLAG_ALLOW_OFFLINE) && | |
565 | !fu_device_has_flag (item->device, FU_DEVICE_FLAG_ALLOW_ONLINE)) { | |
566 | g_set_error(error, | |
567 | FWUPD_ERROR, | |
568 | FWUPD_ERROR_INTERNAL, | |
569 | "Device %s does not currently allow updates", | |
570 | fu_device_get_id (helper->device)); | |
497 | 571 | return FALSE; |
498 | 572 | } |
499 | 573 | |
523 | 597 | |
524 | 598 | /* make the UI update */ |
525 | 599 | fu_device_set_modified (item->device, g_get_real_time () / G_USEC_PER_SEC); |
600 | fu_main_emit_device_changed (helper->priv, item->device); | |
526 | 601 | fu_main_emit_changed (helper->priv); |
527 | 602 | return TRUE; |
528 | 603 | } |
663 | 738 | } |
664 | 739 | |
665 | 740 | /** |
741 | * fu_main_store_get_app_by_guids: | |
742 | **/ | |
743 | static AsApp * | |
744 | fu_main_store_get_app_by_guids (AsStore *store, FuDevice *device) | |
745 | { | |
746 | GPtrArray *guids; | |
747 | guint i; | |
748 | ||
749 | guids = fu_device_get_guids (device); | |
750 | for (i = 0; i < guids->len; i++) { | |
751 | AsApp *app = NULL; | |
752 | app = as_store_get_app_by_provide (store, | |
753 | AS_PROVIDE_KIND_FIRMWARE_FLASHED, | |
754 | g_ptr_array_index (guids, i)); | |
755 | if (app != NULL) | |
756 | return app; | |
757 | } | |
758 | return NULL; | |
759 | } | |
760 | ||
761 | /** | |
666 | 762 | * fu_main_update_helper: |
667 | 763 | **/ |
668 | 764 | static gboolean |
686 | 782 | for (i = 0; i < helper->priv->devices->len; i++) { |
687 | 783 | FuDeviceItem *item; |
688 | 784 | item = g_ptr_array_index (helper->priv->devices, i); |
689 | app = as_store_get_app_by_provide (helper->store, | |
690 | AS_PROVIDE_KIND_FIRMWARE_FLASHED, | |
691 | fu_device_get_guid (item->device)); | |
785 | app = fu_main_store_get_app_by_guids (helper->store, item->device); | |
692 | 786 | if (app != NULL) { |
693 | 787 | helper->device = g_object_ref (item->device); |
694 | 788 | break; |
709 | 803 | } else { |
710 | 804 | /* find an application from the cabinet 'store' for the |
711 | 805 | * chosen device */ |
712 | app = as_store_get_app_by_provide (helper->store, | |
713 | AS_PROVIDE_KIND_FIRMWARE_FLASHED, | |
714 | fu_device_get_guid (helper->device)); | |
806 | app = fu_main_store_get_app_by_guids (helper->store, helper->device); | |
715 | 807 | if (app == NULL) { |
716 | 808 | g_autofree gchar *guid = NULL; |
717 | 809 | guid = fu_main_get_guids_from_store (helper->store); |
719 | 811 | FWUPD_ERROR, |
720 | 812 | FWUPD_ERROR_INVALID_FILE, |
721 | 813 | "firmware is not for this hw: required %s got %s", |
722 | fu_device_get_guid (helper->device), guid); | |
814 | fu_device_get_guid_default (helper->device), guid); | |
723 | 815 | return FALSE; |
724 | 816 | } |
725 | 817 | } |
761 | 853 | FWUPD_ERROR_VERSION_NEWER, |
762 | 854 | "Specified firmware is older than the minimum " |
763 | 855 | "required version '%s < %s'", tmp, version); |
856 | return FALSE; | |
857 | } | |
858 | ||
859 | /* check the device is locked */ | |
860 | if (fu_device_has_flag (helper->device, FU_DEVICE_FLAG_LOCKED)) { | |
861 | g_set_error (error, | |
862 | FWUPD_ERROR, | |
863 | FWUPD_ERROR_INTERNAL, | |
864 | "Device %s is locked", | |
865 | fu_device_get_id(helper->device)); | |
764 | 866 | return FALSE; |
765 | 867 | } |
766 | 868 | |
1040 | 1142 | AsApp *app; |
1041 | 1143 | GPtrArray *apps; |
1042 | 1144 | guint i; |
1145 | FuDeviceItem *item; | |
1043 | 1146 | FuMainPrivate *priv = (FuMainPrivate *) user_data; |
1044 | 1147 | |
1148 | /* print what we've got */ | |
1045 | 1149 | apps = as_store_get_apps (priv->store); |
1046 | 1150 | if (apps->len == 0) { |
1047 | 1151 | g_debug ("no devices in store"); |
1054 | 1158 | as_app_get_name (app, NULL)); |
1055 | 1159 | } |
1056 | 1160 | } |
1161 | ||
1162 | /* are any devices now supported? */ | |
1163 | for (i = 0; i < priv->devices->len; i++) { | |
1164 | item = g_ptr_array_index (priv->devices, i); | |
1165 | if (fu_main_get_updates_item_update (priv, item)) | |
1166 | fu_main_emit_device_changed (priv, item->device); | |
1167 | } | |
1168 | ||
1057 | 1169 | priv->store_changed_id = 0; |
1058 | 1170 | return G_SOURCE_REMOVE; |
1059 | 1171 | } |
1070 | 1182 | } |
1071 | 1183 | |
1072 | 1184 | /** |
1185 | * fu_main_get_updates_item_update: | |
1186 | **/ | |
1187 | static gboolean | |
1188 | fu_main_get_updates_item_update (FuMainPrivate *priv, FuDeviceItem *item) | |
1189 | { | |
1190 | AsApp *app; | |
1191 | AsChecksum *csum; | |
1192 | AsRelease *rel; | |
1193 | GPtrArray *releases; | |
1194 | const gchar *tmp; | |
1195 | const gchar *version; | |
1196 | guint i; | |
1197 | g_autoptr(GPtrArray) updates_list = NULL; | |
1198 | ||
1199 | /* get device version */ | |
1200 | version = fu_device_get_version (item->device); | |
1201 | if (version == NULL) | |
1202 | return FALSE; | |
1203 | ||
1204 | /* match the GUIDs in the XML */ | |
1205 | app = fu_main_store_get_app_by_guids (priv->store, item->device); | |
1206 | if (app == NULL) | |
1207 | return FALSE; | |
1208 | ||
1209 | /* possibly convert the version from 0x to dotted */ | |
1210 | fu_main_vendor_quirk_release_version (app); | |
1211 | ||
1212 | /* get latest release */ | |
1213 | rel = as_app_get_release_default (app); | |
1214 | if (rel == NULL) { | |
1215 | g_debug ("%s has no firmware update metadata", | |
1216 | fu_device_get_id (item->device)); | |
1217 | return FALSE; | |
1218 | } | |
1219 | ||
1220 | /* supported in metadata */ | |
1221 | fwupd_result_add_device_flag (FWUPD_RESULT (item->device), | |
1222 | FU_DEVICE_FLAG_SUPPORTED); | |
1223 | ||
1224 | /* check if actually newer than what we have installed */ | |
1225 | if (as_utils_vercmp (as_release_get_version (rel), version) <= 0) { | |
1226 | g_debug ("%s has no firmware updates", | |
1227 | fu_device_get_id (item->device)); | |
1228 | return FALSE; | |
1229 | } | |
1230 | ||
1231 | /* only show devices that can be updated */ | |
1232 | if (!fu_device_has_flag (item->device, FU_DEVICE_FLAG_ALLOW_OFFLINE) && | |
1233 | !fu_device_has_flag (item->device, FU_DEVICE_FLAG_ALLOW_ONLINE)) { | |
1234 | g_debug ("ignoring %s as not updatable live or offline", | |
1235 | fu_device_get_id (item->device)); | |
1236 | return FALSE; | |
1237 | } | |
1238 | ||
1239 | /* can we only do this on AC power */ | |
1240 | if (fu_device_has_flag (item->device, FU_DEVICE_FLAG_REQUIRE_AC) && | |
1241 | fu_main_on_battery (priv)) { | |
1242 | g_debug ("ignoring update for %s as not on AC power", | |
1243 | fu_device_get_id (item->device)); | |
1244 | return FALSE; | |
1245 | } | |
1246 | ||
1247 | /* add application metadata */ | |
1248 | fu_device_set_update_id (item->device, as_app_get_id (app)); | |
1249 | tmp = as_app_get_developer_name (app, NULL); | |
1250 | if (tmp != NULL) | |
1251 | fu_device_set_update_vendor (item->device, tmp); | |
1252 | tmp = as_app_get_name (app, NULL); | |
1253 | if (tmp != NULL) | |
1254 | fu_device_set_update_name (item->device, tmp); | |
1255 | tmp = as_app_get_comment (app, NULL); | |
1256 | if (tmp != NULL) | |
1257 | fu_device_set_update_summary (item->device, tmp); | |
1258 | tmp = as_app_get_description (app, NULL); | |
1259 | if (tmp != NULL) | |
1260 | fu_device_set_description (item->device, tmp); | |
1261 | tmp = as_app_get_url_item (app, AS_URL_KIND_HOMEPAGE); | |
1262 | if (tmp != NULL) | |
1263 | fu_device_set_update_homepage (item->device, tmp); | |
1264 | tmp = as_app_get_project_license (app); | |
1265 | if (tmp != NULL) | |
1266 | fu_device_set_update_license (item->device, tmp); | |
1267 | ||
1268 | /* add release information */ | |
1269 | tmp = as_release_get_version (rel); | |
1270 | if (tmp != NULL) | |
1271 | fu_device_set_update_version (item->device, tmp); | |
1272 | csum = as_release_get_checksum_by_target (rel, AS_CHECKSUM_TARGET_CONTAINER); | |
1273 | if (csum != NULL) { | |
1274 | fu_device_set_update_checksum (item->device, | |
1275 | as_checksum_get_value (csum)); | |
1276 | } | |
1277 | tmp = as_release_get_location_default (rel); | |
1278 | if (tmp != NULL) | |
1279 | fu_device_set_update_uri (item->device, tmp); | |
1280 | ||
1281 | /* get the list of releases newer than the one installed */ | |
1282 | updates_list = g_ptr_array_new (); | |
1283 | releases = as_app_get_releases (app); | |
1284 | for (i = 0; i < releases->len; i++) { | |
1285 | rel = g_ptr_array_index (releases, i); | |
1286 | if (as_utils_vercmp (as_release_get_version (rel), version) < 0) | |
1287 | continue; | |
1288 | tmp = as_release_get_description (rel, NULL); | |
1289 | if (tmp == NULL) | |
1290 | continue; | |
1291 | g_ptr_array_add (updates_list, rel); | |
1292 | } | |
1293 | ||
1294 | /* no prefix on each release */ | |
1295 | if (updates_list->len == 1) { | |
1296 | rel = g_ptr_array_index (updates_list, 0); | |
1297 | fu_device_set_update_description (item->device, | |
1298 | as_release_get_description (rel, NULL)); | |
1299 | } else { | |
1300 | g_autoptr(GString) update_desc = NULL; | |
1301 | update_desc = g_string_new (""); | |
1302 | ||
1303 | /* get the descriptions with a version prefix */ | |
1304 | for (i = 0; i < updates_list->len; i++) { | |
1305 | rel = g_ptr_array_index (updates_list, i); | |
1306 | g_string_append_printf (update_desc, | |
1307 | "<p>%s:</p>%s", | |
1308 | as_release_get_version (rel), | |
1309 | as_release_get_description (rel, NULL)); | |
1310 | } | |
1311 | if (update_desc->len > 0) | |
1312 | fu_device_set_update_description (item->device, update_desc->str); | |
1313 | } | |
1314 | ||
1315 | /* success */ | |
1316 | return TRUE; | |
1317 | } | |
1318 | ||
1319 | /** | |
1073 | 1320 | * fu_main_get_updates: |
1074 | 1321 | **/ |
1075 | 1322 | static GPtrArray * |
1076 | 1323 | fu_main_get_updates (FuMainPrivate *priv, GError **error) |
1077 | 1324 | { |
1078 | AsApp *app; | |
1079 | AsRelease *rel; | |
1325 | GPtrArray *updates; | |
1080 | 1326 | FuDeviceItem *item; |
1081 | GPtrArray *updates; | |
1082 | 1327 | guint i; |
1083 | const gchar *tmp; | |
1084 | 1328 | |
1085 | 1329 | /* find any updates using the AppStream metadata */ |
1086 | 1330 | updates = g_ptr_array_new (); |
1087 | 1331 | for (i = 0; i < priv->devices->len; i++) { |
1088 | const gchar *version; | |
1089 | AsChecksum *csum; | |
1090 | ||
1091 | 1332 | item = g_ptr_array_index (priv->devices, i); |
1092 | ||
1093 | /* get device version */ | |
1094 | version = fu_device_get_version (item->device); | |
1095 | if (version == NULL) | |
1333 | if (fu_main_get_updates_item_update (priv, item)) | |
1334 | g_ptr_array_add (updates, item); | |
1335 | } | |
1336 | return updates; | |
1337 | } | |
1338 | ||
1339 | static AsStore * | |
1340 | fu_main_get_store_from_fd (FuMainPrivate *priv, gint fd, GError **error) | |
1341 | { | |
1342 | g_autoptr(AsStore) store = NULL; | |
1343 | g_autoptr(GBytes) blob_cab = NULL; | |
1344 | g_autoptr(GError) error_local = NULL; | |
1345 | g_autoptr(GInputStream) stream = NULL; | |
1346 | ||
1347 | /* read the entire fd to a data blob */ | |
1348 | stream = g_unix_input_stream_new (fd, TRUE); | |
1349 | blob_cab = g_input_stream_read_bytes (stream, | |
1350 | FU_MAIN_FIRMWARE_SIZE_MAX, | |
1351 | NULL, &error_local); | |
1352 | if (blob_cab == NULL){ | |
1353 | g_set_error_literal (error, | |
1354 | FWUPD_ERROR, | |
1355 | FWUPD_ERROR_INVALID_FILE, | |
1356 | error_local->message); | |
1357 | return NULL; | |
1358 | } | |
1359 | ||
1360 | /* load file */ | |
1361 | store = as_store_new (); | |
1362 | if (!as_store_from_bytes (store, blob_cab, NULL, &error_local)) { | |
1363 | g_set_error_literal (error, | |
1364 | FWUPD_ERROR, | |
1365 | FWUPD_ERROR_INVALID_FILE, | |
1366 | error_local->message); | |
1367 | return NULL; | |
1368 | } | |
1369 | return g_steal_pointer (&store); | |
1370 | } | |
1371 | ||
1372 | static FwupdResult * | |
1373 | fu_main_get_result_from_app (FuMainPrivate *priv, AsApp *app, GError **error) | |
1374 | { | |
1375 | FwupdTrustFlags trust_flags = FWUPD_TRUST_FLAG_NONE; | |
1376 | AsRelease *rel; | |
1377 | GPtrArray *provides; | |
1378 | guint i; | |
1379 | g_autoptr(FwupdResult) res = NULL; | |
1380 | ||
1381 | res = fwupd_result_new (); | |
1382 | provides = as_app_get_provides (app); | |
1383 | for (i = 0; i < provides->len; i++) { | |
1384 | AsProvide *prov = AS_PROVIDE (g_ptr_array_index (provides, i)); | |
1385 | FuDeviceItem *item; | |
1386 | const gchar *guid; | |
1387 | ||
1388 | /* not firmware */ | |
1389 | if (as_provide_get_kind (prov) != AS_PROVIDE_KIND_FIRMWARE_FLASHED) | |
1096 | 1390 | continue; |
1097 | 1391 | |
1098 | /* match the GUID in the XML */ | |
1099 | app = as_store_get_app_by_provide (priv->store, | |
1100 | AS_PROVIDE_KIND_FIRMWARE_FLASHED, | |
1101 | fu_device_get_guid (item->device)); | |
1102 | if (app == NULL) | |
1392 | /* is a online or offline update appropriate */ | |
1393 | guid = as_provide_get_value (prov); | |
1394 | if (guid == NULL) | |
1103 | 1395 | continue; |
1104 | ||
1105 | /* possibly convert the version from 0x to dotted */ | |
1106 | fu_main_vendor_quirk_release_version (app); | |
1107 | ||
1108 | /* get latest release */ | |
1109 | rel = as_app_get_release_default (app); | |
1110 | if (rel == NULL) { | |
1111 | g_debug ("%s has no firmware update metadata", | |
1112 | fu_device_get_id (item->device)); | |
1113 | continue; | |
1114 | } | |
1115 | ||
1116 | /* check if actually newer than what we have installed */ | |
1117 | if (as_utils_vercmp (as_release_get_version (rel), version) <= 0) { | |
1118 | g_debug ("%s has no firmware updates", | |
1119 | fu_device_get_id (item->device)); | |
1120 | continue; | |
1121 | } | |
1122 | ||
1123 | /* can we only do this on AC power */ | |
1124 | if (fu_device_has_flag (item->device, FU_DEVICE_FLAG_REQUIRE_AC) && | |
1125 | fu_main_on_battery (priv)) { | |
1126 | g_debug ("ignoring update for %s as not on AC power", | |
1127 | fu_device_get_id (item->device)); | |
1128 | continue; | |
1129 | } | |
1130 | ||
1131 | /* add application metadata */ | |
1132 | fu_device_set_update_id (item->device, as_app_get_id (app)); | |
1133 | tmp = as_app_get_developer_name (app, NULL); | |
1134 | if (tmp != NULL) | |
1135 | fu_device_set_update_vendor (item->device, tmp); | |
1136 | tmp = as_app_get_name (app, NULL); | |
1137 | if (tmp != NULL) | |
1138 | fu_device_set_update_name (item->device, tmp); | |
1139 | tmp = as_app_get_comment (app, NULL); | |
1140 | if (tmp != NULL) | |
1141 | fu_device_set_update_summary (item->device, tmp); | |
1142 | tmp = as_app_get_description (app, NULL); | |
1143 | if (tmp != NULL) | |
1144 | fu_device_set_description (item->device, tmp); | |
1145 | tmp = as_app_get_url_item (app, AS_URL_KIND_HOMEPAGE); | |
1146 | if (tmp != NULL) | |
1147 | fu_device_set_update_homepage (item->device, tmp); | |
1148 | tmp = as_app_get_project_license (app); | |
1149 | if (tmp != NULL) | |
1150 | fu_device_set_update_license (item->device, tmp); | |
1151 | ||
1152 | /* add release information */ | |
1153 | tmp = as_release_get_version (rel); | |
1154 | if (tmp != NULL) | |
1155 | fu_device_set_update_version (item->device, tmp); | |
1156 | csum = as_release_get_checksum_by_target (rel, AS_CHECKSUM_TARGET_CONTAINER); | |
1157 | if (csum != NULL) { | |
1158 | fu_device_set_update_checksum (item->device, | |
1159 | as_checksum_get_value (csum)); | |
1160 | } | |
1161 | tmp = as_release_get_location_default (rel); | |
1162 | if (tmp != NULL) | |
1163 | fu_device_set_update_uri (item->device, tmp); | |
1164 | tmp = as_release_get_description (rel, NULL); | |
1165 | if (tmp != NULL) | |
1166 | fu_device_set_update_description (item->device, tmp); | |
1167 | g_ptr_array_add (updates, item); | |
1168 | } | |
1169 | ||
1170 | return updates; | |
1396 | item = fu_main_get_item_by_guid (priv, guid); | |
1397 | if (item != NULL) { | |
1398 | fwupd_result_set_device_flags (res, fu_device_get_flags (item->device)); | |
1399 | fwupd_result_set_device_id (res, fu_device_get_id (item->device)); | |
1400 | } | |
1401 | ||
1402 | /* add GUID */ | |
1403 | fwupd_result_add_guid (res, guid); | |
1404 | } | |
1405 | if (fwupd_result_get_guids(res)->len == 0) { | |
1406 | g_set_error_literal (error, | |
1407 | FWUPD_ERROR, | |
1408 | FWUPD_ERROR_INTERNAL, | |
1409 | "component has no GUIDs"); | |
1410 | return NULL; | |
1411 | } | |
1412 | ||
1413 | /* verify trust */ | |
1414 | rel = as_app_get_release_default (app); | |
1415 | if (!fu_main_get_release_trust_flags (rel, &trust_flags, error)) | |
1416 | return NULL; | |
1417 | ||
1418 | /* possibly convert the version from 0x to dotted */ | |
1419 | fu_main_vendor_quirk_release_version (app); | |
1420 | ||
1421 | /* create a result with all the metadata in */ | |
1422 | fwupd_result_set_device_description (res, as_app_get_description (app, NULL)); | |
1423 | fwupd_result_set_update_description (res, as_release_get_description (rel, NULL)); | |
1424 | fwupd_result_set_update_homepage (res, as_app_get_url_item (app, AS_URL_KIND_HOMEPAGE)); | |
1425 | fwupd_result_set_update_license (res, as_app_get_project_license (app)); | |
1426 | fwupd_result_set_update_name (res, as_app_get_name (app, NULL)); | |
1427 | fwupd_result_set_update_size (res, as_release_get_size (rel, AS_SIZE_KIND_INSTALLED)); | |
1428 | fwupd_result_set_update_summary (res, as_app_get_comment (app, NULL)); | |
1429 | fwupd_result_set_update_trust_flags (res, trust_flags); | |
1430 | fwupd_result_set_update_vendor (res, as_app_get_developer_name (app, NULL)); | |
1431 | fwupd_result_set_update_version (res, as_release_get_version (rel)); | |
1432 | return g_steal_pointer (&res); | |
1433 | } | |
1434 | ||
1435 | static GVariant * | |
1436 | fu_main_get_details_from_fd (FuMainPrivate *priv, gint fd, GError **error) | |
1437 | { | |
1438 | AsApp *app = NULL; | |
1439 | GPtrArray *apps; | |
1440 | guint i; | |
1441 | g_autoptr(AsStore) store = NULL; | |
1442 | g_autoptr(FwupdResult) res = NULL; | |
1443 | ||
1444 | store = fu_main_get_store_from_fd (priv, fd, error); | |
1445 | if (store == NULL) | |
1446 | return NULL; | |
1447 | ||
1448 | /* get all apps */ | |
1449 | apps = as_store_get_apps (store); | |
1450 | if (apps->len == 0) { | |
1451 | g_set_error_literal (error, | |
1452 | FWUPD_ERROR, | |
1453 | FWUPD_ERROR_INVALID_FILE, | |
1454 | "no components"); | |
1455 | return NULL; | |
1456 | } | |
1457 | if (apps->len > 1) { | |
1458 | /* we've got a .cab file with multiple components, | |
1459 | * so try to find the first thing that's installed */ | |
1460 | for (i = 0; i < priv->devices->len; i++) { | |
1461 | FuDeviceItem *item = g_ptr_array_index (priv->devices, i); | |
1462 | app = fu_main_store_get_app_by_guids (store, item->device); | |
1463 | if (app != NULL) | |
1464 | break; | |
1465 | } | |
1466 | } | |
1467 | ||
1468 | /* well, we've tried our best, just show the first entry */ | |
1469 | if (app == NULL) | |
1470 | app = AS_APP (g_ptr_array_index (apps, 0)); | |
1471 | ||
1472 | /* create a result with all the metadata in */ | |
1473 | res = fu_main_get_result_from_app (priv, app, error); | |
1474 | if (res == NULL) | |
1475 | return NULL; | |
1476 | return fwupd_result_to_data (res, "(a{sv})"); | |
1477 | } | |
1478 | ||
1479 | static GVariant * | |
1480 | fu_main_get_details_local_from_fd (FuMainPrivate *priv, gint fd, GError **error) | |
1481 | { | |
1482 | GPtrArray *apps; | |
1483 | GVariantBuilder builder; | |
1484 | guint i; | |
1485 | g_autoptr(AsStore) store = NULL; | |
1486 | ||
1487 | store = fu_main_get_store_from_fd (priv, fd, error); | |
1488 | if (store == NULL) | |
1489 | return NULL; | |
1490 | ||
1491 | /* get all apps */ | |
1492 | apps = as_store_get_apps (store); | |
1493 | if (apps->len == 0) { | |
1494 | g_set_error_literal (error, | |
1495 | FWUPD_ERROR, | |
1496 | FWUPD_ERROR_INVALID_FILE, | |
1497 | "no components"); | |
1498 | return NULL; | |
1499 | } | |
1500 | ||
1501 | /* create results with all the metadata in */ | |
1502 | g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY); | |
1503 | for (i = 0; i < apps->len; i++) { | |
1504 | g_autoptr(FwupdResult) res = NULL; | |
1505 | AsApp *app = g_ptr_array_index (apps, i); | |
1506 | GVariant *tmp; | |
1507 | res = fu_main_get_result_from_app (priv, app, error); | |
1508 | if (res == NULL) | |
1509 | return NULL; | |
1510 | tmp = fwupd_result_to_data (res, "{sa{sv}}"); | |
1511 | g_variant_builder_add_value (&builder, tmp); | |
1512 | } | |
1513 | return g_variant_new ("(a{sa{sv}})", &builder); | |
1171 | 1514 | } |
1172 | 1515 | |
1173 | 1516 | /** |
1398 | 1741 | } |
1399 | 1742 | |
1400 | 1743 | /* find component in metadata */ |
1401 | app = as_store_get_app_by_provide (priv->store, | |
1402 | AS_PROVIDE_KIND_FIRMWARE_FLASHED, | |
1403 | fu_device_get_guid (item->device)); | |
1744 | app = fu_main_store_get_app_by_guids (priv->store, item->device); | |
1404 | 1745 | if (app == NULL) { |
1405 | 1746 | g_dbus_method_invocation_return_error (invocation, |
1406 | 1747 | FWUPD_ERROR, |
1493 | 1834 | if (g_strcmp0 (prop_key, "allow-reinstall") == 0 && |
1494 | 1835 | g_variant_get_boolean (prop_value) == TRUE) |
1495 | 1836 | flags |= FWUPD_INSTALL_FLAG_ALLOW_REINSTALL; |
1837 | if (g_strcmp0 (prop_key, "force") == 0 && | |
1838 | g_variant_get_boolean (prop_value) == TRUE) | |
1839 | flags |= FWUPD_INSTALL_FLAG_FORCE; | |
1496 | 1840 | g_variant_unref (prop_value); |
1497 | 1841 | } |
1498 | 1842 | |
1568 | 1912 | return; |
1569 | 1913 | } |
1570 | 1914 | |
1571 | /* return 'a{sv}' */ | |
1915 | /* get a single result object from a local file */ | |
1572 | 1916 | if (g_strcmp0 (method_name, "GetDetails") == 0) { |
1573 | AsApp *app = NULL; | |
1574 | AsRelease *rel; | |
1575 | 1917 | GDBusMessage *message; |
1576 | GPtrArray *apps; | |
1577 | GPtrArray *provides; | |
1578 | 1918 | GUnixFDList *fd_list; |
1579 | GVariantBuilder builder; | |
1580 | FuDeviceItem *item; | |
1581 | FwupdDeviceFlags device_flags = 0; | |
1582 | FwupdTrustFlags trust_flags = FWUPD_TRUST_FLAG_NONE; | |
1583 | const gchar *tmp; | |
1584 | const gchar *guid = NULL; | |
1585 | 1919 | gint32 fd_handle = 0; |
1586 | 1920 | gint fd; |
1587 | guint i; | |
1588 | g_autoptr(AsStore) store = NULL; | |
1589 | g_autoptr(GBytes) blob_cab = NULL; | |
1590 | 1921 | g_autoptr(GError) error = NULL; |
1591 | g_autoptr(GInputStream) stream = NULL; | |
1592 | ||
1593 | /* check the id exists */ | |
1922 | ||
1923 | /* get parameters */ | |
1594 | 1924 | g_variant_get (parameters, "(h)", &fd_handle); |
1595 | 1925 | g_debug ("Called %s(%i)", method_name, fd_handle); |
1596 | 1926 | |
1611 | 1941 | return; |
1612 | 1942 | } |
1613 | 1943 | |
1614 | /* read the entire fd to a data blob */ | |
1615 | stream = g_unix_input_stream_new (fd, TRUE); | |
1616 | blob_cab = g_input_stream_read_bytes (stream, | |
1617 | FU_MAIN_FIRMWARE_SIZE_MAX, | |
1618 | NULL, &error); | |
1619 | if (blob_cab == NULL){ | |
1944 | /* get details about the file */ | |
1945 | val = fu_main_get_details_from_fd (priv, fd, &error); | |
1946 | if (val == NULL) { | |
1620 | 1947 | g_dbus_method_invocation_return_gerror (invocation, |
1621 | error); | |
1622 | return; | |
1623 | } | |
1624 | ||
1625 | /* load file */ | |
1626 | store = as_store_new (); | |
1627 | if (!as_store_from_bytes (store, blob_cab, NULL, &error)) { | |
1628 | g_dbus_method_invocation_return_gerror (invocation, error); | |
1629 | return; | |
1630 | } | |
1631 | ||
1632 | /* get default app */ | |
1633 | apps = as_store_get_apps (store); | |
1634 | if (apps->len == 0) { | |
1635 | g_dbus_method_invocation_return_error (invocation, | |
1636 | FWUPD_ERROR, | |
1637 | FWUPD_ERROR_INVALID_FILE, | |
1638 | "no components"); | |
1639 | return; | |
1640 | } | |
1641 | if (apps->len > 1) { | |
1642 | /* we've got a .cab file with multiple components, | |
1643 | * so try to find the first thing that's installed */ | |
1644 | for (i = 0; i < priv->devices->len; i++) { | |
1645 | item = g_ptr_array_index (priv->devices, i); | |
1646 | app = as_store_get_app_by_provide (store, | |
1647 | AS_PROVIDE_KIND_FIRMWARE_FLASHED, | |
1648 | fu_device_get_guid (item->device)); | |
1649 | if (app != NULL) | |
1650 | break; | |
1651 | } | |
1652 | } | |
1653 | ||
1654 | /* well, we've tried our best, just show the first entry */ | |
1655 | if (app == NULL) | |
1656 | app = AS_APP (g_ptr_array_index (apps, 0)); | |
1657 | ||
1658 | /* get guid */ | |
1659 | provides = as_app_get_provides (app); | |
1660 | for (i = 0; i < provides->len; i++) { | |
1661 | AsProvide *prov = AS_PROVIDE (g_ptr_array_index (provides, i)); | |
1662 | if (as_provide_get_kind (prov) == AS_PROVIDE_KIND_FIRMWARE_FLASHED) { | |
1663 | guid = as_provide_get_value (prov); | |
1664 | break; | |
1665 | } | |
1666 | } | |
1667 | if (guid == NULL) { | |
1948 | error); | |
1949 | fu_main_set_status (priv, FWUPD_STATUS_IDLE); | |
1950 | return; | |
1951 | } | |
1952 | g_dbus_method_invocation_return_value (invocation, val); | |
1953 | return; | |
1954 | } | |
1955 | ||
1956 | /* get multiple result objects from a local file */ | |
1957 | if (g_strcmp0 (method_name, "GetDetailsLocal") == 0) { | |
1958 | GDBusMessage *message; | |
1959 | GUnixFDList *fd_list; | |
1960 | gint32 fd_handle = 0; | |
1961 | gint fd; | |
1962 | g_autoptr(GError) error = NULL; | |
1963 | ||
1964 | /* get parameters */ | |
1965 | g_variant_get (parameters, "(h)", &fd_handle); | |
1966 | g_debug ("Called %s(%i)", method_name, fd_handle); | |
1967 | ||
1968 | /* get the fd */ | |
1969 | message = g_dbus_method_invocation_get_message (invocation); | |
1970 | fd_list = g_dbus_message_get_unix_fd_list (message); | |
1971 | if (fd_list == NULL || g_unix_fd_list_get_length (fd_list) != 1) { | |
1668 | 1972 | g_dbus_method_invocation_return_error (invocation, |
1669 | 1973 | FWUPD_ERROR, |
1670 | 1974 | FWUPD_ERROR_INTERNAL, |
1671 | "component has no GUID"); | |
1672 | return; | |
1673 | } | |
1674 | ||
1675 | /* verify trust */ | |
1676 | rel = as_app_get_release_default (app); | |
1677 | if (!fu_main_get_release_trust_flags (rel, &trust_flags, &error)) { | |
1678 | g_dbus_method_invocation_return_gerror (invocation, error); | |
1679 | return; | |
1680 | } | |
1681 | ||
1682 | /* possibly convert the version from 0x to dotted */ | |
1683 | fu_main_vendor_quirk_release_version (app); | |
1684 | ||
1685 | /* is a online or offline update appropriate */ | |
1686 | item = fu_main_get_item_by_guid (priv, guid); | |
1687 | if (item != NULL) | |
1688 | device_flags = fu_device_get_flags (item->device); | |
1689 | ||
1690 | /* create an array with all the metadata in */ | |
1691 | g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY); | |
1692 | g_variant_builder_add (&builder, "{sv}", | |
1693 | FWUPD_RESULT_KEY_UPDATE_VERSION, | |
1694 | g_variant_new_string (as_release_get_version (rel))); | |
1695 | g_variant_builder_add (&builder, "{sv}", | |
1696 | FWUPD_RESULT_KEY_GUID, | |
1697 | g_variant_new_string (guid)); | |
1698 | g_variant_builder_add (&builder, "{sv}", | |
1699 | FWUPD_RESULT_KEY_UPDATE_SIZE, | |
1700 | g_variant_new_uint64 (as_release_get_size (rel, AS_SIZE_KIND_INSTALLED))); | |
1701 | g_variant_builder_add (&builder, "{sv}", | |
1702 | FWUPD_RESULT_KEY_DEVICE_FLAGS, | |
1703 | g_variant_new_uint64 (device_flags)); | |
1704 | ||
1705 | /* optional properties */ | |
1706 | tmp = as_app_get_developer_name (app, NULL); | |
1707 | if (tmp != NULL) { | |
1708 | g_variant_builder_add (&builder, "{sv}", | |
1709 | FWUPD_RESULT_KEY_UPDATE_VENDOR, | |
1710 | g_variant_new_string (tmp)); | |
1711 | } | |
1712 | tmp = as_app_get_name (app, NULL); | |
1713 | if (tmp != NULL) { | |
1714 | g_variant_builder_add (&builder, "{sv}", | |
1715 | FWUPD_RESULT_KEY_UPDATE_NAME, | |
1716 | g_variant_new_string (tmp)); | |
1717 | } | |
1718 | tmp = as_app_get_comment (app, NULL); | |
1719 | if (tmp != NULL) { | |
1720 | g_variant_builder_add (&builder, "{sv}", | |
1721 | FWUPD_RESULT_KEY_UPDATE_SUMMARY, | |
1722 | g_variant_new_string (tmp)); | |
1723 | } | |
1724 | tmp = as_app_get_description (app, NULL); | |
1725 | if (tmp != NULL) { | |
1726 | g_variant_builder_add (&builder, "{sv}", | |
1727 | FWUPD_RESULT_KEY_UPDATE_DESCRIPTION, | |
1728 | g_variant_new_string (tmp)); | |
1729 | } | |
1730 | tmp = as_app_get_url_item (app, AS_URL_KIND_HOMEPAGE); | |
1731 | if (tmp != NULL) { | |
1732 | g_variant_builder_add (&builder, "{sv}", | |
1733 | FWUPD_RESULT_KEY_UPDATE_HOMEPAGE, | |
1734 | g_variant_new_string (tmp)); | |
1735 | } | |
1736 | tmp = as_app_get_project_license (app); | |
1737 | if (tmp != NULL) { | |
1738 | g_variant_builder_add (&builder, "{sv}", | |
1739 | FWUPD_RESULT_KEY_UPDATE_LICENSE, | |
1740 | g_variant_new_string (tmp)); | |
1741 | } | |
1742 | tmp = as_release_get_description (rel, NULL); | |
1743 | if (tmp != NULL) { | |
1744 | g_variant_builder_add (&builder, "{sv}", | |
1745 | FWUPD_RESULT_KEY_UPDATE_DESCRIPTION, | |
1746 | g_variant_new_string (tmp)); | |
1747 | } | |
1748 | g_variant_builder_add (&builder, "{sv}", | |
1749 | FWUPD_RESULT_KEY_UPDATE_TRUST_FLAGS, | |
1750 | g_variant_new_uint64 (trust_flags)); | |
1751 | ||
1752 | /* return whole array */ | |
1753 | val = g_variant_new ("(a{sv})", &builder); | |
1975 | "invalid handle"); | |
1976 | return; | |
1977 | } | |
1978 | fd = g_unix_fd_list_get (fd_list, fd_handle, &error); | |
1979 | if (fd < 0) { | |
1980 | g_dbus_method_invocation_return_gerror (invocation, | |
1981 | error); | |
1982 | return; | |
1983 | } | |
1984 | ||
1985 | /* get details about the file */ | |
1986 | val = fu_main_get_details_local_from_fd (priv, fd, &error); | |
1987 | if (val == NULL) { | |
1988 | g_dbus_method_invocation_return_gerror (invocation, | |
1989 | error); | |
1990 | fu_main_set_status (priv, FWUPD_STATUS_IDLE); | |
1991 | return; | |
1992 | } | |
1754 | 1993 | g_dbus_method_invocation_return_value (invocation, val); |
1755 | 1994 | return; |
1756 | 1995 | } |
1778 | 2017 | return g_variant_new_string (VERSION); |
1779 | 2018 | |
1780 | 2019 | if (g_strcmp0 (property_name, "Status") == 0) |
1781 | return g_variant_new_string (fwupd_status_to_string (priv->status)); | |
2020 | return g_variant_new_uint32 (priv->status); | |
1782 | 2021 | |
1783 | 2022 | /* return an error */ |
1784 | 2023 | g_set_error (error, |
1966 | 2205 | g_ptr_array_add (priv->devices, item); |
1967 | 2206 | |
1968 | 2207 | /* does this match anything in the AppStream data */ |
1969 | app = as_store_get_app_by_provide (priv->store, | |
1970 | AS_PROVIDE_KIND_FIRMWARE_FLASHED, | |
1971 | fu_device_get_guid (item->device)); | |
2208 | app = fu_main_store_get_app_by_guids (priv->store, item->device); | |
1972 | 2209 | if (app != NULL) { |
1973 | 2210 | const gchar *tmp; |
1974 | 2211 | tmp = as_app_get_metadata_item (app, FU_DEVICE_KEY_FWUPD_PLUGIN); |
1990 | 2227 | } |
1991 | 2228 | } |
1992 | 2229 | |
2230 | /* match the metadata at this point so clients can tell if the | |
2231 | * device is worthy */ | |
2232 | fu_main_get_updates_item_update (priv, item); | |
2233 | ||
2234 | /* notify clients */ | |
2235 | fu_main_emit_device_added (priv, item->device); | |
1993 | 2236 | fu_main_emit_changed (priv); |
1994 | 2237 | } |
1995 | 2238 | |
2018 | 2261 | return; |
2019 | 2262 | } |
2020 | 2263 | |
2264 | /* make the UI update */ | |
2265 | fu_main_emit_device_removed (priv, device); | |
2021 | 2266 | g_ptr_array_remove (priv->devices, item); |
2022 | 2267 | fu_main_emit_changed (priv); |
2023 | 2268 | } |
490 | 490 | fu_device_set_id (item->device, device_key); |
491 | 491 | fu_device_set_equivalent_id (item->device, |
492 | 492 | g_usb_device_get_platform_id (device)); |
493 | fu_device_set_guid (item->device, ch_device_get_guid (device)); | |
493 | fu_device_add_guid (item->device, ch_device_get_guid (device)); | |
494 | 494 | fu_device_add_flag (item->device, FU_DEVICE_FLAG_ALLOW_OFFLINE); |
495 | 495 | fu_device_add_flag (item->device, FU_DEVICE_FLAG_ALLOW_ONLINE); |
496 | 496 |
62 | 62 | guint16 release; |
63 | 63 | g_autofree gchar *guid = NULL; |
64 | 64 | g_autofree gchar *version = NULL; |
65 | g_autofree gchar *vid_pid = NULL; | |
65 | g_autofree gchar *devid1 = NULL; | |
66 | g_autofree gchar *devid2 = NULL; | |
66 | 67 | |
67 | 68 | /* check mode */ |
68 | 69 | platform_id = dfu_device_get_platform_id (device); |
85 | 86 | fu_device_set_version (dev, version); |
86 | 87 | } |
87 | 88 | |
88 | vid_pid = g_strdup_printf ("USB\\VID_%04X&PID_%04X", | |
89 | /* add USB\VID_0000&PID_0000 */ | |
90 | devid1 = g_strdup_printf ("USB\\VID_%04X&PID_%04X", | |
89 | 91 | dfu_device_get_runtime_vid (device), |
90 | 92 | dfu_device_get_runtime_pid (device)); |
91 | guid = as_utils_guid_from_string (vid_pid); | |
92 | g_debug ("using %s for %s", guid, vid_pid); | |
93 | fu_device_set_guid (dev, guid); | |
93 | fu_device_add_guid (dev, devid1); | |
94 | ||
95 | /* add more specific USB\VID_0000&PID_0000&REV_0000 */ | |
96 | devid2 = g_strdup_printf ("USB\\VID_%04X&PID_%04X&REV_%04X", | |
97 | dfu_device_get_runtime_vid (device), | |
98 | dfu_device_get_runtime_pid (device), | |
99 | dfu_device_get_runtime_release (device)); | |
100 | fu_device_add_guid (dev, devid2); | |
94 | 101 | } |
95 | 102 | |
96 | 103 | /** |
151 | 158 | fu_provider_dfu_device_update (provider_dfu, dev, device); |
152 | 159 | |
153 | 160 | /* open device to get display name */ |
154 | if (!dfu_device_open (device, DFU_DEVICE_OPEN_FLAG_NONE, NULL, &error)) { | |
161 | if (!dfu_device_open (device, DFU_DEVICE_OPEN_FLAG_NO_AUTO_REFRESH, | |
162 | NULL, &error)) { | |
155 | 163 | g_warning ("Failed to open DFU device: %s", error->message); |
156 | 164 | return; |
157 | 165 | } |
370 | 378 | checksum_type = fu_provider_get_checksum_type (flags); |
371 | 379 | hash = g_compute_checksum_for_bytes (checksum_type, blob_fw); |
372 | 380 | fu_device_set_checksum (dev, hash); |
373 | fu_device_set_checksum_kind (device, checksum_type); | |
381 | fu_device_set_checksum_kind (dev, checksum_type); | |
374 | 382 | fu_provider_set_status (provider, FWUPD_STATUS_IDLE); |
375 | 383 | return TRUE; |
376 | 384 | } |
70 | 70 | g_autoptr(FuDevice) device = NULL; |
71 | 71 | device = fu_device_new (); |
72 | 72 | fu_device_set_id (device, "FakeDevice"); |
73 | fu_device_set_guid (device, "00000000-0000-0000-0000-000000000000"); | |
73 | fu_device_add_guid (device, "00000000-0000-0000-0000-000000000000"); | |
74 | fu_device_set_name (device, "Integrated_Webcam(TM)"); | |
74 | 75 | fu_provider_device_add (provider, device); |
75 | 76 | return TRUE; |
76 | 77 | } |
281 | 281 | FuProviderRpiPrivate *priv = GET_PRIVATE (provider_rpi); |
282 | 282 | g_autofree gchar *fwfn = NULL; |
283 | 283 | g_autofree gchar *fwver = NULL; |
284 | g_autofree gchar *guid = NULL; | |
285 | 284 | g_autoptr(FuDevice) device = NULL; |
286 | 285 | |
287 | 286 | /* anything interesting */ |
294 | 293 | /* create fake device */ |
295 | 294 | device = fu_device_new (); |
296 | 295 | fu_device_set_id (device, "raspberry-pi"); |
297 | guid = as_utils_guid_from_string ("raspberrypi"); | |
298 | fu_device_set_guid (device, guid); | |
296 | fu_device_add_guid (device, "raspberrypi"); | |
299 | 297 | fu_device_set_name (device, "Raspberry Pi"); |
300 | 298 | fu_device_add_flag (device, FU_DEVICE_FLAG_INTERNAL); |
301 | 299 | fu_device_add_flag (device, FU_DEVICE_FLAG_ALLOW_OFFLINE); |
101 | 101 | fu_device_set_version (device, fu_rom_get_version (rom)); |
102 | 102 | } |
103 | 103 | |
104 | /* prefer the GUID from the firmware rather than the | |
105 | * hardware as the firmware may be more generic, which | |
106 | * also allows us to match the GUID when doing 'verify' | |
104 | /* Also add the GUID from the firmware as the firmware may be more | |
105 | * generic, which also allows us to match the GUID when doing 'verify' | |
107 | 106 | * on a device with a different PID to the firmware */ |
108 | if (g_strcmp0 (fu_device_get_guid (device), fu_rom_get_guid (rom)) != 0) { | |
109 | fu_device_set_guid (device, fu_rom_get_guid (rom)); | |
110 | g_debug ("changing GUID of %s from %s to %s", | |
111 | fu_device_get_id (device), | |
112 | fu_device_get_guid (device), | |
113 | fu_rom_get_guid (rom)); | |
114 | } | |
107 | fu_device_add_guid (device, fu_rom_get_guid (rom)); | |
108 | ||
115 | 109 | return TRUE; |
116 | 110 | } |
117 | 111 | |
157 | 151 | const gchar *guid; |
158 | 152 | const gchar *product; |
159 | 153 | const gchar *vendor; |
160 | g_autofree gchar *guid_new = NULL; | |
161 | 154 | g_autofree gchar *id = NULL; |
162 | 155 | g_autofree gchar *rom_fn = NULL; |
163 | 156 | g_autofree gchar *version = NULL; |
193 | 186 | version = g_strdup (split[2]); |
194 | 187 | } |
195 | 188 | |
196 | /* no GUID from the ROM, so fix up the VID:PID */ | |
197 | if (!as_utils_guid_is_valid (guid)) { | |
198 | guid_new = as_utils_guid_from_string (guid); | |
199 | g_debug ("fixing GUID %s->%s", guid, guid_new); | |
200 | } else { | |
201 | guid_new = g_strdup (guid); | |
202 | } | |
203 | ||
204 | 189 | /* did we get enough data */ |
205 | 190 | dev = fu_device_new (); |
206 | 191 | fu_device_add_flag (dev, FU_DEVICE_FLAG_INTERNAL); |
207 | 192 | fu_device_set_id (dev, id); |
208 | fu_device_set_guid (dev, guid_new); | |
193 | fu_device_add_guid (dev, guid); | |
209 | 194 | display_name = g_udev_device_get_property (device, "FWUPD_MODEL"); |
210 | 195 | if (display_name == NULL) |
211 | 196 | display_name = g_udev_device_get_property (device, "ID_MODEL_FROM_DATABASE"); |
109 | 109 | |
110 | 110 | /* get the hardware we're referencing */ |
111 | 111 | fwup_resource_iter_create (&iter); |
112 | re = fu_provider_uefi_find (iter, fu_device_get_guid (device), error); | |
112 | re = fu_provider_uefi_find (iter, fu_device_get_guid_default (device), error); | |
113 | 113 | if (re == NULL) |
114 | 114 | return FALSE; |
115 | 115 | if (fwup_clear_status (re) < 0) { |
117 | 117 | FWUPD_ERROR, |
118 | 118 | FWUPD_ERROR_INTERNAL, |
119 | 119 | "Cannot create clear UEFI status for %s", |
120 | fu_device_get_guid (device)); | |
120 | fu_device_get_guid_default (device)); | |
121 | 121 | return FALSE; |
122 | 122 | } |
123 | 123 | return TRUE; |
176 | 176 | |
177 | 177 | /* get the hardware we're referencing */ |
178 | 178 | fwup_resource_iter_create (&iter); |
179 | re = fu_provider_uefi_find (iter, fu_device_get_guid (device), error); | |
179 | re = fu_provider_uefi_find (iter, fu_device_get_guid_default (device), error); | |
180 | 180 | if (re == NULL) |
181 | 181 | return FALSE; |
182 | 182 | if (fwup_get_last_attempt_info (re, &version, &status, &when) < 0) { |
184 | 184 | FWUPD_ERROR, |
185 | 185 | FWUPD_ERROR_INTERNAL, |
186 | 186 | "Cannot get UEFI status for %s", |
187 | fu_device_get_guid (device)); | |
187 | fu_device_get_guid_default (device)); | |
188 | 188 | return FALSE; |
189 | 189 | } |
190 | 190 | version_str = g_strdup_printf ("%u", version); |
218 | 218 | |
219 | 219 | /* get the hardware we're referencing */ |
220 | 220 | fwup_resource_iter_create (&iter); |
221 | re = fu_provider_uefi_find (iter, fu_device_get_guid (device), error); | |
221 | re = fu_provider_uefi_find (iter, fu_device_get_guid_default (device), error); | |
222 | 222 | if (re == NULL) |
223 | 223 | return FALSE; |
224 | 224 | |
299 | 299 | fu_provider_uefi_coldplug (FuProvider *provider, GError **error) |
300 | 300 | { |
301 | 301 | AsVersionParseFlag parse_flags; |
302 | g_autofree gchar *display_name = NULL; | |
302 | 303 | fwup_resource *re; |
303 | 304 | gint supported; |
304 | 305 | g_autofree gchar *guid = NULL; |
323 | 324 | if (supported >= 2) { |
324 | 325 | dev = fu_device_new (); |
325 | 326 | fu_device_set_id (dev, "UEFI-dummy-dev0"); |
326 | fu_device_set_guid (dev, "2d47f29b-83a2-4f31-a2e8-63474f4d4c2e"); | |
327 | fu_device_add_guid (dev, "2d47f29b-83a2-4f31-a2e8-63474f4d4c2e"); | |
327 | 328 | fu_device_set_version (dev, "0"); |
328 | 329 | fu_device_add_flag (dev, FU_DEVICE_FLAG_ALLOW_ONLINE); |
329 | 330 | fu_device_add_flag (dev, FU_DEVICE_FLAG_LOCKED); |
339 | 340 | "Cannot create fwup iter"); |
340 | 341 | return FALSE; |
341 | 342 | } |
343 | ||
344 | /* set Display Name to the system for all capsules */ | |
345 | g_file_get_contents ("/sys/class/dmi/id/product_name", | |
346 | &display_name, NULL, NULL); | |
347 | if (display_name != NULL) | |
348 | g_strchomp (display_name); | |
342 | 349 | |
343 | 350 | /* add each device */ |
344 | 351 | guid = g_strdup ("00000000-0000-0000-0000-000000000000"); |
365 | 372 | |
366 | 373 | dev = fu_device_new (); |
367 | 374 | fu_device_set_id (dev, id); |
368 | fu_device_set_guid (dev, guid); | |
375 | fu_device_add_guid (dev, guid); | |
369 | 376 | fu_device_set_version (dev, version); |
377 | if (display_name != NULL) | |
378 | fu_device_set_name(dev, display_name); | |
370 | 379 | fwup_get_lowest_supported_fw_version (re, &version_raw); |
371 | 380 | if (version_raw != 0) { |
372 | 381 | version_lowest = as_utils_version_from_uint32 (version_raw, |
60 | 60 | FuProviderUsbPrivate *priv = GET_PRIVATE (provider_usb); |
61 | 61 | const gchar *platform_id = NULL; |
62 | 62 | guint8 idx = 0x00; |
63 | g_autofree gchar *guid = NULL; | |
63 | g_autofree gchar *devid1 = NULL; | |
64 | g_autofree gchar *devid2 = NULL; | |
64 | 65 | g_autofree gchar *product = NULL; |
65 | 66 | g_autofree gchar *version = NULL; |
66 | 67 | g_autoptr(AsProfile) profile = as_profile_new (); |
120 | 121 | } |
121 | 122 | fu_device_set_version (dev, version); |
122 | 123 | |
123 | /* get GUID, falling back to the USB VID:PID hash */ | |
124 | /* get GUID from the descriptor if set */ | |
124 | 125 | idx = g_usb_device_get_custom_index (device, |
125 | 126 | G_USB_DEVICE_CLASS_VENDOR_SPECIFIC, |
126 | 127 | 'G', 'U', NULL); |
127 | if (idx != 0x00) | |
128 | if (idx != 0x00) { | |
129 | g_autofree gchar *guid = NULL; | |
128 | 130 | guid = g_usb_device_get_string_descriptor (device, idx, NULL); |
129 | if (guid == NULL) { | |
130 | g_autofree gchar *vid_pid = NULL; | |
131 | vid_pid = g_strdup_printf ("USB\\VID_%04X&PID_%04X", | |
132 | g_usb_device_get_vid (device), | |
133 | g_usb_device_get_pid (device)); | |
134 | guid = as_utils_guid_from_string (vid_pid); | |
135 | } | |
136 | fu_device_set_guid (dev, guid); | |
131 | fu_device_add_guid (dev, guid); | |
132 | } | |
133 | ||
134 | /* also fall back to the USB VID:PID hash */ | |
135 | devid1 = g_strdup_printf ("USB\\VID_%04X&PID_%04X", | |
136 | g_usb_device_get_vid (device), | |
137 | g_usb_device_get_pid (device)); | |
138 | fu_device_add_guid (dev, devid1); | |
139 | devid2 = g_strdup_printf ("USB\\VID_%04X&PID_%04X&REV_%04X", | |
140 | g_usb_device_get_vid (device), | |
141 | g_usb_device_get_pid (device), | |
142 | g_usb_device_get_release (device)); | |
143 | fu_device_add_guid (dev, devid2); | |
137 | 144 | |
138 | 145 | /* we're done here */ |
139 | 146 | if (!g_usb_device_close (device, &error)) |
216 | 216 | } |
217 | 217 | |
218 | 218 | /* update with correct flags */ |
219 | flags = fu_device_get_flags (device); | |
219 | 220 | fu_device_set_flags (device, flags &= ~FU_DEVICE_FLAG_LOCKED); |
220 | 221 | fu_device_set_modified (device, g_get_real_time () / G_USEC_PER_SEC); |
221 | 222 | return TRUE; |
207 | 207 | g_assert_cmpint (cnt, ==, 0); |
208 | 208 | g_assert (device != NULL); |
209 | 209 | g_assert_cmpstr (fu_device_get_id (device), ==, "FakeDevice"); |
210 | g_assert_cmpstr (fu_device_get_guid (device), ==, | |
210 | g_assert_cmpstr (fu_device_get_guid_default (device), ==, | |
211 | 211 | "00000000-0000-0000-0000-000000000000"); |
212 | g_assert_cmpstr (fu_device_get_name (device), ==, | |
213 | "Integrated Webcam™"); | |
212 | 214 | |
213 | 215 | /* schedule an offline update */ |
214 | 216 | mapped_file_fn = fu_test_get_filename ("colorhug/firmware.bin"); |
313 | 315 | g_assert_cmpint (cnt, ==, 0); |
314 | 316 | g_assert (device != NULL); |
315 | 317 | g_assert_cmpstr (fu_device_get_id (device), ==, "raspberry-pi"); |
316 | g_assert_cmpstr (fu_device_get_guid (device), ==, | |
318 | g_assert_cmpstr (fu_device_get_guid_default (device), ==, | |
317 | 319 | "91dd7368-8640-5d72-a217-a505c034dd0b"); |
318 | 320 | g_assert_cmpstr (fu_device_get_version (device), ==, |
319 | 321 | "20150803"); |
368 | 370 | g_unlink (filename); |
369 | 371 | |
370 | 372 | /* add a device */ |
371 | res = fwupd_result_new (); | |
373 | res = FWUPD_RESULT (fu_device_new ()); | |
372 | 374 | fu_device_set_id (res, "self-test"); |
373 | 375 | fu_device_set_update_filename (res, "/var/lib/dave.cap"), |
374 | fu_device_set_name (res, "ColorHug"), | |
376 | fu_device_set_name (FU_DEVICE (res), "ColorHug"), | |
375 | 377 | fu_device_set_version (res, "3.0.1"), |
376 | 378 | fu_device_set_update_version (res, "3.0.2"); |
377 | 379 | ret = fu_pending_add_device (pending, res, &error); |
27 | 27 | #include <gio/gio.h> |
28 | 28 | #include <gio/gunixfdlist.h> |
29 | 29 | #include <glib/gi18n.h> |
30 | #include <glib-unix.h> | |
30 | 31 | #include <gudev/gudev.h> |
31 | 32 | #include <locale.h> |
32 | 33 | #include <stdio.h> |
46 | 47 | #define FWUPD_ERROR_INVALID_ARGS (FWUPD_ERROR_LAST+1) |
47 | 48 | |
48 | 49 | typedef struct { |
50 | GCancellable *cancellable; | |
49 | 51 | GMainLoop *loop; |
50 | 52 | GOptionContext *context; |
51 | 53 | GPtrArray *cmd_array; |
326 | 328 | static gboolean |
327 | 329 | fu_util_get_details (FuUtilPrivate *priv, gchar **values, GError **error) |
328 | 330 | { |
329 | g_autofree gchar *tmp = NULL; | |
330 | g_autoptr(FwupdResult) res = NULL; | |
331 | guint i; | |
332 | g_autoptr(GPtrArray) array = NULL; | |
331 | 333 | |
332 | 334 | /* check args */ |
333 | 335 | if (g_strv_length (values) != 1) { |
337 | 339 | "Invalid arguments: expected 'filename'"); |
338 | 340 | return FALSE; |
339 | 341 | } |
340 | res = fwupd_client_get_details (priv->client, values[0], NULL, error); | |
341 | if (res == NULL) | |
342 | return FALSE; | |
343 | tmp = fwupd_result_to_string (res); | |
344 | g_print ("%s", tmp); | |
342 | array = fwupd_client_get_details_local (priv->client, values[0], NULL, error); | |
343 | if (array == NULL) | |
344 | return FALSE; | |
345 | for (i = 0; i < array->len; i++) { | |
346 | FwupdResult *res = g_ptr_array_index (array, i); | |
347 | g_autofree gchar *tmp = NULL; | |
348 | tmp = fwupd_result_to_string (res); | |
349 | g_print ("%s", tmp); | |
350 | } | |
345 | 351 | return TRUE; |
346 | 352 | } |
347 | 353 | |
847 | 853 | g_set_error_literal (error, |
848 | 854 | FWUPD_ERROR, |
849 | 855 | FWUPD_ERROR_INVALID_ARGS, |
850 | "Invalid arguments: expected 'id'"); | |
856 | "Invalid arguments: expected 'DeviceID'"); | |
851 | 857 | return FALSE; |
852 | 858 | } |
853 | 859 | res = fwupd_client_get_results (priv->client, values[0], NULL, error); |
882 | 888 | NULL, |
883 | 889 | &error_local)) { |
884 | 890 | g_print ("%s\tFAILED: %s\n", |
885 | fwupd_result_get_guid (res), | |
891 | fwupd_result_get_guid_default (res), | |
886 | 892 | error_local->message); |
887 | 893 | continue; |
888 | 894 | } |
889 | 895 | g_print ("%s\t%s\n", |
890 | fwupd_result_get_guid (res), | |
896 | fwupd_result_get_guid_default (res), | |
891 | 897 | _("OK")); |
892 | 898 | } |
893 | 899 | return TRUE; |
943 | 949 | g_print ("%s:", title); |
944 | 950 | |
945 | 951 | /* pad */ |
946 | title_len = strlen (title); | |
952 | title_len = strlen (title) + 1; | |
947 | 953 | lines = g_strsplit (msg, "\n", -1); |
948 | 954 | for (j = 0; lines[j] != NULL; j++) { |
949 | for (i = title_len; i < 20; i++) | |
955 | for (i = title_len; i < 25; i++) | |
950 | 956 | g_print (" "); |
951 | 957 | g_print ("%s\n", lines[j]); |
952 | 958 | title_len = 0; |
978 | 984 | { |
979 | 985 | FwupdResult *res; |
980 | 986 | GPtrArray *results = NULL; |
987 | GPtrArray *guids; | |
981 | 988 | GChecksumType checksum_type; |
982 | 989 | const gchar *tmp; |
983 | guint i; | |
990 | guint i, j; | |
984 | 991 | |
985 | 992 | /* print any updates */ |
986 | 993 | results = fwupd_client_get_updates (priv->client, NULL, error); |
997 | 1004 | fu_util_print_data (_("ID"), fwupd_result_get_update_id (res)); |
998 | 1005 | |
999 | 1006 | /* TRANSLATORS: a GUID for the hardware */ |
1000 | fu_util_print_data (_("GUID"), fwupd_result_get_guid (res)); | |
1007 | guids = fwupd_result_get_guids (res); | |
1008 | for (j = 0; j < guids->len; j++) { | |
1009 | tmp = g_ptr_array_index (guids, j); | |
1010 | fu_util_print_data (_("GUID"), tmp); | |
1011 | } | |
1001 | 1012 | |
1002 | 1013 | /* TRANSLATORS: section header for firmware version */ |
1003 | fu_util_print_data (_("Version"), fwupd_result_get_update_version (res)); | |
1014 | fu_util_print_data (_("Update Version"), | |
1015 | fwupd_result_get_update_version (res)); | |
1004 | 1016 | |
1005 | 1017 | /* TRANSLATORS: section header for firmware checksum */ |
1006 | fu_util_print_data (_("Checksum"), fwupd_result_get_update_checksum (res)); | |
1018 | fu_util_print_data (_("Update Checksum"), | |
1019 | fwupd_result_get_update_checksum (res)); | |
1007 | 1020 | |
1008 | 1021 | /* TRANSLATORS: section header for firmware checksum type */ |
1009 | 1022 | if (fwupd_result_get_update_checksum (res) != NULL) { |
1010 | 1023 | checksum_type = fwupd_result_get_update_checksum_kind (res); |
1011 | 1024 | tmp = _g_checksum_type_to_string (checksum_type); |
1012 | fu_util_print_data (_("Checksum Type"), tmp); | |
1025 | fu_util_print_data (_("Update Checksum Type"), tmp); | |
1013 | 1026 | } |
1014 | 1027 | |
1015 | 1028 | /* TRANSLATORS: section header for firmware remote http:// */ |
1016 | fu_util_print_data (_("Location"), fwupd_result_get_update_uri (res)); | |
1029 | fu_util_print_data (_("Update Location"), fwupd_result_get_update_uri (res)); | |
1017 | 1030 | |
1018 | 1031 | /* convert XML -> text */ |
1019 | 1032 | tmp = fwupd_result_get_update_description (res); |
1024 | 1037 | NULL); |
1025 | 1038 | if (md != NULL) { |
1026 | 1039 | /* TRANSLATORS: section header for long firmware desc */ |
1027 | fu_util_print_data (_("Description"), md); | |
1040 | fu_util_print_data (_("Update Description"), md); | |
1028 | 1041 | } |
1029 | 1042 | } |
1030 | 1043 | } |
1031 | 1044 | |
1045 | return TRUE; | |
1046 | } | |
1047 | ||
1048 | /** | |
1049 | * fu_util_cancelled_cb: | |
1050 | **/ | |
1051 | static void | |
1052 | fu_util_cancelled_cb (GCancellable *cancellable, gpointer user_data) | |
1053 | { | |
1054 | FuUtilPrivate *priv = (FuUtilPrivate *) user_data; | |
1055 | /* TRANSLATORS: this is when a device ctrl+c's a watch */ | |
1056 | g_print ("%s\n", _("Cancelled")); | |
1057 | g_main_loop_quit (priv->loop); | |
1058 | } | |
1059 | ||
1060 | /** | |
1061 | * fu_util_device_added_cb: | |
1062 | **/ | |
1063 | static void | |
1064 | fu_util_device_added_cb (FwupdClient *client, | |
1065 | FwupdResult *device, | |
1066 | gpointer user_data) | |
1067 | { | |
1068 | g_autofree gchar *tmp = fwupd_result_to_string (device); | |
1069 | /* TRANSLATORS: this is when a device is hotplugged */ | |
1070 | g_print ("%s\n%s", _("Device added:"), tmp); | |
1071 | } | |
1072 | ||
1073 | /** | |
1074 | * fu_util_device_removed_cb: | |
1075 | **/ | |
1076 | static void | |
1077 | fu_util_device_removed_cb (FwupdClient *client, | |
1078 | FwupdResult *device, | |
1079 | gpointer user_data) | |
1080 | { | |
1081 | g_autofree gchar *tmp = fwupd_result_to_string (device); | |
1082 | /* TRANSLATORS: this is when a device is hotplugged */ | |
1083 | g_print ("%s\n%s", _("Device removed:"), tmp); | |
1084 | } | |
1085 | ||
1086 | /** | |
1087 | * fu_util_device_changed_cb: | |
1088 | **/ | |
1089 | static void | |
1090 | fu_util_device_changed_cb (FwupdClient *client, | |
1091 | FwupdResult *device, | |
1092 | gpointer user_data) | |
1093 | { | |
1094 | g_autofree gchar *tmp = fwupd_result_to_string (device); | |
1095 | /* TRANSLATORS: this is when a device has been updated */ | |
1096 | g_print ("%s\n%s", _("Device changed:"), tmp); | |
1097 | } | |
1098 | ||
1099 | /** | |
1100 | * fu_util_changed_cb: | |
1101 | **/ | |
1102 | static void | |
1103 | fu_util_changed_cb (FwupdClient *client, gpointer user_data) | |
1104 | { | |
1105 | /* TRANSLATORS: this is when the daemon state changes */ | |
1106 | g_print ("%s\n", _("Changed")); | |
1107 | } | |
1108 | ||
1109 | /** | |
1110 | * fu_util_monitor: | |
1111 | **/ | |
1112 | static gboolean | |
1113 | fu_util_monitor (FuUtilPrivate *priv, gchar **values, GError **error) | |
1114 | { | |
1115 | g_autoptr(FwupdClient) client = NULL; | |
1116 | ||
1117 | /* get all the DFU devices */ | |
1118 | client = fwupd_client_new (); | |
1119 | if (!fwupd_client_connect (client, priv->cancellable, error)) | |
1120 | return FALSE; | |
1121 | ||
1122 | /* watch for any hotplugged device */ | |
1123 | g_signal_connect (client, "changed", | |
1124 | G_CALLBACK (fu_util_changed_cb), priv); | |
1125 | g_signal_connect (client, "device-added", | |
1126 | G_CALLBACK (fu_util_device_added_cb), priv); | |
1127 | g_signal_connect (client, "device-removed", | |
1128 | G_CALLBACK (fu_util_device_removed_cb), priv); | |
1129 | g_signal_connect (client, "device-changed", | |
1130 | G_CALLBACK (fu_util_device_changed_cb), priv); | |
1131 | g_signal_connect (priv->cancellable, "cancelled", | |
1132 | G_CALLBACK (fu_util_cancelled_cb), priv); | |
1133 | g_main_loop_run (priv->loop); | |
1032 | 1134 | return TRUE; |
1033 | 1135 | } |
1034 | 1136 | |
1090 | 1192 | } |
1091 | 1193 | |
1092 | 1194 | /** |
1195 | * fu_util_sigint_cb: | |
1196 | **/ | |
1197 | static gboolean | |
1198 | fu_util_sigint_cb (gpointer user_data) | |
1199 | { | |
1200 | FuUtilPrivate *priv = (FuUtilPrivate *) user_data; | |
1201 | g_debug ("Handling SIGINT"); | |
1202 | g_cancellable_cancel (priv->cancellable); | |
1203 | return FALSE; | |
1204 | } | |
1205 | ||
1206 | /** | |
1093 | 1207 | * main: |
1094 | 1208 | **/ |
1095 | 1209 | int |
1096 | 1210 | main (int argc, char *argv[]) |
1097 | 1211 | { |
1098 | 1212 | FuUtilPrivate *priv; |
1213 | gboolean force = FALSE; | |
1099 | 1214 | gboolean allow_older = FALSE; |
1100 | 1215 | gboolean allow_reinstall = FALSE; |
1101 | 1216 | gboolean offline = FALSE; |
1117 | 1232 | { "allow-older", '\0', 0, G_OPTION_ARG_NONE, &allow_older, |
1118 | 1233 | /* TRANSLATORS: command line option */ |
1119 | 1234 | _("Allow downgrading firmware versions"), NULL }, |
1235 | { "force", '\0', 0, G_OPTION_ARG_NONE, &force, | |
1236 | /* TRANSLATORS: command line option */ | |
1237 | _("Override provider warning"), NULL }, | |
1120 | 1238 | { NULL} |
1121 | 1239 | }; |
1122 | 1240 | |
1213 | 1331 | /* TRANSLATORS: command description */ |
1214 | 1332 | _("Update the stored metadata with current ROM contents"), |
1215 | 1333 | fu_util_verify_update); |
1334 | fu_util_add (priv->cmd_array, | |
1335 | "monitor", | |
1336 | NULL, | |
1337 | /* TRANSLATORS: command description */ | |
1338 | _("Monitor the daemon for events"), | |
1339 | fu_util_monitor); | |
1340 | ||
1341 | /* do stuff on ctrl+c */ | |
1342 | priv->cancellable = g_cancellable_new (); | |
1343 | g_unix_signal_add_full (G_PRIORITY_DEFAULT, | |
1344 | SIGINT, fu_util_sigint_cb, | |
1345 | priv, NULL); | |
1216 | 1346 | |
1217 | 1347 | /* sort by command name */ |
1218 | 1348 | g_ptr_array_sort (priv->cmd_array, |
1249 | 1379 | priv->flags |= FWUPD_INSTALL_FLAG_ALLOW_REINSTALL; |
1250 | 1380 | if (allow_older) |
1251 | 1381 | priv->flags |= FWUPD_INSTALL_FLAG_ALLOW_OLDER; |
1382 | if (force) | |
1383 | priv->flags |= FWUPD_INSTALL_FLAG_FORCE; | |
1252 | 1384 | |
1253 | 1385 | /* connect to the daemon */ |
1254 | 1386 | priv->client = fwupd_client_new (); |
1277 | 1409 | if (priv->client != NULL) |
1278 | 1410 | g_object_unref (priv->client); |
1279 | 1411 | g_main_loop_unref (priv->loop); |
1412 | g_object_unref (priv->cancellable); | |
1280 | 1413 | g_option_context_free (priv->context); |
1281 | 1414 | g_free (priv); |
1282 | 1415 | } |
1283 | 1416 | return retval; |
1284 | 1417 | } |
1285 |
100 | 100 | </method> |
101 | 101 | |
102 | 102 | <!--***********************************************************--> |
103 | <method name='GetDetailsLocal'> | |
104 | <doc:doc> | |
105 | <doc:description> | |
106 | <doc:para> | |
107 | Gets details about a local firmware file. | |
108 | </doc:para> | |
109 | </doc:description> | |
110 | </doc:doc> | |
111 | <arg type='h' name='handle' direction='in'> | |
112 | <doc:doc> | |
113 | <doc:summary> | |
114 | <doc:para> | |
115 | An index into the array of file descriptors that may have | |
116 | been sent with the DBus message. | |
117 | </doc:para> | |
118 | </doc:summary> | |
119 | </doc:doc> | |
120 | </arg> | |
121 | <arg type='a{sa{sv}}' name='results' direction='out'> | |
122 | <doc:doc> | |
123 | <doc:summary> | |
124 | <doc:para>An array of results, with any properties set on each.</doc:para> | |
125 | </doc:summary> | |
126 | </doc:doc> | |
127 | </arg> | |
128 | </method> | |
129 | ||
130 | <!--***********************************************************--> | |
103 | 131 | <method name='Install'> |
104 | 132 | <doc:doc> |
105 | 133 | <doc:description> |
266 | 294 | </doc:doc> |
267 | 295 | </signal> |
268 | 296 | |
297 | <!--***********************************************************--> | |
298 | <signal name='DeviceAdded'> | |
299 | <arg type='sa{sv}' name='device' direction='out'> | |
300 | <doc:doc> | |
301 | <doc:summary> | |
302 | <doc:para>A device structure.</doc:para> | |
303 | </doc:summary> | |
304 | </doc:doc> | |
305 | </arg> | |
306 | <doc:doc> | |
307 | <doc:description> | |
308 | <doc:para> | |
309 | A device has been added. | |
310 | </doc:para> | |
311 | </doc:description> | |
312 | </doc:doc> | |
313 | </signal> | |
314 | ||
315 | <!--***********************************************************--> | |
316 | <signal name='DeviceRemoved'> | |
317 | <arg type='sa{sv}' name='device' direction='out'> | |
318 | <doc:doc> | |
319 | <doc:summary> | |
320 | <doc:para>A device structure.</doc:para> | |
321 | </doc:summary> | |
322 | </doc:doc> | |
323 | </arg> | |
324 | <doc:doc> | |
325 | <doc:description> | |
326 | <doc:para> | |
327 | A device has been removed. | |
328 | </doc:para> | |
329 | </doc:description> | |
330 | </doc:doc> | |
331 | </signal> | |
332 | ||
333 | <!--***********************************************************--> | |
334 | <signal name='DeviceChanged'> | |
335 | <arg type='sa{sv}' name='device' direction='out'> | |
336 | <doc:doc> | |
337 | <doc:summary> | |
338 | <doc:para>A device structure.</doc:para> | |
339 | </doc:summary> | |
340 | </doc:doc> | |
341 | </arg> | |
342 | <doc:doc> | |
343 | <doc:description> | |
344 | <doc:para> | |
345 | A device has been changed. | |
346 | </doc:para> | |
347 | </doc:description> | |
348 | </doc:doc> | |
349 | </signal> | |
350 | ||
269 | 351 | </interface> |
270 | 352 | </node> |
49 | 49 | gboolean ret; |
50 | 50 | gsize actual_len = 0; |
51 | 51 | guint8 data[32]; |
52 | guint i; | |
53 | 52 | g_autofree gchar *version = NULL; |
54 | 53 | g_autoptr(GUsbContext) usb_ctx = NULL; |
55 | 54 | g_autoptr(GUsbDevice) usb_device = NULL; |
149 | 148 | GError **error) |
150 | 149 | { |
151 | 150 | const gchar *platform_id; |
152 | const gchar *vendor_driver; | |
153 | 151 | g_autoptr(GUsbContext) usb_ctx = NULL; |
154 | 152 | g_autoptr(GUsbDevice) usb_device = NULL; |
155 | 153 | g_autoptr(GUsbDevice) usb_devnew = NULL; |