diff -Nru fwupd-1.7.4/contrib/build-openbmc.sh fwupd-1.7.5/contrib/build-openbmc.sh --- fwupd-1.7.4/contrib/build-openbmc.sh 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/contrib/build-openbmc.sh 2022-02-07 16:24:38.000000000 +0000 @@ -13,7 +13,6 @@ -Dhsi=false \ -Dintrospection=false \ -Dlibarchive=false \ - -Dlogind=false \ -Dman=false \ -Dmetainfo=false \ -Doffline=false \ @@ -38,7 +37,7 @@ -Dplugin_thunderbolt=false \ -Dplugin_tpm=false \ -Dplugin_uefi_capsule=false \ - -Dplugin_upower=false \ + -Dplugin_uf2=false \ -Dplugin_upower=false \ -Dpolkit=false \ -Dsqlite=false \ diff -Nru fwupd-1.7.4/contrib/ci/dependencies.xml fwupd-1.7.5/contrib/ci/dependencies.xml --- fwupd-1.7.4/contrib/ci/dependencies.xml 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/contrib/ci/dependencies.xml 2022-02-07 16:24:38.000000000 +0000 @@ -609,6 +609,10 @@ + + + + diff -Nru fwupd-1.7.4/contrib/ci/Dockerfile-fedora.in fwupd-1.7.5/contrib/ci/Dockerfile-fedora.in --- fwupd-1.7.4/contrib/ci/Dockerfile-fedora.in 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/contrib/ci/Dockerfile-fedora.in 2022-02-07 16:24:38.000000000 +0000 @@ -1,4 +1,4 @@ -FROM fedora:34 +FROM fedora:35 %%%OS%%% ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en diff -Nru fwupd-1.7.4/contrib/ci/ubuntu.sh fwupd-1.7.5/contrib/ci/ubuntu.sh --- fwupd-1.7.4/contrib/ci/ubuntu.sh 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/contrib/ci/ubuntu.sh 2022-02-07 16:24:38.000000000 +0000 @@ -19,9 +19,8 @@ root=$(pwd) rm -rf ${root}/build -mkdir -p ${root}/build -chown nobody build ${root}/subprojects -sudo -u nobody meson build -Dman=false -Ddocs=docgen -Dgusb:tests=false -Dplugin_platform_integrity=true --prefix=${root}/dist +chown -R nobody ${root} +sudo -u nobody meson ${root}/build -Dman=false -Ddocs=docgen -Dgusb:tests=false -Dplugin_platform_integrity=true --prefix=${root}/dist #build with clang sudo -u nobody ninja -C ${root}/build test -v diff -Nru fwupd-1.7.4/contrib/debian/control.in fwupd-1.7.5/contrib/debian/control.in --- fwupd-1.7.4/contrib/debian/control.in 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/contrib/debian/control.in 2022-02-07 16:24:38.000000000 +0000 @@ -54,7 +54,8 @@ secureboot-db, udisks2, fwupd-unsigned, - fwupd-signed + fwupd-signed, + jq Suggests: gir1.2-fwupd-2.0 Provides: fwupdate Conflicts: fwupdate-amd64-signed, diff -Nru fwupd-1.7.4/contrib/debian/rules fwupd-1.7.5/contrib/debian/rules --- fwupd-1.7.4/contrib/debian/rules 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/contrib/debian/rules 2022-02-07 16:24:38.000000000 +0000 @@ -49,7 +49,7 @@ CONFARGS += -Dplugin_logitech_bulkcontroller=false endif -CONFARGS += -Dplugin_dummy=true -Dplugin_powerd=false -Ddocs=gtkdoc -Dsupported_build=true +CONFARGS += -Dplugin_dummy=true -Dplugin_powerd=false -Ddocs=gtkdoc -Dsupported_build=true -Dplugin_modem_manager=true %: dh $@ --with gir diff -Nru fwupd-1.7.4/contrib/firmware_packager/install_dell_bios_exe.py fwupd-1.7.5/contrib/firmware_packager/install_dell_bios_exe.py --- fwupd-1.7.4/contrib/firmware_packager/install_dell_bios_exe.py 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/contrib/firmware_packager/install_dell_bios_exe.py 2022-02-07 16:24:38.000000000 +0000 @@ -100,7 +100,6 @@ if __name__ == "__main__": ARGS = parse_args() CLIENT = Fwupd.Client() - CLIENT.connect() check_exists(ARGS.exe) directory = tempfile.mkdtemp() guid, deviceid, version = find_uefi_device(CLIENT, ARGS.deviceid) diff -Nru fwupd-1.7.4/contrib/firmware_packager/simple_client.py fwupd-1.7.5/contrib/firmware_packager/simple_client.py --- fwupd-1.7.4/contrib/firmware_packager/simple_client.py 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/contrib/firmware_packager/simple_client.py 2022-02-07 16:24:38.000000000 +0000 @@ -147,7 +147,6 @@ if __name__ == "__main__": ARGS = parse_args() CLIENT = Fwupd.Client() - CLIENT.connect() if ARGS.command == "get-devices": get_devices(CLIENT) diff -Nru fwupd-1.7.4/contrib/freebsd/Makefile fwupd-1.7.5/contrib/freebsd/Makefile --- fwupd-1.7.4/contrib/freebsd/Makefile 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/contrib/freebsd/Makefile 2022-02-07 16:24:38.000000000 +0000 @@ -52,6 +52,8 @@ -Dplugin_realtek_mst=false \ -Dplugin_thunderbolt=false \ -Dplugin_tpm=false \ + -Dplugin_bcm57xx=false \ + -Dplugin_ep963x=false \ -Dpolkit=false \ -Dsystemd=false \ -Doffline=false \ diff -Nru fwupd-1.7.4/contrib/fwupd.spec.in fwupd-1.7.5/contrib/fwupd.spec.in --- fwupd-1.7.4/contrib/fwupd.spec.in 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/contrib/fwupd.spec.in 2022-02-07 16:24:38.000000000 +0000 @@ -137,6 +137,7 @@ # optional, but a really good idea Recommends: udisks2 Recommends: bluez +Recommends: jq %if 0%{?have_modem_manager} Recommends: %{name}-plugin-modem-manager diff -Nru fwupd-1.7.4/contrib/generate-version-script.py fwupd-1.7.5/contrib/generate-version-script.py --- fwupd-1.7.4/contrib/generate-version-script.py 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/contrib/generate-version-script.py 2022-02-07 16:24:38.000000000 +0000 @@ -9,12 +9,14 @@ import argparse import xml.etree.ElementTree as ET -from pkg_resources import parse_version - XMLNS = "{http://www.gtk.org/introspection/core/1.0}" XMLNS_C = "{http://www.gtk.org/introspection/c/1.0}" +def parse_version(ver): + return tuple(map(int, ver.split("."))) + + def usage(return_code): """print usage and exit with the supplied return code""" if return_code == 0: diff -Nru fwupd-1.7.4/data/bash-completion/fwupdmgr fwupd-1.7.5/data/bash-completion/fwupdmgr --- fwupd-1.7.4/data/bash-completion/fwupdmgr 1970-01-01 00:00:00.000000000 +0000 +++ fwupd-1.7.5/data/bash-completion/fwupdmgr 2022-02-07 16:24:38.000000000 +0000 @@ -0,0 +1,206 @@ +_fwupdmgr_cmd_list=( + 'activate' + 'block-firmware' + 'clear-results' + 'disable-remote' + 'device-test' + 'downgrade' + 'download' + 'enable-remote' + 'get-approved-firmware' + 'get-blocked-firmware' + 'get-details' + 'get-devices' + 'get-history' + 'get-releases' + 'get-remotes' + 'get-results' + 'get-topology' + 'get-updates' + 'get-upgrades' + 'get-plugins' + 'install' + 'modify-config' + 'modify-remote' + 'reinstall' + 'refresh' + 'report-history' + 'security' + 'set-approved-firmware' + 'switch-branch' + 'sync-bkc' + 'unlock' + 'unblock-firmware' + 'update' + 'upgrade' + 'verify' + 'verify-update' + '--version' +) + +_fwupdmgr_opts=( + '--verbose' + '--offline' + '--allow-reinstall' + '--allow-older' + '--allow-branch-switch' + '--force' + '--assume-yes' + '--no-history' + '--no-unreported-check' + '--no-metadata-check' + '--no-reboot-check' + '--no-safety-check' + '--no-remote-check' + '--show-all' + '--sign' + '--filter' + '--disable-ssl-strict' + '--ipfs' + '--json' +) + +_show_filters() +{ + local flags + flags="$(command fwupdtool get-device-flags 2>/dev/null)" + COMPREPLY+=( $(compgen -W "${flags}" -- "$cur") ) +} + +_show_modifiers() +{ + COMPREPLY+=( $(compgen -W '${_fwupdmgr_opts[@]}' -- "$cur") ) +} + +_show_device_ids() +{ + if ! command -v jq &> /dev/null; then + return 0 + fi + local description + description="$(command fwupdmgr get-devices --json 2>/dev/null | jq '.Devices | .[] | .DeviceId')" + COMPREPLY+=( $(compgen -W "${description}" -- "$cur") ) +} + +_show_remotes() +{ + local remotes + remotes="$(command fwupdmgr get-remotes | command awk '/Remote ID/ { print $4 }')" + COMPREPLY+=( $(compgen -W "${remotes}" -- "$cur") ) +} + +_fwupdmgr() +{ + local cur prev command + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + command=${COMP_WORDS[1]} + + case $prev in + --filter) + _show_filters + return 0 + ;; + esac + + case $command in + activate|clear-results|downgrade|get-releases|get-results|unlock|verify|verify-update|get-updates|switch-branch|update|upgrade) + if [[ "$prev" = "$command" ]]; then + _show_device_ids + else + _show_modifiers + fi + ;; + get-details) + #browse for file + if [[ "$prev" = "$command" ]]; then + _filedir + #modifiers + else + _show_modifiers + fi + ;; + device-test) + #browse for files + if [[ "$prev" = "$command" ]]; then + _filedir + #modifiers + else + _show_modifiers + fi + ;; + install) + #find files + if [[ "$prev" = "$command" ]]; then + _filedir + #device ID or modifiers + elif [[ "$prev" = "${COMP_WORDS[2]}" ]]; then + _show_device_ids + _show_modifiers + #modifiers + else + _show_modifiers + fi + ;; + modify-remote) + #find remotes + if [[ "$prev" = "$command" ]]; then + _show_remotes + #add key + elif [[ "$prev" = "${COMP_WORDS[2]}" ]]; then + local keys + keys="$(command fwupdmgr get-remotes | command awk -v pattern="Remote ID:.*${prev}$" '$0~pattern{show=1; next}/Remote/{show=0}{gsub(/:.*/,"")}show')" + COMPREPLY+=( $(compgen -W "${keys}" -- "$cur") ) + #modifiers + else + _show_modifiers + fi + ;; + enable-remote) + #find remotes + if [[ "$prev" = "$command" ]]; then + _show_remotes + #modifiers + else + _show_modifiers + fi + ;; + disable-remote) + #find remotes + if [[ "$prev" = "$command" ]]; then + _show_remotes + #modifiers + else + _show_modifiers + fi + ;; + refresh) + #find first file + if [[ "$prev" = "$command" ]]; then + _filedir + #find second file + elif [[ "$prev" = "${COMP_WORDS[2]}" ]]; then + _filedir + #find remote ID + elif [[ "$prev" = "${COMP_WORDS[3]}" ]]; then + _show_remotes + else + _show_modifiers + fi + ;; + *) + #find first command + if [[ ${COMP_CWORD} = 1 ]]; then + COMPREPLY=( $(compgen -W '${_fwupdmgr_cmd_list[@]}' -- "$cur") ) + #modifiers for all commands + else + _show_modifiers + fi + ;; + esac + + return 0 +} + +complete -F _fwupdmgr fwupdmgr diff -Nru fwupd-1.7.4/data/bash-completion/fwupdmgr.in fwupd-1.7.5/data/bash-completion/fwupdmgr.in --- fwupd-1.7.4/data/bash-completion/fwupdmgr.in 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/data/bash-completion/fwupdmgr.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,208 +0,0 @@ -_fwupdmgr_cmd_list=( - 'activate' - 'block-firmware' - 'clear-history' - 'clear-offline' - 'clear-results' - 'disable-remote' - 'device-test' - 'downgrade' - 'download' - 'enable-remote' - 'get-approved-firmware' - 'get-blocked-firmware' - 'get-details' - 'get-devices' - 'get-history' - 'get-releases' - 'get-remotes' - 'get-results' - 'get-topology' - 'get-updates' - 'get-upgrades' - 'get-plugins' - 'install' - 'modify-config' - 'modify-remote' - 'reinstall' - 'refresh' - 'report-history' - 'security' - 'set-approved-firmware' - 'switch-branch' - 'sync-bkc' - 'unlock' - 'unblock-firmware' - 'update' - 'upgrade' - 'verify' - 'verify-update' - '--version' -) - -_fwupdmgr_opts=( - '--verbose' - '--offline' - '--allow-reinstall' - '--allow-older' - '--allow-branch-switch' - '--force' - '--assume-yes' - '--no-history' - '--no-unreported-check' - '--no-metadata-check' - '--no-reboot-check' - '--no-safety-check' - '--no-remote-check' - '--show-all' - '--sign' - '--filter' - '--disable-ssl-strict' - '--ipfs' - '--json' -) - -_show_filters() -{ - local flags - flags="$(command @libexecdir@/fwupdtool get-device-flags 2>/dev/null)" - COMPREPLY+=( $(compgen -W "${flags}" -- "$cur") ) -} - -_show_modifiers() -{ - COMPREPLY+=( $(compgen -W '${_fwupdmgr_opts[@]}' -- "$cur") ) -} - -_show_device_ids() -{ - local description - OLDIFS=$IFS - IFS=$'\n' - description="$(command fwupdagent get-devices 2>/dev/null | sed -e 's,"Name" :,,; s,",,g; s,\,,,g; s,[[:space:]]\+,,' | command awk '!/DeviceId/ { line = $0 }; /DeviceId/ { print $3 " { "line" }"}')" - COMPREPLY+=( $(compgen -W "${description}" -- "$cur") ) - IFS=$OLDIFS -} - -_show_remotes() -{ - local remotes - remotes="$(command fwupdmgr get-remotes | command awk '/Remote ID/ { print $4 }')" - COMPREPLY+=( $(compgen -W "${remotes}" -- "$cur") ) -} - -_fwupdmgr() -{ - local cur prev command - COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} - command=${COMP_WORDS[1]} - - case $prev in - --filter) - _show_filters - return 0 - ;; - esac - - case $command in - activate|clear-results|downgrade|get-releases|get-results|unlock|verify|verify-update|get-updates|switch-branch) - if [[ "$prev" = "$command" ]]; then - _show_device_ids - else - _show_modifiers - fi - ;; - get-details) - #browse for file - if [[ "$prev" = "$command" ]]; then - _filedir - #modifiers - else - _show_modifiers - fi - ;; - device-test) - #browse for files - if [[ "$prev" = "$command" ]]; then - _filedir - #modifiers - else - _show_modifiers - fi - ;; - install) - #find files - if [[ "$prev" = "$command" ]]; then - _filedir - #device ID or modifiers - elif [[ "$prev" = "${COMP_WORDS[2]}" ]]; then - _show_device_ids - _show_modifiers - #modifiers - else - _show_modifiers - fi - ;; - modify-remote) - #find remotes - if [[ "$prev" = "$command" ]]; then - _show_remotes - #add key - elif [[ "$prev" = "${COMP_WORDS[2]}" ]]; then - local keys - keys="$(command fwupdmgr get-remotes | command awk -v pattern="Remote ID:.*${prev}$" '$0~pattern{show=1; next}/Remote/{show=0}{gsub(/:.*/,"")}show')" - COMPREPLY+=( $(compgen -W "${keys}" -- "$cur") ) - #modifiers - else - _show_modifiers - fi - ;; - enable-remote) - #find remotes - if [[ "$prev" = "$command" ]]; then - _show_remotes - #modifiers - else - _show_modifiers - fi - ;; - disable-remote) - #find remotes - if [[ "$prev" = "$command" ]]; then - _show_remotes - #modifiers - else - _show_modifiers - fi - ;; - refresh) - #find first file - if [[ "$prev" = "$command" ]]; then - _filedir - #find second file - elif [[ "$prev" = "${COMP_WORDS[2]}" ]]; then - _filedir - #find remote ID - elif [[ "$prev" = "${COMP_WORDS[3]}" ]]; then - _show_remotes - else - _show_modifiers - fi - ;; - *) - #find first command - if [[ ${COMP_CWORD} = 1 ]]; then - COMPREPLY=( $(compgen -W '${_fwupdmgr_cmd_list[@]}' -- "$cur") ) - #modifiers for all commands - else - _show_modifiers - fi - ;; - esac - - return 0 -} - -complete -F _fwupdmgr fwupdmgr diff -Nru fwupd-1.7.4/data/bash-completion/fwupdtool fwupd-1.7.5/data/bash-completion/fwupdtool --- fwupd-1.7.4/data/bash-completion/fwupdtool 1970-01-01 00:00:00.000000000 +0000 +++ fwupd-1.7.5/data/bash-completion/fwupdtool 2022-02-07 16:24:38.000000000 +0000 @@ -0,0 +1,191 @@ +_fwupdtool_cmd_list=( + 'activate' + 'build-firmware' + 'clear-history' + 'esp-list' + 'esp-mount' + 'esp-unmount' + 'firmware-build' + 'firmware-convert' + 'firmware-export' + 'firmware-extract' + 'firmware-parse' + 'firmware-sign' + 'firmware-patch' + 'get-updates' + 'get-upgrades' + 'get-details' + 'get-firmware-types' + 'get-device-flags' + 'get-devices' + 'get-history' + 'get-plugins' + 'get-remotes' + 'get-topology' + 'hwids' + 'update' + 'upgrade' + 'install' + 'install-blob' + 'monitor' + 'reinstall' + 'security' + 'switch-branch' + 'self-sign' + 'smbios-dump' + 'attach' + 'detach' + 'firmware-dump' + 'refresh' + 'verify-update' + 'watch' + 'unbind-driver' + 'bind-driver' + 'export-hwids' +) + +_fwupdtool_opts=( + '--verbose' + '--enable-json-state' + '--allow-reinstall' + '--allow-older' + '--force' + '--show-all' + '--plugins' + '--prepare' + '--cleanup' + '--filter' + '--method' + '--disable-ssl-strict' + '--no-safety-check' + '--ignore-checksum' + '--ignore-vid-pid' +) + +_show_filters() +{ + local flags + flags="$(command fwupdtool get-device-flags 2>/dev/null)" + COMPREPLY+=( $(compgen -W "${flags}" -- "$cur") ) +} + +_show_firmware_types() +{ + local firmware_types + firmware_types="$(command fwupdtool get-firmware-types 2>/dev/null)" + COMPREPLY+=( $(compgen -W "${firmware_types}" -- "$cur") ) +} + + +_show_plugins() +{ + if ! command -v jq &> /dev/null; then + return 0 + fi + local plugins + plugins="$(command fwupdtool get-plugins --json 2>/dev/null | jq '.Plugins | .[] | .Name')" + COMPREPLY+=( $(compgen -W "${plugins}" -- "$cur") ) +} + +_show_modifiers() +{ + COMPREPLY+=( $(compgen -W '${_fwupdtool_opts[@]}' -- "$cur") ) +} + +_fwupdtool() +{ + local cur prev command + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + command=${COMP_WORDS[1]} + + case $prev in + --plugins) + _show_plugins + return 0 + ;; + --filter) + _show_filters + return 0 + ;; + esac + + case $command in + get-details|install|install-blob|firmware-dump) + #find files + if [[ "$prev" = "$command" ]]; then + _filedir + #modifiers + else + _show_modifiers + fi + ;; + attach|detach|activate|verify-update|reinstall|get-updates) + if [[ "$prev" = "$command" ]]; then + _show_device_ids + #modifiers + else + _show_modifiers + fi + ;; + build-firmware) + #file in + if [[ "$prev" = "$command" ]]; then + _filedir + #file out + elif [[ "$prev" = "${COMP_WORDS[2]}" ]]; then + _filedir + #script + elif [[ "$prev" = "${COMP_WORDS[3]}" ]]; then + _filedir + #output + elif [[ "$prev" = "${COMP_WORDS[4]}" ]]; then + _filedir + else + _show_modifiers + fi + ;; + firmware-parse|firmware-patch) + #find files + if [[ "$prev" = "$command" ]]; then + _filedir + #firmware_type + elif [[ "$prev" = "${COMP_WORDS[2]}" ]]; then + _show_firmware_types + else + _show_modifiers + fi + ;; + firmware-convert) + #file in + if [[ "$prev" = "$command" ]]; then + _filedir + #file out + elif [[ "$prev" = "${COMP_WORDS[2]}" ]]; then + _filedir + #firmware_type in + elif [[ "$prev" = "${COMP_WORDS[3]}" ]]; then + _show_firmware_types + #firmware_type out + elif [[ "$prev" = "${COMP_WORDS[4]}" ]]; then + _show_firmware_types + else + _show_modifiers + fi + ;; + *) + #find first command + if [[ ${COMP_CWORD} = 1 ]]; then + COMPREPLY=( $(compgen -W '${_fwupdtool_cmd_list[@]}' -- "$cur") ) + #modifiers for all commands + else + _show_modifiers + fi + ;; + esac + + return 0 +} + +complete -F _fwupdtool fwupdtool diff -Nru fwupd-1.7.4/data/bash-completion/fwupdtool.in fwupd-1.7.5/data/bash-completion/fwupdtool.in --- fwupd-1.7.4/data/bash-completion/fwupdtool.in 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/data/bash-completion/fwupdtool.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,187 +0,0 @@ -_fwupdtool_cmd_list=( - 'activate' - 'build-firmware' - 'esp-list' - 'esp-mount' - 'esp-unmount' - 'firmware-build' - 'firmware-convert' - 'firmware-export' - 'firmware-extract' - 'firmware-parse' - 'firmware-sign' - 'firmware-patch' - 'get-updates' - 'get-upgrades' - 'get-details' - 'get-firmware-types' - 'get-device-flags' - 'get-devices' - 'get-history' - 'get-plugins' - 'get-remotes' - 'get-topology' - 'hwids' - 'update' - 'upgrade' - 'install' - 'install-blob' - 'monitor' - 'reinstall' - 'security' - 'switch-branch' - 'self-sign' - 'smbios-dump' - 'attach' - 'detach' - 'firmware-dump' - 'refresh' - 'verify-update' - 'watch' - 'unbind-driver' - 'bind-driver' - 'export-hwids' -) - -_fwupdtool_opts=( - '--verbose' - '--enable-json-state' - '--allow-reinstall' - '--allow-older' - '--force' - '--show-all' - '--plugins' - '--prepare' - '--cleanup' - '--filter' - '--method' - '--disable-ssl-strict' - '--no-safety-check' - '--ignore-checksum' - '--ignore-vid-pid' -) - -_show_filters() -{ - local flags - flags="$(command @libexecdir@/fwupdtool get-device-flags 2>/dev/null)" - COMPREPLY+=( $(compgen -W "${flags}" -- "$cur") ) -} - -_show_firmware_types() -{ - local firmware_types - firmware_types="$(command @libexecdir@/fwupdtool get-firmware-types 2>/dev/null)" - COMPREPLY+=( $(compgen -W "${firmware_types}" -- "$cur") ) -} - - -_show_plugins() -{ - local plugins - plugins="$(command @libexecdir@/fwupdtool get-plugins 2>/dev/null)" - COMPREPLY+=( $(compgen -W "${plugins}" -- "$cur") ) -} - -_show_modifiers() -{ - COMPREPLY+=( $(compgen -W '${_fwupdtool_opts[@]}' -- "$cur") ) -} - -_fwupdtool() -{ - local cur prev command - COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} - command=${COMP_WORDS[1]} - - case $prev in - --plugins) - _show_plugins - return 0 - ;; - --filter) - _show_filters - return 0 - ;; - esac - - case $command in - get-details|install|install-blob|firmware-dump) - #find files - if [[ "$prev" = "$command" ]]; then - _filedir - #modifiers - else - _show_modifiers - fi - ;; - attach|detach|activate|verify-update|reinstall|get-updates) - if [[ "$prev" = "$command" ]]; then - _show_device_ids - #modifiers - else - _show_modifiers - fi - ;; - build-firmware) - #file in - if [[ "$prev" = "$command" ]]; then - _filedir - #file out - elif [[ "$prev" = "${COMP_WORDS[2]}" ]]; then - _filedir - #script - elif [[ "$prev" = "${COMP_WORDS[3]}" ]]; then - _filedir - #output - elif [[ "$prev" = "${COMP_WORDS[4]}" ]]; then - _filedir - else - _show_modifiers - fi - ;; - firmware-parse|firmware-patch) - #find files - if [[ "$prev" = "$command" ]]; then - _filedir - #firmware_type - elif [[ "$prev" = "${COMP_WORDS[2]}" ]]; then - _show_firmware_types - else - _show_modifiers - fi - ;; - firmware-convert) - #file in - if [[ "$prev" = "$command" ]]; then - _filedir - #file out - elif [[ "$prev" = "${COMP_WORDS[2]}" ]]; then - _filedir - #firmware_type in - elif [[ "$prev" = "${COMP_WORDS[3]}" ]]; then - _show_firmware_types - #firmware_type out - elif [[ "$prev" = "${COMP_WORDS[4]}" ]]; then - _show_firmware_types - else - _show_modifiers - fi - ;; - *) - #find first command - if [[ ${COMP_CWORD} = 1 ]]; then - COMPREPLY=( $(compgen -W '${_fwupdtool_cmd_list[@]}' -- "$cur") ) - #modifiers for all commands - else - _show_modifiers - fi - ;; - esac - - return 0 -} - -complete -F _fwupdtool fwupdtool diff -Nru fwupd-1.7.4/data/bash-completion/meson.build fwupd-1.7.5/data/bash-completion/meson.build --- fwupd-1.7.4/data/bash-completion/meson.build 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/data/bash-completion/meson.build 2022-02-07 16:24:38.000000000 +0000 @@ -3,27 +3,14 @@ define_variable: bashcomp.version().version_compare('>= 2.10') ? ['datadir', datadir] : ['prefix', prefix], ) -# replace @libexecdir@ -fwupdtool_path = join_paths(libexecdir, 'fwupd') -con2 = configuration_data() -con2.set('libexecdir', fwupdtool_path) -configure_file( - input : 'fwupdtool.in', - output : 'fwupdtool', - configuration : con2, - install: true, - install_dir: completions_dir) + install_data(['fwupdtool'], + install_dir : completions_dir, + ) -if build_daemon -install_data(['fwupdagent'], - install_dir : completions_dir, -) -configure_file( - input : 'fwupdmgr.in', - output : 'fwupdmgr', - configuration : con2, - install: true, - install_dir: completions_dir) -endif # build_daemon + if build_daemon + install_data(['fwupdagent', 'fwupdmgr'], + install_dir : completions_dir, + ) + endif # build_daemon endif # bashcomp.found() diff -Nru fwupd-1.7.4/data/device-tests/nordic-hid-nrf52840-mcuboot.json fwupd-1.7.5/data/device-tests/nordic-hid-nrf52840-mcuboot.json --- fwupd-1.7.4/data/device-tests/nordic-hid-nrf52840-mcuboot.json 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/data/device-tests/nordic-hid-nrf52840-mcuboot.json 2022-02-07 16:24:38.000000000 +0000 @@ -3,10 +3,10 @@ "interactive": false, "steps": [ { - "url": "https://fwupd.org/downloads/839c1a8177b19ef3db5e67f31be92c35a25ae5c7bf431740e6568d5b005313b7-nordic-nrf52840dk-mcuboot-0.0.0_0.cab", + "url": "https://fwupd.org/downloads/904ff137256218bc617661bb4fc2bfddad19522c7e54773d1fd0290b54adfcee-nordic-nrf52840dk-mcuboot-0.0.0_2.cab", "components": [ { - "version": "0.0.0.0", + "version": "0.0.0.2", "guids": [ "43b38427-fdf5-5400-a23c-f3eb7ea00e7c" ] @@ -14,10 +14,10 @@ ] }, { - "url": "https://fwupd.org/downloads/6fb9dcfc1e26a5b0367d0a8a484f93ba156f846c1fb49013f3a934adc964788c-nordic-nrf52840dk-mcuboot-0.0.0_1.cab", + "url": "https://fwupd.org/downloads/2eb21f9439f0c4928c14548ff5c5c73ad6590d23fa704c58c4afa88168bcea90-nordic-nrf52840dk-mcuboot-0.0.0_3.cab", "components": [ { - "version": "0.0.0.1", + "version": "0.0.0.3", "guids": [ "43b38427-fdf5-5400-a23c-f3eb7ea00e7c" ] diff -Nru fwupd-1.7.4/data/fish-completion/fwupdmgr.fish fwupd-1.7.5/data/fish-completion/fwupdmgr.fish --- fwupd-1.7.4/data/fish-completion/fwupdmgr.fish 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/data/fish-completion/fwupdmgr.fish 2022-02-07 16:24:38.000000000 +0000 @@ -35,8 +35,6 @@ # complete subcommands complete -c fwupdmgr -n '__fish_use_subcommand' -x -a activate -d 'Activate devices' complete -c fwupdmgr -n '__fish_use_subcommand' -x -a block-firmware -d 'Blocks a specific firmware from being installed' -complete -c fwupdmgr -n '__fish_use_subcommand' -x -a clear-history -d 'Erase all firmware update history' -complete -c fwupdmgr -n '__fish_use_subcommand' -x -a clear-offline -d 'Clears any updates scheduled to be updated offline' complete -c fwupdmgr -n '__fish_use_subcommand' -x -a clear-results -d 'Clears the results from the last update' complete -c fwupdmgr -n '__fish_use_subcommand' -x -a disable-remote -d 'Disables a given remote' complete -c fwupdmgr -n '__fish_use_subcommand' -x -a downgrade -d 'Downgrades the firmware on a device' diff -Nru fwupd-1.7.4/data/installed-tests/fwupdmgr-p2p.sh fwupd-1.7.5/data/installed-tests/fwupdmgr-p2p.sh --- fwupd-1.7.4/data/installed-tests/fwupdmgr-p2p.sh 1970-01-01 00:00:00.000000000 +0000 +++ fwupd-1.7.5/data/installed-tests/fwupdmgr-p2p.sh 2022-02-07 16:24:38.000000000 +0000 @@ -0,0 +1,23 @@ +#!/bin/sh + +# only run as root, possibly only in CI +if [ "$(id -u)" -ne 0 ]; then exit 0; fi + +# --- +echo "Starting P2P daemon..." +export FWUPD_DBUS_SOCKET="/var/run/fwupd.sock" +rm -rf ${FWUPD_DBUS_SOCKET} +/usr/libexec/fwupd/fwupd --verbose --timed-exit --no-timestamp & +while [ ! -e ${FWUPD_DBUS_SOCKET} ]; do sleep 1; done + +# --- +echo "Starting P2P client..." +fwupdmgr get-devices --json +rc=$?; if [ $rc != 0 ]; then exit $rc; fi + +# --- +echo "Shutting down P2P daemon..." +gdbus call --system --dest org.freedesktop.fwupd --object-path / --method org.freedesktop.fwupd.Quit + +# success! +exit 0 diff -Nru fwupd-1.7.4/data/installed-tests/fwupdmgr-p2p.test.in fwupd-1.7.5/data/installed-tests/fwupdmgr-p2p.test.in --- fwupd-1.7.4/data/installed-tests/fwupdmgr-p2p.test.in 1970-01-01 00:00:00.000000000 +0000 +++ fwupd-1.7.5/data/installed-tests/fwupdmgr-p2p.test.in 2022-02-07 16:24:38.000000000 +0000 @@ -0,0 +1,3 @@ +[Test] +Type=session +Exec=sh -c "@installedtestsdir@/fwupdmgr-p2p.sh" diff -Nru fwupd-1.7.4/data/installed-tests/meson.build fwupd-1.7.5/data/installed-tests/meson.build --- fwupd-1.7.4/data/installed-tests/meson.build 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/data/installed-tests/meson.build 2022-02-07 16:24:38.000000000 +0000 @@ -13,6 +13,14 @@ ) configure_file( + input : 'fwupdmgr-p2p.test.in', + output : 'fwupdmgr-p2p.test', + configuration : con2, + install: true, + install_dir: installed_test_datadir, +) + +configure_file( input : 'fwupd.test.in', output : 'fwupd.test', configuration : con2, @@ -22,6 +30,7 @@ install_data([ 'fwupdmgr.sh', + 'fwupdmgr-p2p.sh', 'fwupd-tests.xml', ], install_dir : installed_test_datadir, diff -Nru fwupd-1.7.4/data/org.freedesktop.fwupd.metainfo.xml fwupd-1.7.5/data/org.freedesktop.fwupd.metainfo.xml --- fwupd-1.7.4/data/org.freedesktop.fwupd.metainfo.xml 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/data/org.freedesktop.fwupd.metainfo.xml 2022-02-07 16:24:38.000000000 +0000 @@ -34,6 +34,39 @@ fwupdagent + + +

+ This release adds the following features: +

+
    +
  • Add a flag to indicate the firmware is not provided by the vendor
  • +
  • Add support for showing dependency versions in JSON format
  • +
  • Allow fwupd to operate in socket mode without a D-Bus daemon
  • +
  • Allow marking a device as End-of-Life by the OEM vendor
  • +
  • Allow specifying the machine Best Known Configuration locally
  • +
  • Fall back to the ARM Device Tree 'compatible' data when required
  • +
+

This release fixes the following bugs:

+
    +
  • Be more robust by retrying IPMI transactions on servers
  • +
  • Change the expired Redfish password when required
  • +
  • Fix a ModemManager segfault on startup for some MBIM-QDU devices
  • +
  • Fix a possible dell-dock segfault at startup
  • +
  • Fix compiling with new versions of efivar
  • +
  • Fix the Nordic bootloader type detection
  • +
  • Fix USB4 retimer enumeration
  • +
  • Get the SMBIOS table and host machine ID when running on Windows
  • +
  • Show results when calling get-details if failing requirements
  • +
  • Uninhibit the modem using ModemManager after upgrade
  • +
+

This release adds support for the following hardware:

+
    +
  • Future Analogix devices
  • +
  • NovaCustom NV4x
  • +
+
+

diff -Nru fwupd-1.7.4/debian/changelog fwupd-1.7.5/debian/changelog --- fwupd-1.7.4/debian/changelog 2022-02-09 16:02:15.000000000 +0000 +++ fwupd-1.7.5/debian/changelog 2022-02-19 13:21:22.000000000 +0000 @@ -1,9 +1,38 @@ -fwupd (1.7.4-1ubuntu1) jammy; urgency=medium +fwupd (1.7.5-3) unstable; urgency=medium - * Drop wrong Recommends: on fwupd-unsigned. We should only be recommending - fwupd-signed. + * debian/tests: + - Disable blocking container virtualization only for autopkgtest - -- Steve Langasek Wed, 09 Feb 2022 16:02:15 +0000 + -- Mario Limonciello Sat, 19 Feb 2022 07:21:22 -0600 + +fwupd (1.7.5-2) unstable; urgency=medium + + * Backport a series of patches that fix autopkgtest failures in Debian + and Ubuntu. + * Backport a patch to avoid running fwupd-refresh in containers. + + -- Mario Limonciello Fri, 18 Feb 2022 11:50:37 -0600 + +fwupd (1.7.5-1) unstable; urgency=medium + + * New upstream version (1.7.5) + - Enable modem manager plugin by default + * Drop efivar compatibility patch, upstream + * backport a patch to fix dell wd19 TBT updates + * backport a patch for community messaging issue + * Backport a patch to allow falling back to signed binary if + unsigned binary not present + * Drop fwupd-unsigned from Recommends + + -- Mario Limonciello Tue, 15 Feb 2022 08:26:21 -0600 + +fwupd (1.7.4-2) unstable; urgency=medium + + * Add hard dependencies on libfwupd2 and libfwupdplugin5 built with + us. Symbols suggest things should work, but maybe not. :-( + Closes: #1003664 + + -- Steve McIntyre <93sam@debian.org> Thu, 10 Feb 2022 00:13:57 +0000 fwupd (1.7.4-1) unstable; urgency=medium diff -Nru fwupd-1.7.4/debian/control fwupd-1.7.5/debian/control --- fwupd-1.7.4/debian/control 2022-02-09 16:02:15.000000000 +0000 +++ fwupd-1.7.5/debian/control 2022-02-18 17:49:13.000000000 +0000 @@ -1,7 +1,6 @@ Source: fwupd Priority: optional -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Debian EFI +Maintainer: Debian EFI Uploaders: Steve McIntyre <93sam@debian.org>, Matthias Klumpp , Mario Limonciello @@ -77,7 +76,8 @@ Package: libfwupdplugin5 Section: libs Architecture: linux-any -Depends: ${misc:Depends}, +Depends: libfwupd2 (= ${binary:Version}), + ${misc:Depends}, ${shlibs:Depends} Multi-Arch: same Description: Firmware update daemon plugin library @@ -106,7 +106,9 @@ Package: fwupd Architecture: linux-any -Depends: ${misc:Depends}, +Depends: libfwupd2 (= ${binary:Version}), + libfwupdplugin5 (= ${binary:Version}), + ${misc:Depends}, ${shlibs:Depends}, shared-mime-info Recommends: python3, diff -Nru fwupd-1.7.4/debian/control.in fwupd-1.7.5/debian/control.in --- fwupd-1.7.4/debian/control.in 2022-02-09 16:02:15.000000000 +0000 +++ fwupd-1.7.5/debian/control.in 2022-02-18 17:49:13.000000000 +0000 @@ -1,7 +1,6 @@ Source: fwupd Priority: optional -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Debian EFI +Maintainer: Debian EFI Uploaders: Steve McIntyre <93sam@debian.org>, Matthias Klumpp , Mario Limonciello @@ -56,7 +55,8 @@ dbus, secureboot-db, udisks2, - fwupd-signed + fwupd-signed, + jq Suggests: gir1.2-fwupd-2.0 Provides: fwupdate Conflicts: fwupdate-amd64-signed, diff -Nru fwupd-1.7.4/debian/patches/0001-fall-back-to-signed-EFI-app-as-secure-boot-is-off.patch fwupd-1.7.5/debian/patches/0001-fall-back-to-signed-EFI-app-as-secure-boot-is-off.patch --- fwupd-1.7.4/debian/patches/0001-fall-back-to-signed-EFI-app-as-secure-boot-is-off.patch 1970-01-01 00:00:00.000000000 +0000 +++ fwupd-1.7.5/debian/patches/0001-fall-back-to-signed-EFI-app-as-secure-boot-is-off.patch 2022-02-18 17:49:13.000000000 +0000 @@ -0,0 +1,85 @@ +From 4642e7694efcf852e16b7d746a4a0f6e64f25690 Mon Sep 17 00:00:00 2001 +From: Yuan-Chen Cheng +Date: Mon, 14 Feb 2022 15:41:21 +0800 +Subject: [PATCH] fall back to signed EFI app as secure boot is off. + +Some distribution hopes to not install the not-signed EFI app by default. +However, for the corner case, the user might still want to use not-signed +one (maybe to work around bugs or do testing). This implements +a logic that uses the not-signed EFI app as the secure boot is off, and +if it does not exist, then we fall back to using the signed one. + +Also drop fwupd-unsigned from Recommends of fwupd in debian/control. +--- + plugins/uefi-capsule/fu-uefi-common.c | 48 +++++++++++++++++++-------- + 2 files changed, 35 insertions(+), 14 deletions(-) + +diff --git a/plugins/uefi-capsule/fu-uefi-common.c b/plugins/uefi-capsule/fu-uefi-common.c +index 7128afd55..473471b54 100644 +--- a/plugins/uefi-capsule/fu-uefi-common.c ++++ b/plugins/uefi-capsule/fu-uefi-common.c +@@ -88,26 +88,48 @@ fu_uefi_get_esp_app_path(FuDevice *device, const gchar *esp_path, const gchar *c + gchar * + fu_uefi_get_built_app_path(GError **error) + { +- const gchar *extension = ""; + const gchar *suffix; +- g_autofree gchar *source_path = NULL; + g_autofree gchar *prefix = NULL; +- if (fu_efivar_secure_boot_enabled()) +- extension = ".signed"; ++ g_autofree gchar *source_path = NULL; ++ g_autofree gchar *source_path_signed = NULL; ++ gboolean source_path_exists = FALSE; ++ gboolean source_path_signed_exists = FALSE; ++ + suffix = fu_uefi_bootmgr_get_suffix(error); + if (suffix == NULL) + return NULL; + prefix = fu_common_get_path(FU_PATH_KIND_EFIAPPDIR); +- source_path = g_strdup_printf("%s/fwupd%s.efi%s", prefix, suffix, extension); +- if (!g_file_test(source_path, G_FILE_TEST_EXISTS)) { +- g_set_error(error, +- G_IO_ERROR, +- G_IO_ERROR_NOT_FOUND, +- "%s cannot be found", +- source_path); +- return NULL; ++ ++ source_path = g_strdup_printf("%s/fwupd%s.efi", prefix, suffix); ++ source_path_signed = g_strdup_printf("%s.signed", source_path); ++ ++ source_path_exists = g_file_test(source_path, G_FILE_TEST_EXISTS); ++ source_path_signed_exists = g_file_test(source_path_signed, G_FILE_TEST_EXISTS); ++ ++ if (fu_efivar_secure_boot_enabled()) { ++ if (!source_path_signed_exists) { ++ g_set_error(error, ++ G_IO_ERROR, ++ G_IO_ERROR_NOT_FOUND, ++ "%s cannot be found", ++ source_path_signed); ++ return NULL; ++ } ++ return g_steal_pointer(&source_path_signed); + } +- return g_steal_pointer(&source_path); ++ ++ if (source_path_exists) ++ return g_steal_pointer(&source_path); ++ if (source_path_signed_exists) ++ return g_steal_pointer(&source_path_signed); ++ ++ g_set_error(error, ++ G_IO_ERROR, ++ G_IO_ERROR_NOT_FOUND, ++ "%s and %s cannot be found", ++ source_path, ++ source_path_signed); ++ return NULL; + } + + gboolean +-- +2.25.1 + diff -Nru fwupd-1.7.4/debian/patches/0001-Fix-compiling-with-new-versions-of-efivar.patch fwupd-1.7.5/debian/patches/0001-Fix-compiling-with-new-versions-of-efivar.patch --- fwupd-1.7.4/debian/patches/0001-Fix-compiling-with-new-versions-of-efivar.patch 2022-01-17 15:27:44.000000000 +0000 +++ fwupd-1.7.5/debian/patches/0001-Fix-compiling-with-new-versions-of-efivar.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -From e74d38bfd3097471fe60dbe843a68c16516a78da Mon Sep 17 00:00:00 2001 -From: Richard Hughes -Date: Mon, 17 Jan 2022 14:50:47 +0000 -Subject: [PATCH] Fix compiling with new versions of efivar - -Fixes https://github.com/fwupd/fwupd/issues/4181 ---- - meson.build | 5 +++++ - plugins/uefi-capsule/fu-uefi-common.h | 3 +++ - 2 files changed, 8 insertions(+) - -diff --git a/meson.build b/meson.build -index 833bdbf5..691cc8a5 100644 ---- a/meson.build -+++ b/meson.build -@@ -412,6 +412,11 @@ endif - if build_standalone and get_option('plugin_uefi_capsule') - efiboot = dependency('efiboot') - -+ efivar = dependency('efivar') -+ if cc.has_header_symbol('efivar/efivar-types.h', 'efi_time_t', dependencies : efivar) -+ conf.set('HAVE_EFI_TIME_T', '1') -+ endif -+ - efi_app_location = join_paths(libexecdir, 'fwupd', 'efi') - conf.set_quoted('EFI_APP_LOCATION', efi_app_location) - -diff --git a/plugins/uefi-capsule/fu-uefi-common.h b/plugins/uefi-capsule/fu-uefi-common.h -index a21806d6..1d616c9e 100644 ---- a/plugins/uefi-capsule/fu-uefi-common.h -+++ b/plugins/uefi-capsule/fu-uefi-common.h -@@ -9,6 +9,7 @@ - - #include - -+#include - #include - - #define EFI_CAPSULE_HEADER_FLAGS_PERSIST_ACROSS_RESET 0x00010000 -@@ -17,6 +18,7 @@ - - #define EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED 0x0000000000000004ULL - -+#ifndef HAVE_EFI_TIME_T - typedef struct __attribute__((__packed__)) { - guint16 year; - guint8 month; -@@ -30,6 +32,7 @@ typedef struct __attribute__((__packed__)) { - guint8 daylight; - guint8 pad2; - } efi_time_t; -+#endif - - typedef struct __attribute__((__packed__)) { - fwupd_guid_t guid; --- -2.25.1 - diff -Nru fwupd-1.7.4/debian/patches/0001-systemd-don-t-run-fwupd-fwupd-refresh-in-containers.patch fwupd-1.7.5/debian/patches/0001-systemd-don-t-run-fwupd-fwupd-refresh-in-containers.patch --- fwupd-1.7.4/debian/patches/0001-systemd-don-t-run-fwupd-fwupd-refresh-in-containers.patch 1970-01-01 00:00:00.000000000 +0000 +++ fwupd-1.7.5/debian/patches/0001-systemd-don-t-run-fwupd-fwupd-refresh-in-containers.patch 2022-02-18 17:49:16.000000000 +0000 @@ -0,0 +1,37 @@ +From f5da94c4736efdf5f8e2c1a50109c334c4392df7 Mon Sep 17 00:00:00 2001 +From: Simon Deziel +Date: Thu, 17 Feb 2022 09:57:26 -0500 +Subject: [PATCH] systemd: don't run fwupd/fwupd-refresh in containers + +Signed-off-by: Simon Deziel +--- + data/fwupd.service.in | 1 + + data/motd/fwupd-refresh.timer | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/data/fwupd.service.in b/data/fwupd.service.in +index 6bdf3943..0095c5b5 100644 +--- a/data/fwupd.service.in ++++ b/data/fwupd.service.in +@@ -3,6 +3,7 @@ Description=Firmware update daemon + Documentation=https://fwupd.org/ + After=dbus.service + Before=display-manager.service ++ConditionVirtualization=!container + + [Service] + Type=dbus +diff --git a/data/motd/fwupd-refresh.timer b/data/motd/fwupd-refresh.timer +index 5cd67ce6..c72e05a7 100644 +--- a/data/motd/fwupd-refresh.timer ++++ b/data/motd/fwupd-refresh.timer +@@ -1,5 +1,6 @@ + [Unit] + Description=Refresh fwupd metadata regularly ++ConditionVirtualization=!container + + [Timer] + OnCalendar=*-*-* 6,18:00 +-- +2.34.1 + diff -Nru fwupd-1.7.4/debian/patches/0001-trivial-don-t-replug-if-thunderbolt-device-supports-.patch fwupd-1.7.5/debian/patches/0001-trivial-don-t-replug-if-thunderbolt-device-supports-.patch --- fwupd-1.7.4/debian/patches/0001-trivial-don-t-replug-if-thunderbolt-device-supports-.patch 1970-01-01 00:00:00.000000000 +0000 +++ fwupd-1.7.5/debian/patches/0001-trivial-don-t-replug-if-thunderbolt-device-supports-.patch 2022-02-18 17:49:13.000000000 +0000 @@ -0,0 +1,28 @@ +From f7b6fa2e829b5ab95ee1e37fd06ecce3bdf39928 Mon Sep 17 00:00:00 2001 +From: Crag Wang +Date: Wed, 9 Feb 2022 22:54:06 +0800 +Subject: [PATCH] trivial: don't replug if thunderbolt device supports auth on + disconnect + +Fixes: #4262 +--- + plugins/thunderbolt/fu-thunderbolt-controller.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/plugins/thunderbolt/fu-thunderbolt-controller.c b/plugins/thunderbolt/fu-thunderbolt-controller.c +index cb4edab4..fd5573d7 100644 +--- a/plugins/thunderbolt/fu-thunderbolt-controller.c ++++ b/plugins/thunderbolt/fu-thunderbolt-controller.c +@@ -310,7 +310,8 @@ fu_thunderbolt_controller_write_firmware(FuDevice *device, + if (!FU_DEVICE_CLASS(fu_thunderbolt_controller_parent_class) + ->write_firmware(device, firmware, progress, flags, error)) + return FALSE; +- fu_device_add_flag(device, FWUPD_DEVICE_FLAG_WAIT_FOR_REPLUG); ++ if (!fu_device_has_flag(device, FWUPD_DEVICE_FLAG_USABLE_DURING_UPDATE)) ++ fu_device_add_flag(device, FWUPD_DEVICE_FLAG_WAIT_FOR_REPLUG); + return TRUE; + } + +-- +2.34.1 + diff -Nru fwupd-1.7.4/debian/patches/0001-trivial-Fix-a-logic-thinko-when-adding-the-community.patch fwupd-1.7.5/debian/patches/0001-trivial-Fix-a-logic-thinko-when-adding-the-community.patch --- fwupd-1.7.4/debian/patches/0001-trivial-Fix-a-logic-thinko-when-adding-the-community.patch 1970-01-01 00:00:00.000000000 +0000 +++ fwupd-1.7.5/debian/patches/0001-trivial-Fix-a-logic-thinko-when-adding-the-community.patch 2022-02-18 17:49:13.000000000 +0000 @@ -0,0 +1,26 @@ +From 9ea78077af8e6f2e5dc06f9d410aeacb68f065cb Mon Sep 17 00:00:00 2001 +From: Richard Hughes +Date: Tue, 8 Feb 2022 17:10:28 +0000 +Subject: [PATCH] trivial: Fix a logic thinko when adding the community warning + in fwupdmgr + +--- + src/fu-util-common.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/fu-util-common.c b/src/fu-util-common.c +index 24c6984e..02cb4b22 100644 +--- a/src/fu-util-common.c ++++ b/src/fu-util-common.c +@@ -384,7 +384,7 @@ fu_util_get_release_description_with_fallback(FwupdRelease *rel) + g_string_append(str, fwupd_release_get_description(rel)); + + /* add this client side to get the translations */ +- if (!fwupd_release_has_flag(rel, FWUPD_RELEASE_FLAG_IS_COMMUNITY)) { ++ if (fwupd_release_has_flag(rel, FWUPD_RELEASE_FLAG_IS_COMMUNITY)) { + g_string_append_printf( + str, + "

%s

", +-- +2.34.1 + diff -Nru fwupd-1.7.4/debian/patches/0001-trivial-quit-fwupdmgr-p2p.sh-on-command-failures.patch fwupd-1.7.5/debian/patches/0001-trivial-quit-fwupdmgr-p2p.sh-on-command-failures.patch --- fwupd-1.7.4/debian/patches/0001-trivial-quit-fwupdmgr-p2p.sh-on-command-failures.patch 1970-01-01 00:00:00.000000000 +0000 +++ fwupd-1.7.5/debian/patches/0001-trivial-quit-fwupdmgr-p2p.sh-on-command-failures.patch 2022-02-18 17:49:16.000000000 +0000 @@ -0,0 +1,23 @@ +From e5c00a8e981342c9fb4b138eea3454e9d51af491 Mon Sep 17 00:00:00 2001 +From: Mario Limonciello +Date: Thu, 17 Feb 2022 21:44:57 -0600 +Subject: [PATCH 1/3] trivial: quit fwupdmgr-p2p.sh on command failures + +This will prevent a lingering daemon from influencing future tests +--- + data/installed-tests/fwupdmgr-p2p.sh | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/data/installed-tests/fwupdmgr-p2p.sh b/data/installed-tests/fwupdmgr-p2p.sh +index d6f32454..c69474df 100755 +--- a/data/installed-tests/fwupdmgr-p2p.sh ++++ b/data/installed-tests/fwupdmgr-p2p.sh +@@ -1,4 +1,5 @@ + #!/bin/sh ++set -e + + # only run as root, possibly only in CI + if [ "$(id -u)" -ne 0 ]; then exit 0; fi +-- +2.34.1 + diff -Nru fwupd-1.7.4/debian/patches/0002-trivial-don-t-run-systemd-check-when-running-as-a-so.patch fwupd-1.7.5/debian/patches/0002-trivial-don-t-run-systemd-check-when-running-as-a-so.patch --- fwupd-1.7.4/debian/patches/0002-trivial-don-t-run-systemd-check-when-running-as-a-so.patch 1970-01-01 00:00:00.000000000 +0000 +++ fwupd-1.7.5/debian/patches/0002-trivial-don-t-run-systemd-check-when-running-as-a-so.patch 2022-02-18 17:49:16.000000000 +0000 @@ -0,0 +1,32 @@ +From f301aabd45bb48fd323d0ae1c6c08512344decae Mon Sep 17 00:00:00 2001 +From: Mario Limonciello +Date: Thu, 17 Feb 2022 21:48:07 -0600 +Subject: [PATCH 2/3] trivial: don't run systemd check when running as a socket + +We don't want to be checking for a systemd daemon when we just told +you that it is a socketed daemon. (Fixes: #4299) +--- + src/fu-util-common.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/fu-util-common.c b/src/fu-util-common.c +index aa69de53..dcea7711 100644 +--- a/src/fu-util-common.c ++++ b/src/fu-util-common.c +@@ -68,7 +68,12 @@ fu_util_using_correct_daemon(GError **error) + #ifdef HAVE_SYSTEMD + g_autofree gchar *default_target = NULL; + g_autoptr(GError) error_local = NULL; +- const gchar *target = fu_util_get_systemd_unit(); ++ const gchar *target; ++ ++ if (g_getenv("FWUPD_DBUS_SOCKET") != NULL) ++ return TRUE; ++ ++ target = fu_util_get_systemd_unit(); + + default_target = fu_systemd_get_default_target(&error_local); + if (default_target == NULL) { +-- +2.34.1 + diff -Nru fwupd-1.7.4/debian/patches/0003-Don-t-let-stderr-fail-the-fwupdmgr-p2p-test.patch fwupd-1.7.5/debian/patches/0003-Don-t-let-stderr-fail-the-fwupdmgr-p2p-test.patch --- fwupd-1.7.4/debian/patches/0003-Don-t-let-stderr-fail-the-fwupdmgr-p2p-test.patch 1970-01-01 00:00:00.000000000 +0000 +++ fwupd-1.7.5/debian/patches/0003-Don-t-let-stderr-fail-the-fwupdmgr-p2p-test.patch 2022-02-18 17:49:16.000000000 +0000 @@ -0,0 +1,25 @@ +From fbac66b964e9ca8a6163644b65bedd987a129f02 Mon Sep 17 00:00:00 2001 +From: Mario Limonciello +Date: Fri, 18 Feb 2022 11:30:00 -0600 +Subject: [PATCH 3/3] Don't let stderr fail the fwupdmgr-p2p test + +--- + data/installed-tests/fwupdmgr-p2p.sh | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/data/installed-tests/fwupdmgr-p2p.sh b/data/installed-tests/fwupdmgr-p2p.sh +index c69474df..55825de8 100755 +--- a/data/installed-tests/fwupdmgr-p2p.sh ++++ b/data/installed-tests/fwupdmgr-p2p.sh +@@ -1,6 +1,8 @@ + #!/bin/sh + set -e + ++exec 2>&1 ++ + # only run as root, possibly only in CI + if [ "$(id -u)" -ne 0 ]; then exit 0; fi + +-- +2.34.1 + diff -Nru fwupd-1.7.4/debian/patches/series fwupd-1.7.5/debian/patches/series --- fwupd-1.7.4/debian/patches/series 2022-01-17 15:39:53.000000000 +0000 +++ fwupd-1.7.5/debian/patches/series 2022-02-18 17:49:16.000000000 +0000 @@ -1 +1,8 @@ -0001-Fix-compiling-with-new-versions-of-efivar.patch +0001-trivial-don-t-replug-if-thunderbolt-device-supports-.patch +0001-trivial-Fix-a-logic-thinko-when-adding-the-community.patch +0001-fall-back-to-signed-EFI-app-as-secure-boot-is-off.patch +0001-trivial-quit-fwupdmgr-p2p.sh-on-command-failures.patch +0002-trivial-don-t-run-systemd-check-when-running-as-a-so.patch +0003-Don-t-let-stderr-fail-the-fwupdmgr-p2p-test.patch +0001-systemd-don-t-run-fwupd-fwupd-refresh-in-containers.patch + diff -Nru fwupd-1.7.4/debian/rules fwupd-1.7.5/debian/rules --- fwupd-1.7.4/debian/rules 2022-01-17 15:39:38.000000000 +0000 +++ fwupd-1.7.5/debian/rules 2022-02-18 17:49:13.000000000 +0000 @@ -49,7 +49,7 @@ CONFARGS += -Dplugin_logitech_bulkcontroller=false endif -CONFARGS += -Dplugin_dummy=true -Dplugin_powerd=false -Ddocs=gtkdoc -Dsupported_build=true +CONFARGS += -Dplugin_dummy=true -Dplugin_powerd=false -Ddocs=gtkdoc -Dsupported_build=true -Dplugin_modem_manager=true %: dh $@ --with gir diff -Nru fwupd-1.7.4/debian/tests/ci fwupd-1.7.5/debian/tests/ci --- fwupd-1.7.4/debian/tests/ci 2022-01-17 15:39:38.000000000 +0000 +++ fwupd-1.7.5/debian/tests/ci 2022-02-19 13:21:20.000000000 +0000 @@ -2,4 +2,8 @@ set -e sed "s,^DisabledPlugins=.*,DisabledPlugins=," -i /etc/fwupd/daemon.conf sed "s,^VerboseDomains=.*,VerboseDomains=*," -i /etc/fwupd/daemon.conf +sed "s,ConditionVirtualization=.*,," \ + /lib/systemd/system/fwupd.service > \ + /etc/systemd/system/fwupd.service +systemctl daemon-reload gnome-desktop-testing-runner fwupd diff -Nru fwupd-1.7.4/docs/env.md fwupd-1.7.5/docs/env.md --- fwupd-1.7.4/docs/env.md 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/docs/env.md 2022-02-07 16:24:38.000000000 +0000 @@ -15,6 +15,7 @@ * `FWUPD_SUPPORTED` overrides the `-Dsupported_build` meson option at runtime * `FWUPD_VERBOSE` is set when running `--verbose` * `FWUPD_XMLB_VERBOSE` can be set to show Xmlb silo regeneration and quirk matches +* `FWUPD_DBUS_SOCKET` is used to set the socket filename if running without a dbus-daemon * `FWUPD_DOWNLOAD_VERBOSE` can be used to show wget or curl output * standard glibc variables like `LANG` are also honored for CLI tools that are translated * libcurl respects the session proxy, e.g. `http_proxy`, `all_proxy`, `sftp_proxy` and `no_proxy` diff -Nru fwupd-1.7.4/docs/hsi.md fwupd-1.7.5/docs/hsi.md --- fwupd-1.7.4/docs/hsi.md 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/docs/hsi.md 2022-02-07 16:24:38.000000000 +0000 @@ -613,14 +613,17 @@ ### [DRAM memory encryption](#org.fwupd.hsi.EncryptedRam) -TME (Intel) or TSME (AMD) is used by the firmware on supported SOCs to encrypt all data on external memory buses. +TME (Intel) or SME (AMD) is used by the hardware on supported SOCs to encrypt all data on external memory buses. It mitigates against an attacker being able to capture memory data while the system is running or to capture memory by removing a DRAM chip. -**Impact:** A local attacker can either extract unencrypted content by attaching debug probes on the DIM modules, or by removing them and inserting them into a computer with a modified DRAM controller. +This encryption may be activated by either transparently via firmware configuration or by code running in the Linux kernel. + +**Impact:** A local attacker can either extract unencrypted content by attaching debug probes on the DIMM modules, or by removing them and inserting them into a computer with a modified DRAM controller. **Possible results:** -- `enabled`: detected and enabled +- `encrypted`: detected and enabled +- `not-encrypted`: detected but disabled - `not-supported`: not available To meet HSI-4 on systems that run this test, the result must be `enabled`. *[v1.5.0]* diff -Nru fwupd-1.7.4/libfwupd/fwupd-client.c fwupd-1.7.5/libfwupd/fwupd-client.c --- fwupd-1.7.4/libfwupd/fwupd-client.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/libfwupd/fwupd-client.c 2022-02-07 16:24:38.000000000 +0000 @@ -736,6 +736,30 @@ g_steal_pointer(&task)); } +static void +fwupd_client_connect_get_connection_cb(GObject *source, GAsyncResult *res, gpointer user_data) +{ + g_autoptr(GTask) task = G_TASK(user_data); + GCancellable *cancellable = g_task_get_cancellable(task); + g_autoptr(GDBusConnection) connection = NULL; + g_autoptr(GError) error = NULL; + + connection = g_dbus_connection_new_for_address_finish(res, &error); + if (connection == NULL) { + g_task_return_error(task, g_steal_pointer(&error)); + return; + } + g_dbus_proxy_new(connection, + G_DBUS_PROXY_FLAGS_NONE, + NULL, + NULL, /* bus_name */ + FWUPD_DBUS_PATH, + FWUPD_DBUS_INTERFACE, + cancellable, + fwupd_client_connect_get_proxy_cb, + g_steal_pointer(&task)); +} + /** * fwupd_client_connect_async: * @self: a #FwupdClient @@ -758,6 +782,7 @@ gpointer callback_data) { FwupdClientPrivate *priv = GET_PRIVATE(self); + const gchar *socket_filename = g_getenv("FWUPD_DBUS_SOCKET"); g_autoptr(GTask) task = g_task_new(self, cancellable, callback, callback_data); g_autoptr(GMutexLocker) locker = g_mutex_locker_new(&priv->proxy_mutex); @@ -772,6 +797,19 @@ return; } + /* use peer-to-peer only if the env variable is set */ + if (socket_filename != NULL) { + g_autofree gchar *address = g_strdup_printf("unix:path=%s", socket_filename); + g_dbus_connection_new_for_address(address, + G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT, + NULL, + cancellable, + fwupd_client_connect_get_connection_cb, + g_steal_pointer(&task)); + return; + } + + /* typical case */ g_dbus_proxy_new_for_bus(G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_NONE, NULL, diff -Nru fwupd-1.7.4/libfwupd/fwupd-enums.c fwupd-1.7.5/libfwupd/fwupd-enums.c --- fwupd-1.7.4/libfwupd/fwupd-enums.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/libfwupd/fwupd-enums.c 2022-02-07 16:24:38.000000000 +0000 @@ -201,6 +201,8 @@ return "unreachable"; if (device_flag == FWUPD_DEVICE_FLAG_AFFECTS_FDE) return "affects-fde"; + if (device_flag == FWUPD_DEVICE_FLAG_END_OF_LIFE) + return "end-of-life"; if (device_flag == FWUPD_DEVICE_FLAG_UNKNOWN) return "unknown"; return NULL; @@ -312,6 +314,8 @@ return FWUPD_DEVICE_FLAG_UNREACHABLE; if (g_strcmp0(device_flag, "affects-fde") == 0) return FWUPD_DEVICE_FLAG_AFFECTS_FDE; + if (g_strcmp0(device_flag, "end-of-life") == 0) + return FWUPD_DEVICE_FLAG_END_OF_LIFE; return FWUPD_DEVICE_FLAG_UNKNOWN; } @@ -532,6 +536,8 @@ return "requests"; if (feature_flag == FWUPD_FEATURE_FLAG_FDE_WARNING) return "fde-warning"; + if (feature_flag == FWUPD_FEATURE_FLAG_COMMUNITY_TEXT) + return "community-text"; return NULL; } @@ -562,6 +568,8 @@ return FWUPD_FEATURE_FLAG_REQUESTS; if (g_strcmp0(feature_flag, "fde-warning") == 0) return FWUPD_FEATURE_FLAG_FDE_WARNING; + if (g_strcmp0(feature_flag, "community-text") == 0) + return FWUPD_FEATURE_FLAG_COMMUNITY_TEXT; return FWUPD_FEATURE_FLAG_LAST; } @@ -642,6 +650,8 @@ return "blocked-approval"; if (release_flag == FWUPD_RELEASE_FLAG_IS_ALTERNATE_BRANCH) return "is-alternate-branch"; + if (release_flag == FWUPD_RELEASE_FLAG_IS_COMMUNITY) + return "is-community"; return NULL; } @@ -672,6 +682,8 @@ return FWUPD_RELEASE_FLAG_BLOCKED_APPROVAL; if (g_strcmp0(release_flag, "is-alternate-branch") == 0) return FWUPD_RELEASE_FLAG_IS_ALTERNATE_BRANCH; + if (g_strcmp0(release_flag, "is-community") == 0) + return FWUPD_RELEASE_FLAG_IS_COMMUNITY; return FWUPD_RELEASE_FLAG_NONE; } diff -Nru fwupd-1.7.4/libfwupd/fwupd-enums.h fwupd-1.7.5/libfwupd/fwupd-enums.h --- fwupd-1.7.4/libfwupd/fwupd-enums.h 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/libfwupd/fwupd-enums.h 2022-02-07 16:24:38.000000000 +0000 @@ -73,17 +73,19 @@ * @FWUPD_FEATURE_FLAG_SWITCH_BRANCH: Can switch the firmware branch * @FWUPD_FEATURE_FLAG_REQUESTS: Can show interactive requests * @FWUPD_FEATURE_FLAG_FDE_WARNING: Can warn about full disk encryption + * @FWUPD_FEATURE_FLAG_COMMUNITY_TEXT: Can show information about community supported * * The flags to the feature capabilities of the front-end client. **/ typedef enum { - FWUPD_FEATURE_FLAG_NONE = 0, /* Since: 1.4.5 */ - FWUPD_FEATURE_FLAG_CAN_REPORT = 1 << 0, /* Since: 1.4.5 */ - FWUPD_FEATURE_FLAG_DETACH_ACTION = 1 << 1, /* Since: 1.4.5 */ - FWUPD_FEATURE_FLAG_UPDATE_ACTION = 1 << 2, /* Since: 1.4.5 */ - FWUPD_FEATURE_FLAG_SWITCH_BRANCH = 1 << 3, /* Since: 1.5.0 */ - FWUPD_FEATURE_FLAG_REQUESTS = 1 << 4, /* Since: 1.6.2 */ - FWUPD_FEATURE_FLAG_FDE_WARNING = 1 << 5, /* Since: 1.7.1 */ + FWUPD_FEATURE_FLAG_NONE = 0, /* Since: 1.4.5 */ + FWUPD_FEATURE_FLAG_CAN_REPORT = 1 << 0, /* Since: 1.4.5 */ + FWUPD_FEATURE_FLAG_DETACH_ACTION = 1 << 1, /* Since: 1.4.5 */ + FWUPD_FEATURE_FLAG_UPDATE_ACTION = 1 << 2, /* Since: 1.4.5 */ + FWUPD_FEATURE_FLAG_SWITCH_BRANCH = 1 << 3, /* Since: 1.5.0 */ + FWUPD_FEATURE_FLAG_REQUESTS = 1 << 4, /* Since: 1.6.2 */ + FWUPD_FEATURE_FLAG_FDE_WARNING = 1 << 5, /* Since: 1.7.1 */ + FWUPD_FEATURE_FLAG_COMMUNITY_TEXT = 1 << 6, /* Since: 1.7.5 */ /*< private >*/ FWUPD_FEATURE_FLAG_LAST } FwupdFeatureFlags; @@ -494,6 +496,15 @@ */ #define FWUPD_DEVICE_FLAG_AFFECTS_FDE (1llu << 45) /** + * FWUPD_DEVICE_FLAG_END_OF_LIFE: + * + * The device is no longer supported by the original hardware vendor as it is considered + * end-of-life. It it unlikely to receive firmware updates, even for security issues. + * + * Since: 1.7.5 + */ +#define FWUPD_DEVICE_FLAG_END_OF_LIFE (1llu << 46) +/** * FWUPD_DEVICE_FLAG_UNKNOWN: * * This flag is not defined, this typically will happen from mismatched @@ -574,6 +585,14 @@ */ #define FWUPD_RELEASE_FLAG_IS_ALTERNATE_BRANCH (1u << 6) /** + * FWUPD_RELEASE_FLAG_IS_COMMUNITY: + * + * The release is supported by the community and not the hardware vendor. + * + * Since: 1.7.5 + */ +#define FWUPD_RELEASE_FLAG_IS_COMMUNITY (1u << 7) +/** * FWUPD_RELEASE_FLAG_UNKNOWN: * * The release flag is unknown, typically caused by using mismatched client and daemon. diff -Nru fwupd-1.7.4/libfwupd/fwupd-error.c fwupd-1.7.5/libfwupd/fwupd-error.c --- fwupd-1.7.4/libfwupd/fwupd-error.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/libfwupd/fwupd-error.c 2022-02-07 16:24:38.000000000 +0000 @@ -59,6 +59,8 @@ return FWUPD_DBUS_INTERFACE ".BatteryLevelTooLow"; if (error == FWUPD_ERROR_NEEDS_USER_ACTION) return FWUPD_DBUS_INTERFACE ".NeedsUserAction"; + if (error == FWUPD_ERROR_AUTH_EXPIRED) + return FWUPD_DBUS_INTERFACE ".AuthExpired"; return NULL; } @@ -109,6 +111,8 @@ return FWUPD_ERROR_BATTERY_LEVEL_TOO_LOW; if (g_strcmp0(error, FWUPD_DBUS_INTERFACE ".NeedsUserAction") == 0) return FWUPD_ERROR_NEEDS_USER_ACTION; + if (g_strcmp0(error, FWUPD_DBUS_INTERFACE ".AuthExpired") == 0) + return FWUPD_ERROR_AUTH_EXPIRED; return FWUPD_ERROR_LAST; } diff -Nru fwupd-1.7.4/libfwupd/fwupd-error.h fwupd-1.7.5/libfwupd/fwupd-error.h --- fwupd-1.7.4/libfwupd/fwupd-error.h 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/libfwupd/fwupd-error.h 2022-02-07 16:24:38.000000000 +0000 @@ -31,6 +31,7 @@ * @FWUPD_ERROR_BROKEN_SYSTEM: User has configured their system in a broken way * @FWUPD_ERROR_BATTERY_LEVEL_TOO_LOW: The system battery level is too low * @FWUPD_ERROR_NEEDS_USER_ACTION: User needs to do an action to complete the update + * @FWUPD_ERROR_AUTH_EXPIRED: Failed to get auth as credentials have expired * * The error code. **/ @@ -52,6 +53,7 @@ FWUPD_ERROR_BROKEN_SYSTEM, /* Since: 1.2.8 */ FWUPD_ERROR_BATTERY_LEVEL_TOO_LOW, /* Since: 1.2.10 */ FWUPD_ERROR_NEEDS_USER_ACTION, /* Since: 1.3.3 */ + FWUPD_ERROR_AUTH_EXPIRED, /* Since: 1.7.5 */ /*< private >*/ FWUPD_ERROR_LAST } FwupdError; diff -Nru fwupd-1.7.4/libfwupdplugin/fu-cabinet.c fwupd-1.7.5/libfwupdplugin/fu-cabinet.c --- fwupd-1.7.4/libfwupdplugin/fu-cabinet.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/libfwupdplugin/fu-cabinet.c 2022-02-07 16:24:38.000000000 +0000 @@ -941,11 +941,6 @@ g_ptr_array_add(files, g_strdup(xb_node_get_attr(n, "filename"))); } } - g_error( - "%s", - xb_silo_export(silo, - XB_NODE_EXPORT_FLAG_FORMAT_MULTILINE | XB_NODE_EXPORT_FLAG_FORMAT_INDENT, - NULL)); /* success */ return TRUE; diff -Nru fwupd-1.7.4/libfwupdplugin/fu-common.c fwupd-1.7.5/libfwupdplugin/fu-common.c --- fwupd-1.7.4/libfwupdplugin/fu-common.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/libfwupdplugin/fu-common.c 2022-02-07 16:24:38.000000000 +0000 @@ -1448,6 +1448,13 @@ return g_build_filename(tmp, NULL); basedir = fu_common_get_path(FU_PATH_KIND_LOCALSTATEDIR); return g_build_filename(basedir, "cache", PACKAGE_NAME, NULL); + /* /var/etc/fwupd */ + case FU_PATH_KIND_LOCALCONFDIR_PKG: + tmp = g_getenv("LOCALCONF_DIRECTORY"); + if (tmp != NULL && g_file_test(tmp, G_FILE_TEST_EXISTS)) + return g_build_filename(tmp, NULL); + basedir = fu_common_get_path(FU_PATH_KIND_LOCALSTATEDIR); + return g_build_filename(basedir, "etc", PACKAGE_NAME, NULL); /* /run/lock */ case FU_PATH_KIND_LOCKDIR: return g_strdup("/run/lock"); diff -Nru fwupd-1.7.4/libfwupdplugin/fu-common.h fwupd-1.7.5/libfwupdplugin/fu-common.h --- fwupd-1.7.4/libfwupdplugin/fu-common.h 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/libfwupdplugin/fu-common.h 2022-02-07 16:24:38.000000000 +0000 @@ -83,6 +83,7 @@ * @FU_PATH_KIND_LOCALSTATEDIR_REMOTES: The local state directory for remotes (IE * /var/lib/fwupd/remotes.d) * @FU_PATH_KIND_WIN32_BASEDIR: The root of the install directory on Windows + * @FU_PATH_KIND_LOCALCONFDIR_PKG: The package configuration override (IE /var/etc/fwupd) * * Path types to use when dynamically determining a path at runtime **/ @@ -111,6 +112,7 @@ FU_PATH_KIND_LOCALSTATEDIR_METADATA, FU_PATH_KIND_LOCALSTATEDIR_REMOTES, FU_PATH_KIND_WIN32_BASEDIR, + FU_PATH_KIND_LOCALCONFDIR_PKG, /*< private >*/ FU_PATH_KIND_LAST } FuPathKind; diff -Nru fwupd-1.7.4/libfwupdplugin/fu-device.c fwupd-1.7.5/libfwupdplugin/fu-device.c --- fwupd-1.7.4/libfwupdplugin/fu-device.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/libfwupdplugin/fu-device.c 2022-02-07 16:24:38.000000000 +0000 @@ -618,7 +618,7 @@ g_return_val_if_fail(FU_IS_DEVICE(self), FALSE); g_return_val_if_fail(func != NULL, FALSE); g_return_val_if_fail(count >= 1, FALSE); - g_return_val_if_fail(error != NULL, FALSE); + g_return_val_if_fail(error == NULL || *error == NULL, FALSE); for (guint i = 0;; i++) { g_autoptr(GError) error_local = NULL; @@ -1614,7 +1614,7 @@ return TRUE; } if (g_strcmp0(key, FU_QUIRKS_REMOVE_DELAY) == 0) { - if (!fu_common_strtoull_full(value, &tmp, 0, G_MAXUINT64, error)) + if (!fu_common_strtoull_full(value, &tmp, 0, G_MAXUINT, error)) return FALSE; fu_device_set_remove_delay(self, tmp); return TRUE; @@ -2546,13 +2546,17 @@ g_signal_handler_block(self, priv->notify_flags_handler_id); /* was okay -> not okay */ - if (fu_device_has_flag(self, FWUPD_DEVICE_FLAG_UPDATABLE) && nr_inhibits > 0) { + if (nr_inhibits > 0) { g_autofree gchar *reasons_str = NULL; g_autoptr(GList) values = g_hash_table_get_values(priv->inhibits); g_autoptr(GPtrArray) reasons = g_ptr_array_new(); - fu_device_remove_flag(self, FWUPD_DEVICE_FLAG_UPDATABLE); - fu_device_add_flag(self, FWUPD_DEVICE_FLAG_UPDATABLE_HIDDEN); + /* updatable -> updatable-hidden -- which is required as devices might have + * inhibits and *not* be automatically updatable */ + if (fu_device_has_flag(self, FWUPD_DEVICE_FLAG_UPDATABLE)) { + fu_device_remove_flag(self, FWUPD_DEVICE_FLAG_UPDATABLE); + fu_device_add_flag(self, FWUPD_DEVICE_FLAG_UPDATABLE_HIDDEN); + } /* update update error */ for (GList *l = values; l != NULL; l = l->next) { @@ -2561,12 +2565,11 @@ } reasons_str = fu_common_strjoin_array(", ", reasons); fu_device_set_update_error(self, reasons_str); - } - - /* not okay -> is okay */ - if (fu_device_has_flag(self, FWUPD_DEVICE_FLAG_UPDATABLE_HIDDEN) && nr_inhibits == 0) { - fu_device_remove_flag(self, FWUPD_DEVICE_FLAG_UPDATABLE_HIDDEN); - fu_device_add_flag(self, FWUPD_DEVICE_FLAG_UPDATABLE); + } else { + if (fu_device_has_flag(self, FWUPD_DEVICE_FLAG_UPDATABLE_HIDDEN)) { + fu_device_remove_flag(self, FWUPD_DEVICE_FLAG_UPDATABLE_HIDDEN); + fu_device_add_flag(self, FWUPD_DEVICE_FLAG_UPDATABLE); + } fu_device_set_update_error(self, NULL); } @@ -3359,6 +3362,8 @@ fu_common_string_append_kv(str, idt + 1, "ProxyId", fu_device_get_id(priv->proxy)); if (priv->proxy_guid != NULL) fu_common_string_append_kv(str, idt + 1, "ProxyGuid", priv->proxy_guid); + if (priv->remove_delay != 0) + fu_common_string_append_ku(str, idt + 1, "RemoveDelay", priv->remove_delay); if (priv->custom_flags != NULL) fu_common_string_append_kv(str, idt + 1, "CustomFlags", priv->custom_flags); if (priv->battery_level != FU_BATTERY_VALUE_INVALID) diff -Nru fwupd-1.7.4/libfwupdplugin/fu-self-test.c fwupd-1.7.5/libfwupdplugin/fu-self-test.c --- fwupd-1.7.4/libfwupdplugin/fu-self-test.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/libfwupdplugin/fu-self-test.c 2022-02-07 16:24:38.000000000 +0000 @@ -437,6 +437,35 @@ } static void +fu_smbios_dt_fallback_func(void) +{ + const gchar *str; + gboolean ret; + g_autofree gchar *path = NULL; + g_autoptr(FuSmbios) smbios = fu_smbios_new(); + g_autoptr(GError) error = NULL; + + path = g_test_build_filename(G_TEST_DIST, "tests", "devicetree-fallback", "base", NULL); + ret = fu_smbios_setup_from_path(smbios, path, &error); + g_assert_no_error(error); + g_assert_true(ret); + if (g_getenv("FWUPD_VERBOSE") != NULL) { + g_autofree gchar *dump = fu_smbios_to_string(smbios); + g_debug("%s", dump); + } + + /* get vendor */ + str = fu_smbios_get_string(smbios, FU_SMBIOS_STRUCTURE_TYPE_SYSTEM, 0x04, &error); + g_assert_no_error(error); + g_assert_cmpstr(str, ==, "solidrun"); + + /* get model */ + str = fu_smbios_get_string(smbios, FU_SMBIOS_STRUCTURE_TYPE_SYSTEM, 0x05, &error); + g_assert_no_error(error); + g_assert_cmpstr(str, ==, "honeycomb"); +} + +static void fu_smbios_class_func(void) { g_autofree gchar *path = g_test_build_filename(G_TEST_DIST, "tests", "dmi", "class", NULL); @@ -1776,6 +1805,28 @@ g_assert_false(fu_device_has_flag(device, FWUPD_DEVICE_FLAG_UPDATABLE_HIDDEN)); } +static void +fu_device_inhibit_updateable_func(void) +{ + g_autoptr(FuDevice) device = fu_device_new(); + + g_assert_false(fu_device_has_flag(device, FWUPD_DEVICE_FLAG_UPDATABLE)); + g_assert_false(fu_device_has_flag(device, FWUPD_DEVICE_FLAG_UPDATABLE_HIDDEN)); + g_assert_cmpstr(fu_device_get_update_error(device), ==, NULL); + + /* first one */ + fu_device_inhibit(device, "needs-activation", "Device is pending activation"); + g_assert_false(fu_device_has_flag(device, FWUPD_DEVICE_FLAG_UPDATABLE_HIDDEN)); + g_assert_false(fu_device_has_flag(device, FWUPD_DEVICE_FLAG_UPDATABLE)); + g_assert_cmpstr(fu_device_get_update_error(device), ==, "Device is pending activation"); + + /* activated, but still not updatable */ + fu_device_uninhibit(device, "needs-activation"); + g_assert_false(fu_device_has_flag(device, FWUPD_DEVICE_FLAG_UPDATABLE)); + g_assert_false(fu_device_has_flag(device, FWUPD_DEVICE_FLAG_UPDATABLE_HIDDEN)); + g_assert_cmpstr(fu_device_get_update_error(device), ==, NULL); +} + #define TEST_FLAG_FOO (1 << 0) #define TEST_FLAG_BAR (1 << 1) #define TEST_FLAG_BAZ (1 << 2) @@ -3923,6 +3974,7 @@ g_test_add_func("/fwupd/smbios", fu_smbios_func); g_test_add_func("/fwupd/smbios3", fu_smbios3_func); g_test_add_func("/fwupd/smbios{dt}", fu_smbios_dt_func); + g_test_add_func("/fwupd/smbios{dt-fallback}", fu_smbios_dt_fallback_func); g_test_add_func("/fwupd/smbios{class}", fu_smbios_class_func); g_test_add_func("/fwupd/firmware", fu_firmware_func); g_test_add_func("/fwupd/firmware{common}", fu_firmware_common_func); @@ -3950,6 +4002,7 @@ g_test_add_func("/fwupd/device{flags}", fu_device_flags_func); g_test_add_func("/fwupd/device{custom-flags}", fu_device_private_flags_func); g_test_add_func("/fwupd/device{inhibit}", fu_device_inhibit_func); + g_test_add_func("/fwupd/device{inhibit-updateable}", fu_device_inhibit_updateable_func); g_test_add_func("/fwupd/device{parent}", fu_device_parent_func); g_test_add_func("/fwupd/device{children}", fu_device_children_func); g_test_add_func("/fwupd/device{incorporate}", fu_device_incorporate_func); diff -Nru fwupd-1.7.4/libfwupdplugin/fu-smbios.c fwupd-1.7.5/libfwupdplugin/fu-smbios.c --- fwupd-1.7.4/libfwupdplugin/fu-smbios.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/libfwupdplugin/fu-smbios.c 2022-02-07 16:24:38.000000000 +0000 @@ -11,6 +11,10 @@ #include #include +#ifdef _WIN32 +#include +#endif + #include "fwupd-error.h" #include "fu-common.h" @@ -73,7 +77,7 @@ G_DEFINE_TYPE(FuSmbios, fu_smbios, FU_TYPE_FIRMWARE) static void -fu_smbios_convert_dt_value(FuSmbios *self, guint8 type, guint8 offset, guint8 value) +fu_smbios_set_integer(FuSmbios *self, guint8 type, guint8 offset, guint8 value) { FuSmbiosItem *item = g_ptr_array_index(self->items, type); for (guint i = item->buf->len; i < (guint)offset + 1; i++) @@ -82,37 +86,64 @@ } static void +fu_smbios_set_string(FuSmbios *self, guint8 type, guint8 offset, const gchar *buf, gssize bufsz) +{ + FuSmbiosItem *item = g_ptr_array_index(self->items, type); + + /* NUL terminated UTF-8 */ + if (bufsz < 0) + bufsz = strlen(buf); + + /* add value to string table */ + g_ptr_array_add(item->strings, g_strndup(buf, (gsize)bufsz)); + fu_smbios_set_integer(self, type, offset, item->strings->len); +} + +static gboolean fu_smbios_convert_dt_string(FuSmbios *self, guint8 type, guint8 offset, const gchar *path, const gchar *subpath) { - FuSmbiosItem *item = g_ptr_array_index(self->items, type); gsize bufsz = 0; g_autofree gchar *fn = g_build_filename(path, subpath, NULL); g_autofree gchar *buf = NULL; /* not found */ if (!g_file_get_contents(fn, &buf, &bufsz, NULL)) - return; - - /* add to strtab */ - g_ptr_array_add(item->strings, g_strndup(buf, bufsz)); - fu_smbios_convert_dt_value(self, type, offset, item->strings->len); + return FALSE; + if (bufsz == 0) + return FALSE; + fu_smbios_set_string(self, type, offset, buf, (gssize)bufsz); + return TRUE; } -#ifdef HAVE_KENV_H -static void -fu_smbios_kenv_sysctl_string(FuSmbios *self, guint8 type, guint8 offset, const gchar *buf) +static gchar ** +fu_smbios_convert_dt_string_array(FuSmbios *self, const gchar *path, const gchar *subpath) { - FuSmbiosItem *item = g_ptr_array_index(self->items, type); + gsize bufsz = 0; + g_autofree gchar *fn = g_build_filename(path, subpath, NULL); + g_autofree gchar *buf = NULL; + g_auto(GStrv) split = NULL; + + /* not found */ + if (!g_file_get_contents(fn, &buf, &bufsz, NULL)) + return NULL; + if (bufsz == 0) + return NULL; + + /* return only if valid */ + split = g_strsplit(buf, ",", -1); + if (g_strv_length(split) == 0) + return NULL; - /* add to strtab */ - g_ptr_array_add(item->strings, g_strdup(buf)); - fu_smbios_convert_dt_value(self, type, offset, item->strings->len); + /* success */ + return g_steal_pointer(&split); } +#ifdef HAVE_KENV_H + static gboolean fu_smbios_convert_kenv_string(FuSmbios *self, guint8 type, @@ -123,7 +154,7 @@ g_autofree gchar *value = fu_kenv_get_string(sminfo, error); if (value == NULL) return FALSE; - fu_smbios_kenv_sysctl_string(self, type, offset, value); + fu_smbios_set_string(self, type, offset, value, -1); return TRUE; } @@ -216,6 +247,9 @@ static gboolean fu_smbios_setup_from_path_dt(FuSmbios *self, const gchar *path, GError **error) { + gboolean has_family; + gboolean has_model; + gboolean has_vendor; g_autofree gchar *fn_battery = NULL; /* add all four faked structures */ @@ -230,24 +264,60 @@ /* if it has a battery it is portable (probably a laptop) */ fn_battery = g_build_filename(path, "battery", NULL); if (g_file_test(fn_battery, G_FILE_TEST_EXISTS)) { - fu_smbios_convert_dt_value(self, - FU_SMBIOS_STRUCTURE_TYPE_CHASSIS, - 0x05, - FU_SMBIOS_CHASSIS_KIND_PORTABLE); + fu_smbios_set_integer(self, + FU_SMBIOS_STRUCTURE_TYPE_CHASSIS, + 0x05, + FU_SMBIOS_CHASSIS_KIND_PORTABLE); } /* DMI:Manufacturer */ - fu_smbios_convert_dt_string(self, FU_SMBIOS_STRUCTURE_TYPE_SYSTEM, 0x04, path, "vendor"); + has_vendor = fu_smbios_convert_dt_string(self, + FU_SMBIOS_STRUCTURE_TYPE_SYSTEM, + 0x04, + path, + "vendor"); /* DMI:Family */ - fu_smbios_convert_dt_string(self, - FU_SMBIOS_STRUCTURE_TYPE_SYSTEM, - 0x1a, - path, - "model-name"); + has_family = fu_smbios_convert_dt_string(self, + FU_SMBIOS_STRUCTURE_TYPE_SYSTEM, + 0x1a, + path, + "model-name"); /* DMI:ProductName */ - fu_smbios_convert_dt_string(self, FU_SMBIOS_STRUCTURE_TYPE_SYSTEM, 0x05, path, "model"); + has_model = + fu_smbios_convert_dt_string(self, FU_SMBIOS_STRUCTURE_TYPE_SYSTEM, 0x05, path, "model"); + + /* fall back to the first compatible string if required */ + if (!has_vendor || !has_model || !has_family) { + g_auto(GStrv) parts = NULL; + + /* NULL if invalid, otherwise we're sure this has size of exactly 3 */ + parts = fu_smbios_convert_dt_string_array(self, path, "compatible"); + if (parts != NULL) { + if (!has_vendor && g_strv_length(parts) > 0) { + fu_smbios_set_string(self, + FU_SMBIOS_STRUCTURE_TYPE_SYSTEM, + 0x4, + parts[0], + -1); + } + if (!has_model && g_strv_length(parts) > 1) { + fu_smbios_set_string(self, + FU_SMBIOS_STRUCTURE_TYPE_SYSTEM, + 0x05, + parts[1], + -1); + } + if (!has_family && g_strv_length(parts) > 2) { + fu_smbios_set_string(self, + FU_SMBIOS_STRUCTURE_TYPE_SYSTEM, + 0x1a, + parts[2], + -1); + } + } + } /* DMI:BiosVersion */ fu_smbios_convert_dt_string(self, @@ -375,24 +445,19 @@ static gboolean fu_smbios_encode_string_from_kernel(FuSmbios *self, const gchar *file_contents, - guint8 smbios_type, - guint8 smbios_offset, + guint8 type, + guint8 offset, GError **error) { - FuSmbiosItem *item = g_ptr_array_index(self->items, smbios_type); - - /* add value to string table */ - g_ptr_array_add(item->strings, g_strdup(file_contents)); - /* add string table index to SMBIOS table */ - fu_smbios_convert_dt_value(self, smbios_type, smbios_offset, item->strings->len); + fu_smbios_set_string(self, type, offset, file_contents, -1); return TRUE; } static gboolean fu_smbios_encode_byte_from_kernel(FuSmbios *self, const gchar *file_contents, - guint8 smbios_type, - guint8 smbios_offset, + guint8 type, + guint8 offset, GError **error) { gchar *endp; @@ -415,7 +480,7 @@ return FALSE; } - fu_smbios_convert_dt_value(self, smbios_type, smbios_offset, value); + fu_smbios_set_integer(self, type, offset, value); return TRUE; } @@ -727,6 +792,13 @@ return fu_smbios_setup_from_path_dmi(self, path, error); } +#ifdef _WIN32 +#define FU_SMBIOS_FT_SIG_ACPI 0x41435049 +#define FU_SMBIOS_FT_SIG_FIRM 0x4649524D +#define FU_SMBIOS_FT_SIG_RSMB 0x52534D42 +#define FU_SMBIOS_FT_RAW_OFFSET 0x08 +#endif + /** * fu_smbios_setup: * @self: a #FuSmbios @@ -741,6 +813,43 @@ gboolean fu_smbios_setup(FuSmbios *self, GError **error) { +#ifdef _WIN32 + gsize bufsz; + guint rc; + g_autofree guint8 *buf = NULL; + + rc = GetSystemFirmwareTable(FU_SMBIOS_FT_SIG_RSMB, 0, 0, 0); + if (rc <= 0) { + g_set_error(error, + FWUPD_ERROR, + FWUPD_ERROR_INVALID_FILE, + "failed to access RSMB [%u]", + (guint)GetLastError()); + return FALSE; + } + if (rc < FU_SMBIOS_FT_RAW_OFFSET || rc > 0x1000000) { + g_set_error_literal(error, + FWUPD_ERROR, + FWUPD_ERROR_INVALID_FILE, + "RSMB impossible size"); + return FALSE; + } + bufsz = rc; + buf = g_malloc0(bufsz); + rc = GetSystemFirmwareTable(FU_SMBIOS_FT_SIG_RSMB, 0, buf, (DWORD)bufsz); + if (rc <= 0) { + g_set_error(error, + FWUPD_ERROR, + FWUPD_ERROR_INVALID_FILE, + "failed to read RSMB [%u]", + (guint)GetLastError()); + return FALSE; + } + return fu_smbios_setup_from_data(self, + buf + FU_SMBIOS_FT_RAW_OFFSET, + bufsz - FU_SMBIOS_FT_RAW_OFFSET, + error); +#else g_autofree gchar *path = NULL; g_autofree gchar *path_dt = NULL; g_autofree gchar *sysfsfwdir = NULL; @@ -786,6 +895,7 @@ FWUPD_ERROR_INVALID_FILE, "neither SMBIOS or DT found"); return FALSE; +#endif } static void Binary files /tmp/tmp2nqwzapu/4t3pkQWq0t/fwupd-1.7.4/libfwupdplugin/tests/devicetree/base/compatible and /tmp/tmp2nqwzapu/NRHidf8Vnd/fwupd-1.7.5/libfwupdplugin/tests/devicetree/base/compatible differ Binary files /tmp/tmp2nqwzapu/4t3pkQWq0t/fwupd-1.7.4/libfwupdplugin/tests/devicetree-fallback/base/compatible and /tmp/tmp2nqwzapu/NRHidf8Vnd/fwupd-1.7.5/libfwupdplugin/tests/devicetree-fallback/base/compatible differ diff -Nru fwupd-1.7.4/meson.build fwupd-1.7.5/meson.build --- fwupd-1.7.4/meson.build 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/meson.build 2022-02-07 16:24:38.000000000 +0000 @@ -1,5 +1,5 @@ project('fwupd', 'c', - version : '1.7.4', + version : '1.7.5', license : 'LGPL-2.1+', meson_version : '>=0.50.0', default_options : ['warning_level=2', 'c_std=c99'], @@ -108,6 +108,9 @@ '-Wvla', '-Wwrite-strings' ] +if get_option('static_analysis') and host_machine.system() != 'windows' + warning_flags += ['-fanalyzer', '-Wno-analyzer-null-dereference'] +endif cc = meson.get_compiler('c') add_project_arguments(cc.get_supported_arguments(warning_flags), language : 'c') @@ -412,6 +415,11 @@ if build_standalone and get_option('plugin_uefi_capsule') efiboot = dependency('efiboot') + efivar = dependency('efivar') + if cc.has_header_symbol('efivar/efivar-types.h', 'efi_time_t', dependencies : efivar) + conf.set('HAVE_EFI_TIME_T', '1') + endif + efi_app_location = join_paths(libexecdir, 'fwupd', 'efi') conf.set_quoted('EFI_APP_LOCATION', efi_app_location) diff -Nru fwupd-1.7.4/meson_options.txt fwupd-1.7.5/meson_options.txt --- fwupd-1.7.4/meson_options.txt 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/meson_options.txt 2022-02-07 16:24:38.000000000 +0000 @@ -1,5 +1,6 @@ option('build', type : 'combo', choices : ['all', 'standalone', 'library'], value : 'all', description : 'build type') option('consolekit', type : 'boolean', value : true, description : 'enable ConsoleKit support') +option('static_analysis', type : 'boolean', value : false, description : 'enable GCC static analysis support') option('firmware-packager', type : 'boolean', value : true, description : 'enable firmware-packager installation') option('docs', type : 'combo', choices : ['none', 'gtkdoc', 'docgen'], value : 'docgen', description : 'developer documentation type') option('introspection', type : 'boolean', value : true, description : 'generate GObject Introspection data') diff -Nru fwupd-1.7.4/plugins/analogix/analogix.quirk fwupd-1.7.5/plugins/analogix/analogix.quirk --- fwupd-1.7.4/plugins/analogix/analogix.quirk 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/analogix/analogix.quirk 2022-02-07 16:24:38.000000000 +0000 @@ -1,3 +1,15 @@ # Phoenix-Lite [USB\VID_1F29&PID_7518] Plugin = analogix + +# Belkin +[USB\VID_050D&PID_008B] +Plugin = analogix + +# Kensington +[USB\VID_047D&PID_80C8] +Plugin = analogix + +# ACER +[USB\VID_0502&PID_04C4] +Plugin = analogix diff -Nru fwupd-1.7.4/plugins/analogix/fu-analogix-device.c fwupd-1.7.5/plugins/analogix/fu-analogix-device.c --- fwupd-1.7.4/plugins/analogix/fu-analogix-device.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/analogix/fu-analogix-device.c 2022-02-07 16:24:38.000000000 +0000 @@ -411,7 +411,6 @@ fu_device_add_flag(FU_DEVICE(self), FWUPD_DEVICE_FLAG_UPDATABLE); fu_device_add_flag(FU_DEVICE(self), FWUPD_DEVICE_FLAG_USABLE_DURING_UPDATE); fu_device_set_version_format(FU_DEVICE(self), FWUPD_VERSION_FORMAT_PAIR); - fu_device_set_vendor(FU_DEVICE(self), "Analogix Semiconductor Inc."); fu_device_set_firmware_gtype(FU_DEVICE(self), FU_TYPE_ANALOGIX_FIRMWARE); } diff -Nru fwupd-1.7.4/plugins/analogix/README.md fwupd-1.7.5/plugins/analogix/README.md --- fwupd-1.7.4/plugins/analogix/README.md 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/analogix/README.md 2022-02-07 16:24:38.000000000 +0000 @@ -22,6 +22,9 @@ These devices use the standard USB DeviceInstanceId values, e.g. * `USB\VID_1F29&PID_7518` +* `USB\VID_050D&PID_008B` +* `USB\VID_047D&PID_80C8` +* `USB\VID_0502&PID_04C4` ## Update Behavior @@ -32,6 +35,9 @@ The vendor ID is set from the USB vendor. The list of USB VIDs used is: * `USB:0x1F29` +* `USB:0x050D` +* `USB:0x047D` +* `USB:0x0502` ## External Interface Access diff -Nru fwupd-1.7.4/plugins/ata/meson.build fwupd-1.7.5/plugins/ata/meson.build --- fwupd-1.7.4/plugins/ata/meson.build 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/ata/meson.build 2022-02-07 16:24:38.000000000 +0000 @@ -37,6 +37,7 @@ env = environment() env.set('G_TEST_SRCDIR', meson.current_source_dir()) env.set('G_TEST_BUILDDIR', meson.current_build_dir()) + env.set('FWUPD_DATADIR_QUIRKS', meson.current_source_dir()) e = executable( 'ata-self-test', fu_hash, diff -Nru fwupd-1.7.4/plugins/dell-dock/fu-dell-dock-common.c fwupd-1.7.5/plugins/dell-dock/fu-dell-dock-common.c --- fwupd-1.7.4/plugins/dell-dock/fu-dell-dock-common.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/dell-dock/fu-dell-dock-common.c 2022-02-07 16:24:38.000000000 +0000 @@ -59,20 +59,3 @@ fu_device_set_remove_delay(device, timeout * 1000); fu_device_add_flag(device, FWUPD_DEVICE_FLAG_WAIT_FOR_REPLUG); } - -void -fu_dell_dock_clone_updatable(FuDevice *device) -{ - FuDevice *parent; - parent = fu_device_get_parent(device); - if (parent == NULL) - return; - if (fu_device_has_flag(parent, FWUPD_DEVICE_FLAG_UPDATABLE)) { - fu_device_add_flag(device, FWUPD_DEVICE_FLAG_UPDATABLE); - } else { - const gchar *message = fu_device_get_update_error(parent); - if (message != NULL) - fu_device_set_update_error(device, message); - fu_device_remove_flag(device, FWUPD_DEVICE_FLAG_UPDATABLE); - } -} diff -Nru fwupd-1.7.4/plugins/dell-dock/fu-dell-dock-common.h fwupd-1.7.5/plugins/dell-dock/fu-dell-dock-common.h --- fwupd-1.7.4/plugins/dell-dock/fu-dell-dock-common.h 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/dell-dock/fu-dell-dock-common.h 2022-02-07 16:24:38.000000000 +0000 @@ -49,5 +49,3 @@ fu_dell_dock_set_power(FuDevice *device, guint8 target, gboolean enabled, GError **error); void fu_dell_dock_will_replug(FuDevice *device); -void -fu_dell_dock_clone_updatable(FuDevice *device); diff -Nru fwupd-1.7.4/plugins/dell-dock/fu-dell-dock-hub.c fwupd-1.7.5/plugins/dell-dock/fu-dell-dock-hub.c --- fwupd-1.7.4/plugins/dell-dock/fu-dell-dock-hub.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/dell-dock/fu-dell-dock-hub.c 2022-02-07 16:24:38.000000000 +0000 @@ -197,6 +197,7 @@ static void fu_dell_dock_hub_init(FuDellDockHub *self) { + fu_device_add_flag(FU_DEVICE(self), FWUPD_DEVICE_FLAG_UPDATABLE); fu_device_retry_set_delay(FU_DEVICE(self), 1000); fu_device_register_private_flag(FU_DEVICE(self), FU_DELL_DOCK_HUB_FLAG_HAS_BRIDGE, diff -Nru fwupd-1.7.4/plugins/dell-dock/fu-dell-dock-i2c-ec.c fwupd-1.7.5/plugins/dell-dock/fu-dell-dock-i2c-ec.c --- fwupd-1.7.4/plugins/dell-dock/fu-dell-dock-i2c-ec.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/dell-dock/fu-dell-dock-i2c-ec.c 2022-02-07 16:24:38.000000000 +0000 @@ -579,17 +579,16 @@ if (self->data->board_id >= self->board_min) { if (status != FW_UPDATE_IN_PROGRESS) { fu_dell_dock_ec_set_board(device); - fu_device_add_flag(device, FWUPD_DEVICE_FLAG_UPDATABLE); + fu_device_uninhibit(device, "update-pending"); } else { fu_device_add_flag(device, FWUPD_DEVICE_FLAG_NEEDS_ACTIVATION); - fu_device_set_update_error(device, - "A pending update will be completed " - "next time the dock is " - "unplugged from your computer"); + fu_device_inhibit(device, + "update-pending", + "A pending update will be completed next time the dock " + "is unplugged from your computer"); } } else { - g_warning("This utility does not support this board, disabling updates for %s", - fu_device_get_name(device)); + fu_device_inhibit(device, "not-supported", "Utility does not support this board"); } return TRUE; @@ -1014,6 +1013,8 @@ self->data = g_new0(FuDellDockDockDataStructure, 1); self->raw_versions = g_new0(FuDellDockDockPackageFWVersion, 1); fu_device_add_protocol(FU_DEVICE(self), "com.dell.dock"); + fu_device_add_flag(FU_DEVICE(self), FWUPD_DEVICE_FLAG_UPDATABLE); + fu_device_add_internal_flag(FU_DEVICE(self), FU_DEVICE_INTERNAL_FLAG_INHIBIT_CHILDREN); } static void diff -Nru fwupd-1.7.4/plugins/dell-dock/fu-dell-dock-i2c-mst.c fwupd-1.7.5/plugins/dell-dock/fu-dell-dock-i2c-mst.c --- fwupd-1.7.4/plugins/dell-dock/fu-dell-dock-i2c-mst.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/dell-dock/fu-dell-dock-i2c-mst.c 2022-02-07 16:24:38.000000000 +0000 @@ -1153,8 +1153,6 @@ fu_device_set_version(device, version); } - fu_dell_dock_clone_updatable(device); - return TRUE; } @@ -1237,6 +1235,7 @@ fu_dell_dock_mst_init(FuDellDockMst *self) { fu_device_add_protocol(FU_DEVICE(self), "com.synaptics.mst"); + fu_device_add_flag(FU_DEVICE(self), FWUPD_DEVICE_FLAG_UPDATABLE); } static void diff -Nru fwupd-1.7.4/plugins/dell-dock/fu-dell-dock-i2c-tbt.c fwupd-1.7.5/plugins/dell-dock/fu-dell-dock-i2c-tbt.c --- fwupd-1.7.4/plugins/dell-dock/fu-dell-dock-i2c-tbt.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/dell-dock/fu-dell-dock-i2c-tbt.c 2022-02-07 16:24:38.000000000 +0000 @@ -215,8 +215,6 @@ return TRUE; } - fu_dell_dock_clone_updatable(device); - return TRUE; } @@ -275,6 +273,7 @@ fu_dell_dock_tbt_init(FuDellDockTbt *self) { fu_device_add_protocol(FU_DEVICE(self), "com.intel.thunderbolt"); + fu_device_add_flag(FU_DEVICE(self), FWUPD_DEVICE_FLAG_UPDATABLE); } static void diff -Nru fwupd-1.7.4/plugins/dell-dock/fu-dell-dock-status.c fwupd-1.7.5/plugins/dell-dock/fu-dell-dock-status.c --- fwupd-1.7.4/plugins/dell-dock/fu-dell-dock-status.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/dell-dock/fu-dell-dock-status.c 2022-02-07 16:24:38.000000000 +0000 @@ -51,9 +51,6 @@ fu_device_set_version_format(device, FWUPD_VERSION_FORMAT_QUAD); fu_device_set_version(device, dynamic_version); fu_device_set_logical_id(FU_DEVICE(device), "status"); - - fu_dell_dock_clone_updatable(device); - return TRUE; } @@ -160,6 +157,7 @@ fu_dell_dock_status_init(FuDellDockStatus *self) { fu_device_add_protocol(FU_DEVICE(self), "com.dell.dock"); + fu_device_add_flag(FU_DEVICE(self), FWUPD_DEVICE_FLAG_UPDATABLE); } static void diff -Nru fwupd-1.7.4/plugins/dell-dock/fu-dell-dock-usb-usb4.c fwupd-1.7.5/plugins/dell-dock/fu-dell-dock-usb-usb4.c --- fwupd-1.7.4/plugins/dell-dock/fu-dell-dock-usb-usb4.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/dell-dock/fu-dell-dock-usb-usb4.c 2022-02-07 16:24:38.000000000 +0000 @@ -575,9 +575,6 @@ self->intf_nr = GR_USB_INTERFACE_NUMBER; self->blocksz = GR_USB_BLOCK_SIZE; fu_device_set_logical_id(FU_DEVICE(device), "usb4"); - fu_device_add_flag(device, FWUPD_DEVICE_FLAG_USABLE_DURING_UPDATE); - fu_device_add_flag(device, FWUPD_DEVICE_FLAG_UPDATABLE); - fu_device_add_internal_flag(FU_DEVICE(self), FU_DEVICE_INTERNAL_FLAG_INHERIT_ACTIVATION); return TRUE; } @@ -591,6 +588,9 @@ fu_dell_dock_usb4_init(FuDellDockUsb4 *self) { fu_device_add_protocol(FU_DEVICE(self), "com.intel.thunderbolt"); + fu_device_add_flag(FU_DEVICE(self), FWUPD_DEVICE_FLAG_USABLE_DURING_UPDATE); + fu_device_add_flag(FU_DEVICE(self), FWUPD_DEVICE_FLAG_UPDATABLE); + fu_device_add_internal_flag(FU_DEVICE(self), FU_DEVICE_INTERNAL_FLAG_INHERIT_ACTIVATION); } static void diff -Nru fwupd-1.7.4/plugins/dell-dock/fu-plugin-dell-dock.c fwupd-1.7.5/plugins/dell-dock/fu-plugin-dell-dock.c --- fwupd-1.7.4/plugins/dell-dock/fu-plugin-dell-dock.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/dell-dock/fu-plugin-dell-dock.c 2022-02-07 16:24:38.000000000 +0000 @@ -139,15 +139,22 @@ const gchar *key = NULL; GPtrArray *devices; FuDevice *ec_device; - guint8 ec_type; + guint device_vid; + guint device_pid; /* not interesting */ if (!FU_IS_USB_DEVICE(device)) return TRUE; + device_vid = (guint)fu_usb_device_get_vid(FU_USB_DEVICE(device)); + device_pid = (guint)fu_usb_device_get_pid(FU_USB_DEVICE(device)); + g_debug("%s: processing usb device, vid: 0x%x, pid: 0x%x", + fu_plugin_get_name(plugin), + device_vid, + device_pid); + /* GR controller internal USB HUB */ - if ((guint)fu_usb_device_get_vid(FU_USB_DEVICE(device)) == GR_USB_VID && - (guint)fu_usb_device_get_pid(FU_USB_DEVICE(device)) == GR_USB_PID) { + if (device_vid == GR_USB_VID && device_pid == GR_USB_PID) { g_autoptr(FuDellDockUsb4) usb4_dev = NULL; usb4_dev = fu_dell_dock_usb4_new(FU_USB_DEVICE(device)); locker = fu_device_locker_new(FU_DEVICE(usb4_dev), error); @@ -178,14 +185,11 @@ /* add hub instance id after ec probed */ devices = fu_plugin_get_devices(plugin); ec_device = fu_plugin_dell_dock_get_ec(devices); - ec_type = fu_dell_dock_get_ec_type(ec_device); - fu_dell_dock_hub_add_instance(FU_DEVICE(hub), ec_type); - + if (ec_device != NULL) { + guint8 ec_type = fu_dell_dock_get_ec_type(ec_device); + fu_dell_dock_hub_add_instance(FU_DEVICE(hub), ec_type); + } fu_plugin_device_add(plugin, FU_DEVICE(hub)); - - /* clear updatable flag if parent doesn't have it */ - fu_dell_dock_clone_updatable(FU_DEVICE(hub)); - return TRUE; } @@ -233,12 +237,6 @@ if (g_strcmp0(fu_device_get_plugin(device), "dell_dock") == 0 && (FU_IS_DELL_DOCK_EC(device) || FU_IS_DELL_DOCK_USB4(device))) fu_plugin_dell_dock_separate_activation(plugin); - - if (g_strcmp0(fu_device_get_plugin(device), "thunderbolt") != 0 || - fu_device_has_flag(device, FWUPD_DEVICE_FLAG_INTERNAL)) - return; - /* clone updatable flag to leave in needs activation state */ - fu_dell_dock_clone_updatable(device); } static gboolean diff -Nru fwupd-1.7.4/plugins/ebitdo/ebitdo-legacy.quirk fwupd-1.7.5/plugins/ebitdo/ebitdo-legacy.quirk --- fwupd-1.7.4/plugins/ebitdo/ebitdo-legacy.quirk 1970-01-01 00:00:00.000000000 +0000 +++ fwupd-1.7.5/plugins/ebitdo/ebitdo-legacy.quirk 2022-02-07 16:24:38.000000000 +0000 @@ -0,0 +1,9 @@ +# This is the ID assigned to STMicroelectronics, and also seems to be used by other vendors who +# did not change the default from the devkit. Install this quirk file if your 8bitdo controller +# uses the legacy bootloader from 2018. +# +# See https://github.com/fwupd/fwupd/issues/4180 for more information + +[USB\VID_0483&PID_5750] +Plugin = ebitdo +Flags = is-bootloader diff -Nru fwupd-1.7.4/plugins/ebitdo/ebitdo.quirk fwupd-1.7.5/plugins/ebitdo/ebitdo.quirk --- fwupd-1.7.4/plugins/ebitdo/ebitdo.quirk 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/ebitdo/ebitdo.quirk 2022-02-07 16:24:38.000000000 +0000 @@ -1,7 +1,4 @@ # bootloader -[USB\VID_0483&PID_5750] -Plugin = ebitdo -Flags = is-bootloader [USB\VID_2DC8&PID_5750] Plugin = ebitdo Flags = is-bootloader diff -Nru fwupd-1.7.4/plugins/flashrom/flashrom.quirk fwupd-1.7.5/plugins/flashrom/flashrom.quirk --- fwupd-1.7.4/plugins/flashrom/flashrom.quirk 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/flashrom/flashrom.quirk 2022-02-07 16:24:38.000000000 +0000 @@ -44,3 +44,11 @@ Branch = coreboot VersionFormat = plain Flags = reset-cmos + +# NovaCustom NV4x (HwId) +[25b6ea34-8f52-598e-a27a-31e03014dbe3] +Plugin = flashrom + +# NovaCustom NV4x (Dasharo GUID) +[9a8c30e2-1b7e-5b28-9632-fc2fbf8cd0ba] +Branch = dasharo diff -Nru fwupd-1.7.4/plugins/modem-manager/fu-firehose-updater.c fwupd-1.7.5/plugins/modem-manager/fu-firehose-updater.c --- fwupd-1.7.4/plugins/modem-manager/fu-firehose-updater.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/modem-manager/fu-firehose-updater.c 2022-02-07 16:24:38.000000000 +0000 @@ -188,6 +188,15 @@ gboolean fu_firehose_updater_open(FuFirehoseUpdater *self, GError **error) { + /* sanity check */ + if (self->port == NULL) { + g_set_error_literal(error, + FWUPD_ERROR, + FWUPD_ERROR_NOT_SUPPORTED, + "no firehose port provided for filename"); + return FALSE; + } + g_debug("opening firehose port..."); self->io_channel = fu_io_channel_new_file(self->port, error); return (self->io_channel != NULL); diff -Nru fwupd-1.7.4/plugins/modem-manager/fu-mm-device.c fwupd-1.7.5/plugins/modem-manager/fu-mm-device.c --- fwupd-1.7.4/plugins/modem-manager/fu-mm-device.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/modem-manager/fu-mm-device.c 2022-02-07 16:24:38.000000000 +0000 @@ -551,6 +551,15 @@ static gboolean fu_mm_device_io_open_qcdm(FuMmDevice *self, GError **error) { + /* sanity check */ + if (self->port_qcdm == NULL) { + g_set_error_literal(error, + FWUPD_ERROR, + FWUPD_ERROR_NOT_SUPPORTED, + "no QCDM port provided for filename"); + return FALSE; + } + /* open device */ self->io_channel = fu_io_channel_new_file(self->port_qcdm, error); if (self->io_channel == NULL) @@ -695,6 +704,15 @@ static gboolean fu_mm_device_io_open(FuMmDevice *self, GError **error) { + /* sanity check */ + if (self->port_at == NULL) { + g_set_error_literal(error, + FWUPD_ERROR, + FWUPD_ERROR_NOT_SUPPORTED, + "no AT port provided for filename"); + return FALSE; + } + /* open device */ self->io_channel = fu_io_channel_new_file(self->port_at, error); if (self->io_channel == NULL) @@ -1547,28 +1565,39 @@ } static gboolean -fu_mm_device_setup(FuDevice *device, GError **error) +fu_mm_device_setup_branch_at(FuMmDevice *self, GError **error) { - FuMmDevice *self = FU_MM_DEVICE(device); g_autoptr(FuDeviceLocker) locker = NULL; /* Create IO channel to send AT commands to the modem */ - locker = fu_device_locker_new_full(device, + locker = fu_device_locker_new_full(self, (FuDeviceLockerFunc)fu_mm_device_io_open, (FuDeviceLockerFunc)fu_mm_device_io_close, error); if (locker == NULL) return FALSE; - /* - * firmware branch AT command may fail if not implemented, - * clear error if not supported - */ + + /* firmware branch AT command may fail if not implemented, + * clear error if not supported */ if (self->branch_at != NULL) { g_autoptr(GError) error_branch = NULL; if (!fu_mm_device_at_cmd(self, self->branch_at, TRUE, &error_branch)) g_debug("unable to get firmware branch: %s", error_branch->message); } + /* success */ + return TRUE; +} + +static gboolean +fu_mm_device_setup(FuDevice *device, GError **error) +{ + FuMmDevice *self = FU_MM_DEVICE(device); + + if (self->port_at != NULL) { + if (!fu_mm_device_setup_branch_at(self, error)) + return FALSE; + } if (fu_device_get_branch(device) != NULL) g_debug("using firmware branch: %s", fu_device_get_branch(device)); else @@ -1595,6 +1624,7 @@ fu_device_add_flag(FU_DEVICE(self), FWUPD_DEVICE_FLAG_USE_RUNTIME_VERSION); fu_device_add_flag(FU_DEVICE(self), FWUPD_DEVICE_FLAG_REQUIRE_AC); fu_device_add_internal_flag(FU_DEVICE(self), FU_DEVICE_INTERNAL_FLAG_REPLUG_MATCH_GUID); + fu_device_add_internal_flag(FU_DEVICE(self), FU_DEVICE_INTERNAL_FLAG_MD_SET_VERFMT); fu_device_set_version_format(FU_DEVICE(self), FWUPD_VERSION_FORMAT_PLAIN); fu_device_set_summary(FU_DEVICE(self), "Mobile broadband device"); fu_device_add_icon(FU_DEVICE(self), "network-modem"); diff -Nru fwupd-1.7.4/plugins/modem-manager/fu-mm-device.h fwupd-1.7.5/plugins/modem-manager/fu-mm-device.h --- fwupd-1.7.4/plugins/modem-manager/fu-mm-device.h 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/modem-manager/fu-mm-device.h 2022-02-07 16:24:38.000000000 +0000 @@ -31,9 +31,7 @@ fu_mm_device_get_update_methods(FuMmDevice *device); /* support for udev-based devices */ - -typedef struct FuPluginMmInhibitedDeviceInfo FuPluginMmInhibitedDeviceInfo; -struct FuPluginMmInhibitedDeviceInfo { +typedef struct { gchar *inhibited_uid; gchar *physical_id; gchar *vendor; @@ -45,7 +43,8 @@ gint port_at_ifnum; gint port_qmi_ifnum; gint port_mbim_ifnum; -}; +} FuPluginMmInhibitedDeviceInfo; + FuPluginMmInhibitedDeviceInfo * fu_plugin_mm_inhibited_device_info_new(FuMmDevice *device); void diff -Nru fwupd-1.7.4/plugins/modem-manager/fu-plugin-modem-manager.c fwupd-1.7.5/plugins/modem-manager/fu-plugin-modem-manager.c --- fwupd-1.7.4/plugins/modem-manager/fu-plugin-modem-manager.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/modem-manager/fu-plugin-modem-manager.c 2022-02-07 16:24:38.000000000 +0000 @@ -18,8 +18,6 @@ /* amount of time to wait for ports of the same device being exposed by kernel */ #define FU_MM_UDEV_DEVICE_PORTS_TIMEOUT 3 /* s */ -typedef struct FuPluginMmInhibitedDeviceInfo FuPluginMmInhibitedDeviceInfo; - struct FuPluginData { MMManager *manager; gboolean manager_ready; @@ -128,6 +126,10 @@ fu_plugin_mm_udev_device_ports_timeout_reset(plugin); return; } + + /* device is being created, update is complete, uninhibit */ + fu_plugin_mm_uninhibit_device(plugin); + /* create device and add to cache */ dev = fu_mm_device_udev_new(fu_plugin_get_context(plugin), priv->manager, priv->inhibited); fu_mm_device_udev_add_port(dev, subsystem, path, ifnum); diff -Nru fwupd-1.7.4/plugins/msr/fu-plugin-msr.c fwupd-1.7.5/plugins/msr/fu-plugin-msr.c --- fwupd-1.7.4/plugins/msr/fu-plugin-msr.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/msr/fu-plugin-msr.c 2022-02-07 16:24:38.000000000 +0000 @@ -24,21 +24,32 @@ guint32 data; struct { guint32 unknown0 : 23; /* 0 -> 22 inc */ - guint32 sev_is_enabled : 1; + guint32 sme_is_enabled : 1; guint32 unknown1 : 8; } __attribute__((packed)) fields; -} FuMsrK8Syscfg; +} FuMsrAMD64Syscfg; + +typedef union { + guint32 data; + struct { + guint32 sev_is_enabled : 1; + guint32 unknown0 : 31; + } __attribute__((packed)) fields; +} FuMsrAMD64Sev; struct FuPluginData { gboolean ia32_debug_supported; FuMsrIa32Debug ia32_debug; - gboolean k8_syscfg_supported; - FuMsrK8Syscfg k8_syscfg; + gboolean amd64_syscfg_supported; + gboolean amd64_sev_supported; + FuMsrAMD64Syscfg amd64_syscfg; + FuMsrAMD64Sev amd64_sev; }; #define PCI_MSR_IA32_DEBUG_INTERFACE 0xc80 #define PCI_MSR_IA32_BIOS_SIGN_ID 0x8b -#define PCI_MSR_K8_SYSCFG 0xC0010010 +#define PCI_MSR_AMD64_SYSCFG 0xC0010010 +#define PCI_MSR_AMD64_SEV 0xC0010131 static void fu_plugin_msr_init(FuPlugin *plugin) @@ -52,6 +63,7 @@ { FuPluginData *priv = fu_plugin_get_data(plugin); guint eax = 0; + guint ebx = 0; guint ecx = 0; if (!g_file_test("/dev/cpu", G_FILE_TEST_IS_DIR)) { @@ -69,11 +81,13 @@ priv->ia32_debug_supported = ((ecx >> 11) & 0x1) > 0; } - /* indicates support for SEV */ + /* indicates support for SME and SEV */ if (fu_common_get_cpu_vendor() == FU_CPU_VENDOR_AMD) { - if (!fu_common_cpuid(0x8000001f, &eax, NULL, NULL, NULL, error)) + if (!fu_common_cpuid(0x8000001f, &eax, &ebx, NULL, NULL, error)) return FALSE; - priv->k8_syscfg_supported = ((eax >> 0) & 0x1) > 0; + g_debug("SME/SEV check MSR: eax 0%x, ebx 0%x", eax, ebx); + priv->amd64_syscfg_supported = ((eax >> 0) & 0x1) > 0; + priv->amd64_sev_supported = ((eax >> 1) & 0x1) > 0; } return TRUE; @@ -105,7 +119,7 @@ if (locker == NULL) return FALSE; - /* grab MSR */ + /* grab Intel MSR */ if (priv->ia32_debug_supported) { if (!fu_udev_device_pread_full(FU_UDEV_DEVICE(device), PCI_MSR_IA32_DEBUG_INTERFACE, @@ -128,24 +142,46 @@ priv->ia32_debug.fields.debug_occurred); } - /* grab MSR */ - if (priv->k8_syscfg_supported) { + /* grab AMD MSRs */ + if (priv->amd64_syscfg_supported) { + if (!fu_udev_device_pread_full(FU_UDEV_DEVICE(device), + PCI_MSR_AMD64_SYSCFG, + buf, + sizeof(buf), + error)) { + g_prefix_error(error, "could not read PCI_MSR_AMD64_SYSCFG: "); + return FALSE; + } + if (!fu_common_read_uint32_safe(buf, + sizeof(buf), + 0x0, + &priv->amd64_syscfg.data, + G_LITTLE_ENDIAN, + error)) + return FALSE; + g_debug("PCI_MSR_AMD64_SYSCFG: 0%x, sme_is_enabled=%i", + priv->amd64_syscfg.data, + priv->amd64_syscfg.fields.sme_is_enabled); + } + if (priv->amd64_sev_supported) { if (!fu_udev_device_pread_full(FU_UDEV_DEVICE(device), - PCI_MSR_K8_SYSCFG, + PCI_MSR_AMD64_SEV, buf, sizeof(buf), error)) { - g_prefix_error(error, "could not read MSR_K8_SYSCFG: "); + g_prefix_error(error, "could not read PCI_MSR_AMD64_SEV: "); return FALSE; } if (!fu_common_read_uint32_safe(buf, sizeof(buf), 0x0, - &priv->k8_syscfg.data, + &priv->amd64_sev.data, G_LITTLE_ENDIAN, error)) return FALSE; - g_debug("MSR_K8_SYSCFG: sev_is_enabled=%i", priv->k8_syscfg.fields.sev_is_enabled); + g_debug("PCI_MSR_AMD64_SEV: 0%x, sev_is_enabled=%i", + priv->amd64_sev.data, + priv->amd64_sev.fields.sev_is_enabled); } /* get microcode version */ @@ -255,45 +291,10 @@ } static void -fu_plugin_add_security_attr_amd_tsme_enabled(FuPlugin *plugin, FuSecurityAttrs *attrs) -{ - FuPluginData *priv = fu_plugin_get_data(plugin); - FuDevice *device = fu_plugin_cache_lookup(plugin, "cpu"); - g_autoptr(FwupdSecurityAttr) attr = NULL; - - /* this MSR is only valid for a subset of AMD CPUs */ - if (fu_common_get_cpu_vendor() != FU_CPU_VENDOR_AMD) - return; - - /* create attr */ - attr = fwupd_security_attr_new(FWUPD_SECURITY_ATTR_ID_ENCRYPTED_RAM); - fwupd_security_attr_set_plugin(attr, fu_plugin_get_name(plugin)); - fwupd_security_attr_set_level(attr, FWUPD_SECURITY_ATTR_LEVEL_SYSTEM_PROTECTION); - if (device != NULL) - fwupd_security_attr_add_guids(attr, fu_device_get_guids(device)); - fu_security_attrs_append(attrs, attr); - - /* check fields */ - if (!priv->k8_syscfg_supported) { - fwupd_security_attr_set_result(attr, FWUPD_SECURITY_ATTR_RESULT_NOT_SUPPORTED); - return; - } - if (!priv->k8_syscfg.fields.sev_is_enabled) { - fwupd_security_attr_set_result(attr, FWUPD_SECURITY_ATTR_RESULT_NOT_ENABLED); - return; - } - - /* success */ - fwupd_security_attr_add_flag(attr, FWUPD_SECURITY_ATTR_FLAG_SUCCESS); - fwupd_security_attr_set_result(attr, FWUPD_SECURITY_ATTR_RESULT_ENABLED); -} - -static void fu_plugin_msr_add_security_attrs(FuPlugin *plugin, FuSecurityAttrs *attrs) { fu_plugin_add_security_attr_dci_enabled(plugin, attrs); fu_plugin_add_security_attr_dci_locked(plugin, attrs); - fu_plugin_add_security_attr_amd_tsme_enabled(plugin, attrs); } void diff -Nru fwupd-1.7.4/plugins/nordic-hid/fu-nordic-hid-cfg-channel.c fwupd-1.7.5/plugins/nordic-hid/fu-nordic-hid-cfg-channel.c --- fwupd-1.7.4/plugins/nordic-hid/fu-nordic-hid-cfg-channel.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/nordic-hid/fu-nordic-hid-cfg-channel.c 2022-02-07 16:24:38.000000000 +0000 @@ -493,10 +493,10 @@ g_autoptr(FuNordicCfgChannelMsg) res = g_new0(FuNordicCfgChannelMsg, 1); /* query for the bootloader name if the board support it */ - if (fu_nordic_hid_cfg_channel_get_event_id(self, "dfu", "bootloader_var", &event_id)) { + if (fu_nordic_hid_cfg_channel_get_event_id(self, "dfu", "module_variant", &event_id)) { if (!fu_nordic_hid_cfg_channel_cmd_send(self, "dfu", - "bootloader_var", + "module_variant", CONFIG_STATUS_FETCH, NULL, 0, diff -Nru fwupd-1.7.4/plugins/nordic-hid/README.md fwupd-1.7.5/plugins/nordic-hid/README.md --- fwupd-1.7.4/plugins/nordic-hid/README.md 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/nordic-hid/README.md 2022-02-07 16:24:38.000000000 +0000 @@ -2,9 +2,13 @@ ## Introduction -This plugin is able flash the firmware on: +This plugin is able flash the firmware for the hardware supported by `nRF52-Desktop`. +Tested with the following devices: -* nRF52-Desktop: nrf52840dk development kit +* [nrf52840dk development kit](https://www.nordicsemi.com/Products/nRF52840) +* [nRF52840 Dongle](https://www.nordicsemi.com/Products/Development-hardware/nrf52840-dongle) +* nRF52840 Gaming Mouse +* nRF52832 Desktop Keyboard The plugin is using Nordic Semiconductor [HID config channel](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/applications/nrf_desktop/doc/config_channel.html) diff -Nru fwupd-1.7.4/plugins/nvme/meson.build fwupd-1.7.5/plugins/nvme/meson.build --- fwupd-1.7.4/plugins/nvme/meson.build 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/nvme/meson.build 2022-02-07 16:24:38.000000000 +0000 @@ -41,6 +41,7 @@ env = environment() env.set('G_TEST_SRCDIR', meson.current_source_dir()) env.set('G_TEST_BUILDDIR', meson.current_build_dir()) + env.set('FWUPD_DATADIR_QUIRKS', meson.current_source_dir()) e = executable( 'nvme-self-test', fu_hash, diff -Nru fwupd-1.7.4/plugins/redfish/fu-ipmi-device.c fwupd-1.7.5/plugins/redfish/fu-ipmi-device.c --- fwupd-1.7.4/plugins/redfish/fu-ipmi-device.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/redfish/fu-ipmi-device.c 2022-02-07 16:24:38.000000000 +0000 @@ -22,6 +22,9 @@ #define FU_IPMI_DEVICE_TIMEOUT 1500 /* ms */ +#define FU_IPMI_TRANSACTION_RETRY_COUNT 5 +#define FU_IPMI_TRANSACTION_RETRY_DELAY 200 /* ms */ + /* not defined in linux/ipmi_msgdefs.h */ #define IPMI_SET_USER_ACCESS 0x43 #define IPMI_SET_USER_NAME 0x45 @@ -33,6 +36,24 @@ #define IPMI_PASSWORD_SET_PASSWORD 0x02 #define IPMI_PASSWORD_TEST_PASSWORD 0x03 +/* these are not provided in ipmi_msgdefs.h */ +#define IPMI_INVALID_COMMAND_ON_LUN_ERR 0xC2 +#define IPMI_OUT_OF_SPACE_ERR 0xC4 +#define IPMI_CANCELLED_OR_INVALID_ERR 0xC5 +#define IPMI_OUT_OF_RANGE_ERR 0xC9 +#define IPMI_CANNOT_RETURN_DATA_ERR 0xCA +#define IPMI_NOT_FOUND_ERR 0xCB +#define IPMI_INVALID_DATA_FIELD_ERR 0xCC +#define IPMI_COMMAND_ILLEGAL_ERR 0xCD +#define IPMI_RESPONSE_NOT_PROVIDED_ERR 0xCE +#define IPMI_DUPLICATED_REQUEST_ERR 0xCF +#define IPMI_SDR_IN_UPDATE_MODE_ERR 0xD0 +#define IPMI_DEVICE_IN_UPDATE_MODE_ERR 0xD1 +#define IPMI_INITIALIZATION_IN_PROGRESS_ERR 0xD2 +#define IPMI_DESTINATION_UNAVAILABLE_ERR 0xD3 +#define IPMI_INSUFFICIENT_PRIVILEGE_ERR 0xD4 +#define IPMI_COMMAND_DISABLED_ERR 0xD6 + struct _FuIpmiDevice { FuUdevDevice parent_instance; glong seq; @@ -179,23 +200,88 @@ return "nak-on-write"; if (errcode == IPMI_ERR_UNSPECIFIED) return "unspecified"; - return "unspecified"; + /* these are not defined in ipmi_msgdefs.h but used in reality */ + if (errcode == IPMI_INVALID_COMMAND_ON_LUN_ERR) + return "invalid-command-on-lun"; + if (errcode == IPMI_OUT_OF_SPACE_ERR) + return "out-of-space"; + if (errcode == IPMI_CANCELLED_OR_INVALID_ERR) + return "cancelled-or-invalid"; + if (errcode == IPMI_OUT_OF_RANGE_ERR) + return "out-of-range"; + if (errcode == IPMI_CANNOT_RETURN_DATA_ERR) + return "cannot-return-data"; + if (errcode == IPMI_NOT_FOUND_ERR) + return "not-found"; + if (errcode == IPMI_INVALID_DATA_FIELD_ERR) + return "invalid-data-field"; + if (errcode == IPMI_COMMAND_ILLEGAL_ERR) + return "command-illegal"; + if (errcode == IPMI_RESPONSE_NOT_PROVIDED_ERR) + return "response-not-provided"; + if (errcode == IPMI_DUPLICATED_REQUEST_ERR) + return "duplicated-request"; + if (errcode == IPMI_SDR_IN_UPDATE_MODE_ERR) + return "sdr-in-update-mode"; + if (errcode == IPMI_DEVICE_IN_UPDATE_MODE_ERR) + return "device-in-update-mode"; + if (errcode == IPMI_INITIALIZATION_IN_PROGRESS_ERR) + return "initialization-in-progress"; + if (errcode == IPMI_DESTINATION_UNAVAILABLE_ERR) + return "destination-unavailable"; + if (errcode == IPMI_INSUFFICIENT_PRIVILEGE_ERR) + return "insufficient-privilege"; + if (errcode == IPMI_COMMAND_DISABLED_ERR) + return "command-disabled"; + return "unknown"; } static gboolean -fu_ipmi_device_transaction(FuIpmiDevice *self, - guint8 netfn, - guint8 cmd, - const guint8 *req_buf, - gsize req_bufsz, - guint8 *resp_buf, /* optional */ - gsize resp_bufsz, - gsize *resp_len, /* optional, out */ - gint timeout_ms, - GError **error) +fu_ipmi_device_errcode_to_error(guint8 errcode, GError **error) +{ + /* success */ + if (errcode == IPMI_CC_NO_ERROR) + return TRUE; + + /* data not found, seemingly Lenovo specific */ + if (errcode == IPMI_INVALID_DATA_FIELD_ERR || errcode == IPMI_NOT_FOUND_ERR) { + g_set_error(error, + G_IO_ERROR, + G_IO_ERROR_NOT_FOUND, + "CC error: %s [0x%02X]", + fu_ipmi_device_errcode_to_string(errcode), + errcode); + return FALSE; + } + + /* fallback */ + g_set_error(error, + G_IO_ERROR, + G_IO_ERROR_FAILED, + "CC error: %s [0x%02X]", + fu_ipmi_device_errcode_to_string(errcode), + errcode); + return FALSE; +} + +typedef struct { + guint8 netfn; + guint8 cmd; + const guint8 *req_buf; + gsize req_bufsz; + guint8 *resp_buf; + gsize resp_bufsz; + gsize *resp_len; + gint timeout_ms; +} FuIpmiDeviceTransactionHelper; + +static gboolean +fu_ipmi_device_transaction_cb(FuDevice *device, gpointer user_data, GError **error) { + FuIpmiDevice *self = FU_IPMI_DEVICE(device); + FuIpmiDeviceTransactionHelper *helper = (FuIpmiDeviceTransactionHelper *)user_data; GPollFD pollfds[1]; - gsize resp_buf2sz = resp_bufsz + 1; + gsize resp_buf2sz = helper->resp_bufsz + 1; gsize resp_len2 = 0; g_autoptr(GTimer) timer = g_timer_new(); g_autoptr(FuDeviceLocker) lock = NULL; @@ -205,7 +291,12 @@ if (lock == NULL) return FALSE; - if (!fu_ipmi_device_send(self, netfn, cmd, req_buf, req_bufsz, error)) + if (!fu_ipmi_device_send(self, + helper->netfn, + helper->cmd, + helper->req_buf, + helper->req_bufsz, + error)) return FALSE; pollfds[0].fd = fu_udev_device_get_fd(FU_UDEV_DEVICE(self)); @@ -217,7 +308,9 @@ glong seq = 0; gint rc; - rc = g_poll(pollfds, 1, timeout_ms - (g_timer_elapsed(timer, NULL) * 1000.f)); + rc = g_poll(pollfds, + 1, + helper->timeout_ms - (g_timer_elapsed(timer, NULL) * 1000.f)); if (rc < 0) { g_set_error(error, G_IO_ERROR, G_IO_ERROR_FAILED, "poll() error %m"); return FALSE; @@ -228,8 +321,8 @@ G_IO_ERROR_FAILED, "timeout waiting for response " "(netfn %d, cmd %d)", - netfn, - cmd); + helper->netfn, + helper->cmd); return FALSE; } @@ -256,7 +349,7 @@ "expected %ld, got %ld", self->seq, seq); - if (g_timer_elapsed(timer, NULL) * 1000.f >= timeout_ms) { + if (g_timer_elapsed(timer, NULL) * 1000.f >= helper->timeout_ms) { g_set_error_literal(error, G_IO_ERROR, G_IO_ERROR_FAILED, @@ -264,33 +357,26 @@ return FALSE; } } else { - if (resp_buf2[0] != IPMI_CC_NO_ERROR) { - g_set_error(error, - G_IO_ERROR, - G_IO_ERROR_FAILED, - "CC error: %s [%02x]", - fu_ipmi_device_errcode_to_string(resp_buf2[0]), - resp_buf2[0]); + if (!fu_ipmi_device_errcode_to_error(resp_buf2[0], error)) return FALSE; - } - if (resp_buf != NULL) { - if (!fu_memcpy_safe(resp_buf, - resp_bufsz, + if (helper->resp_buf != NULL) { + if (!fu_memcpy_safe(helper->resp_buf, + helper->resp_bufsz, 0x0, /* dst */ resp_buf2, resp_buf2sz, 0x01, /* src */ - resp_bufsz, + helper->resp_bufsz, error)) return FALSE; } - if (resp_len != NULL) - *resp_len = resp_len2 - 1; + if (helper->resp_len != NULL) + *helper->resp_len = resp_len2 - 1; if (g_getenv("FWUPD_REDFISH_VERBOSE") != NULL) { g_debug("IPMI netfn: %02x->%02x, cmd: %02x->%02x", - netfn, + helper->netfn, resp_netfn, - cmd, + helper->cmd, resp_cmd); } break; @@ -300,6 +386,37 @@ } static gboolean +fu_ipmi_device_transaction(FuIpmiDevice *self, + guint8 netfn, + guint8 cmd, + const guint8 *req_buf, + gsize req_bufsz, + guint8 *resp_buf, /* optional */ + gsize resp_bufsz, + gsize *resp_len, /* optional, out */ + gint timeout_ms, + GError **error) +{ + FuIpmiDeviceTransactionHelper helper = { + .netfn = netfn, + .cmd = cmd, + .req_buf = req_buf, + .req_bufsz = req_bufsz, + .resp_buf = resp_buf, + .resp_bufsz = resp_bufsz, + .resp_len = resp_len, + .timeout_ms = timeout_ms, + }; + fu_device_retry_add_recovery(FU_DEVICE(self), G_IO_ERROR, G_IO_ERROR_NOT_FOUND, NULL); + return fu_device_retry_full(FU_DEVICE(self), + fu_ipmi_device_transaction_cb, + FU_IPMI_TRANSACTION_RETRY_COUNT, + FU_IPMI_TRANSACTION_RETRY_DELAY, + &helper, + error); +} + +static gboolean fu_ipmi_device_probe(FuDevice *device, GError **error) { FuIpmiDevice *self = FU_IPMI_DEVICE(device); diff -Nru fwupd-1.7.4/plugins/redfish/fu-plugin-redfish.c fwupd-1.7.5/plugins/redfish/fu-plugin-redfish.c --- fwupd-1.7.4/plugins/redfish/fu-plugin-redfish.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/redfish/fu-plugin-redfish.c 2022-02-07 16:24:38.000000000 +0000 @@ -21,6 +21,55 @@ FuRedfishBackend *backend; }; +static gchar * +fu_common_generate_password(guint length) +{ + GString *str = g_string_sized_new(length); + + /* get a random password string */ + while (str->len < length) { + gchar tmp = (gchar)g_random_int_range(0x0, 0xff); + if (g_ascii_isalnum(tmp)) + g_string_append_c(str, tmp); + } + return g_string_free(str, FALSE); +} + +static gboolean +fu_plugin_redfish_change_expired(FuPlugin *plugin, GError **error) +{ + FuPluginData *data = fu_plugin_get_data(plugin); + g_autofree gchar *password_new = fu_common_generate_password(15); + g_autofree gchar *uri = NULL; + g_autoptr(FuRedfishRequest) request = NULL; + g_autoptr(JsonBuilder) builder = json_builder_new(); + + /* select correct, falling back to default for old fwupd versions */ + uri = fu_plugin_get_config_value(plugin, "UserUri"); + if (uri == NULL) { + uri = g_strdup("/redfish/v1/AccountService/Accounts/2"); + if (!fu_plugin_set_secure_config_value(plugin, "UserUri", uri, error)) + return FALSE; + } + + /* now use Redfish to change the temporary password to the actual password */ + request = fu_redfish_backend_request_new(data->backend); + json_builder_begin_object(builder); + json_builder_set_member_name(builder, "Password"); + json_builder_add_string_value(builder, password_new); + json_builder_end_object(builder); + if (!fu_redfish_request_patch(request, + uri, + builder, + FU_REDFISH_REQUEST_PERFORM_FLAG_LOAD_JSON, + error)) + return FALSE; + fu_redfish_backend_set_password(data->backend, password_new); + + /* success */ + return fu_plugin_set_secure_config_value(plugin, "Password", password_new, error); +} + static gboolean fu_plugin_redfish_coldplug(FuPlugin *plugin, GError **error) { @@ -30,10 +79,18 @@ /* get the list of devices */ if (!fu_backend_coldplug(FU_BACKEND(data->backend), &error_local)) { - if (g_error_matches(error_local, FWUPD_ERROR, FWUPD_ERROR_AUTH_FAILED)) - fu_plugin_add_flag(plugin, FWUPD_PLUGIN_FLAG_AUTH_REQUIRED); - g_propagate_error(error, g_steal_pointer(&error_local)); - return FALSE; + /* did the user password expire? */ + if (g_error_matches(error_local, FWUPD_ERROR, FWUPD_ERROR_AUTH_EXPIRED)) { + if (!fu_plugin_redfish_change_expired(plugin, error)) + return FALSE; + if (!fu_backend_coldplug(FU_BACKEND(data->backend), error)) { + fu_plugin_add_flag(plugin, FWUPD_PLUGIN_FLAG_AUTH_REQUIRED); + return FALSE; + } + } else { + g_propagate_error(error, g_steal_pointer(&error_local)); + return FALSE; + } } devices = fu_backend_get_devices(FU_BACKEND(data->backend)); for (guint i = 0; i < devices->len; i++) { @@ -186,19 +243,6 @@ } #ifdef HAVE_LINUX_IPMI_H -static gchar * -fu_common_generate_password(guint length) -{ - GString *str = g_string_sized_new(length); - - /* get a random password string */ - while (str->len < length) { - gchar tmp = (gchar)g_random_int_range(0x0, 0xff); - if (g_ascii_isalnum(tmp)) - g_string_append_c(str, tmp); - } - return g_string_free(str, FALSE); -} static gboolean fu_redfish_plugin_ipmi_create_user(FuPlugin *plugin, GError **error) @@ -256,6 +300,9 @@ fu_redfish_backend_set_username(data->backend, username_fwupd); fu_redfish_backend_set_password(data->backend, password_tmp); + /* wait for Redfish to sync */ + g_usleep(2 * G_USEC_PER_SEC); + /* now use Redfish to change the temporary password to the actual password */ request = fu_redfish_backend_request_new(data->backend); uri = g_strdup_printf("/redfish/v1/AccountService/Accounts/%u", (guint)user_id - 1); @@ -272,6 +319,8 @@ fu_redfish_backend_set_password(data->backend, password_new); /* success */ + if (!fu_plugin_set_secure_config_value(plugin, "UserUri", uri, error)) + return FALSE; if (!fu_plugin_set_secure_config_value(plugin, "Username", username_fwupd, error)) return FALSE; if (!fu_plugin_set_secure_config_value(plugin, "Password", password_new, error)) diff -Nru fwupd-1.7.4/plugins/redfish/fu-redfish-request.c fwupd-1.7.5/plugins/redfish/fu-redfish-request.c --- fwupd-1.7.4/plugins/redfish/fu-redfish-request.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/redfish/fu-redfish-request.c 2022-02-07 16:24:38.000000000 +0000 @@ -138,6 +138,8 @@ } if (g_strcmp0(id, "Base.1.8.AccessDenied") == 0) error_code = FWUPD_ERROR_AUTH_FAILED; + else if (g_strcmp0(id, "Base.1.8.PasswordChangeRequired") == 0) + error_code = FWUPD_ERROR_AUTH_EXPIRED; g_set_error_literal(error, FWUPD_ERROR, error_code, msg); return FALSE; } @@ -244,7 +246,7 @@ json_generator_set_root(json_generator, json_root); json_generator_to_gstring(json_generator, str); if (g_getenv("FWUPD_REDFISH_VERBOSE") != NULL) - g_debug("request: %s", str->str); + g_debug("request to %s: %s", path, str->str); /* patch */ curl_easy_setopt(self->curl, CURLOPT_CUSTOMREQUEST, "PATCH"); diff -Nru fwupd-1.7.4/plugins/redfish/meson.build fwupd-1.7.5/plugins/redfish/meson.build --- fwupd-1.7.4/plugins/redfish/meson.build 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/redfish/meson.build 2022-02-07 16:24:38.000000000 +0000 @@ -59,6 +59,8 @@ if get_option('tests') install_data(['tests/redfish-smbios.bin'], install_dir: join_paths(installed_test_datadir, 'tests')) + install_data(['tests/redfish.conf'], + install_dir: join_paths(installed_test_datadir, 'tests')) install_data(['tests/efi/efivars/RedfishIndications-16faa37e-4b6a-4891-9028-242de65a3b70'], install_dir: join_paths(installed_test_datadir, 'tests', 'efi', 'efivars')) install_data(['tests/efi/efivars/RedfishOSCredentials-16faa37e-4b6a-4891-9028-242de65a3b70'], diff -Nru fwupd-1.7.4/plugins/rts54hub/fu-rts54hub-rtd21xx-background.c fwupd-1.7.5/plugins/rts54hub/fu-rts54hub-rtd21xx-background.c --- fwupd-1.7.4/plugins/rts54hub/fu-rts54hub-rtd21xx-background.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/rts54hub/fu-rts54hub-rtd21xx-background.c 2022-02-07 16:24:38.000000000 +0000 @@ -41,7 +41,7 @@ g_autofree gchar *version = NULL; if (!fu_rts54hub_rtd21xx_device_i2c_write(FU_RTS54HUB_RTD21XX_DEVICE(self), - UC_ISP_SLAVE_ADDR, + UC_ISP_TARGET_ADDR, UC_BACKGROUND_OPCODE, buf_req, sizeof(buf_req), @@ -53,7 +53,7 @@ /* wait for device ready */ g_usleep(300000); if (!fu_rts54hub_rtd21xx_device_i2c_read(FU_RTS54HUB_RTD21XX_DEVICE(self), - UC_ISP_SLAVE_ADDR, + UC_ISP_TARGET_ADDR, 0x00, buf_rep, sizeof(buf_rep), @@ -139,7 +139,7 @@ if (locker == NULL) return FALSE; if (!fu_rts54hub_rtd21xx_device_i2c_write(self, - UC_ISP_SLAVE_ADDR, + UC_ISP_TARGET_ADDR, UC_BACKGROUND_OPCODE, buf, sizeof(buf), @@ -226,7 +226,7 @@ /* get project ID address */ write_buf[0] = ISP_CMD_GET_PROJECT_ID_ADDR; if (!fu_rts54hub_rtd21xx_device_i2c_write(FU_RTS54HUB_RTD21XX_DEVICE(self), - UC_ISP_SLAVE_ADDR, + UC_ISP_TARGET_ADDR, UC_BACKGROUND_OPCODE, write_buf, 1, @@ -238,7 +238,7 @@ /* read back 6 bytes data */ g_usleep(I2C_DELAY_AFTER_SEND * 40); if (!fu_rts54hub_rtd21xx_device_i2c_read(FU_RTS54HUB_RTD21XX_DEVICE(self), - UC_ISP_SLAVE_ADDR, + UC_ISP_TARGET_ADDR, 0x00, read_buf, 6, @@ -271,7 +271,7 @@ return FALSE; } if (!fu_rts54hub_rtd21xx_device_i2c_write(FU_RTS54HUB_RTD21XX_DEVICE(self), - UC_ISP_SLAVE_ADDR, + UC_ISP_TARGET_ADDR, UC_BACKGROUND_OPCODE, write_buf, project_id_count + 1, @@ -286,7 +286,7 @@ write_buf[0] = ISP_CMD_FW_UPDATE_START; fu_common_write_uint16(write_buf + 1, ISP_DATA_BLOCKSIZE, G_BIG_ENDIAN); if (!fu_rts54hub_rtd21xx_device_i2c_write(FU_RTS54HUB_RTD21XX_DEVICE(self), - UC_ISP_SLAVE_ADDR, + UC_ISP_TARGET_ADDR, UC_BACKGROUND_OPCODE, write_buf, 3, @@ -308,7 +308,7 @@ error)) return FALSE; if (!fu_rts54hub_rtd21xx_device_i2c_write(FU_RTS54HUB_RTD21XX_DEVICE(self), - UC_ISP_SLAVE_ADDR, + UC_ISP_TARGET_ADDR, UC_BACKGROUND_ISP_DATA_OPCODE, fu_chunk_get_data(chk), fu_chunk_get_data_sz(chk), @@ -331,7 +331,7 @@ return FALSE; write_buf[0] = ISP_CMD_FW_UPDATE_ISP_DONE; if (!fu_rts54hub_rtd21xx_device_i2c_write(FU_RTS54HUB_RTD21XX_DEVICE(self), - UC_ISP_SLAVE_ADDR, + UC_ISP_TARGET_ADDR, UC_BACKGROUND_OPCODE, write_buf, 1, diff -Nru fwupd-1.7.4/plugins/rts54hub/fu-rts54hub-rtd21xx-device.c fwupd-1.7.5/plugins/rts54hub/fu-rts54hub-rtd21xx-device.c --- fwupd-1.7.4/plugins/rts54hub/fu-rts54hub-rtd21xx-device.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/rts54hub/fu-rts54hub-rtd21xx-device.c 2022-02-07 16:24:38.000000000 +0000 @@ -161,7 +161,7 @@ { guint8 buf = 0x00; if (!fu_rts54hub_rtd21xx_device_i2c_read(self, - UC_ISP_SLAVE_ADDR, + UC_ISP_TARGET_ADDR, UC_FOREGROUND_STATUS, &buf, sizeof(buf), diff -Nru fwupd-1.7.4/plugins/rts54hub/fu-rts54hub-rtd21xx-device.h fwupd-1.7.5/plugins/rts54hub/fu-rts54hub-rtd21xx-device.h --- fwupd-1.7.4/plugins/rts54hub/fu-rts54hub-rtd21xx-device.h 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/rts54hub/fu-rts54hub-rtd21xx-device.h 2022-02-07 16:24:38.000000000 +0000 @@ -22,7 +22,7 @@ #define I2C_DELAY_AFTER_SEND 5000 /* us */ -#define UC_ISP_SLAVE_ADDR 0x3A +#define UC_ISP_TARGET_ADDR 0x3A #define UC_FOREGROUND_STATUS 0x31 #define UC_FOREGROUND_OPCODE 0x33 #define UC_FOREGROUND_ISP_DATA_OPCODE 0x34 diff -Nru fwupd-1.7.4/plugins/rts54hub/fu-rts54hub-rtd21xx-foreground.c fwupd-1.7.5/plugins/rts54hub/fu-rts54hub-rtd21xx-foreground.c --- fwupd-1.7.4/plugins/rts54hub/fu-rts54hub-rtd21xx-foreground.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/rts54hub/fu-rts54hub-rtd21xx-foreground.c 2022-02-07 16:24:38.000000000 +0000 @@ -43,7 +43,7 @@ g_autofree gchar *version = NULL; if (!fu_rts54hub_rtd21xx_device_i2c_write(FU_RTS54HUB_RTD21XX_DEVICE(self), - UC_ISP_SLAVE_ADDR, + UC_ISP_TARGET_ADDR, UC_FOREGROUND_OPCODE, buf_req, sizeof(buf_req), @@ -55,7 +55,7 @@ /* wait for device ready */ g_usleep(300000); if (!fu_rts54hub_rtd21xx_device_i2c_read(FU_RTS54HUB_RTD21XX_DEVICE(self), - UC_ISP_SLAVE_ADDR, + UC_ISP_TARGET_ADDR, 0x00, buf_rep, sizeof(buf_rep), @@ -142,7 +142,7 @@ if (!fu_rts54hub_rtd21xx_device_read_status(FU_RTS54HUB_RTD21XX_DEVICE(self), NULL, error)) return FALSE; if (!fu_rts54hub_rtd21xx_device_i2c_write(FU_RTS54HUB_RTD21XX_DEVICE(self), - UC_ISP_SLAVE_ADDR, + UC_ISP_TARGET_ADDR, UC_FOREGROUND_OPCODE, buf, sizeof(buf), @@ -173,7 +173,7 @@ return FALSE; if (!fu_rts54hub_rtd21xx_device_i2c_write(FU_RTS54HUB_RTD21XX_DEVICE(self), - UC_ISP_SLAVE_ADDR, + UC_ISP_TARGET_ADDR, UC_FOREGROUND_OPCODE, buf, sizeof(buf), @@ -259,7 +259,7 @@ write_buf[0] = ISP_CMD_ENTER_FW_UPDATE; write_buf[1] = 0x01; if (!fu_rts54hub_rtd21xx_device_i2c_write(FU_RTS54HUB_RTD21XX_DEVICE(self), - UC_ISP_SLAVE_ADDR, + UC_ISP_TARGET_ADDR, UC_FOREGROUND_OPCODE, write_buf, 2, @@ -273,7 +273,7 @@ /* get project ID address */ write_buf[0] = ISP_CMD_GET_PROJECT_ID_ADDR; if (!fu_rts54hub_rtd21xx_device_i2c_write(FU_RTS54HUB_RTD21XX_DEVICE(self), - UC_ISP_SLAVE_ADDR, + UC_ISP_TARGET_ADDR, UC_FOREGROUND_OPCODE, write_buf, 1, @@ -285,7 +285,7 @@ /* read back 6 bytes data */ g_usleep(I2C_DELAY_AFTER_SEND * 40); if (!fu_rts54hub_rtd21xx_device_i2c_read(FU_RTS54HUB_RTD21XX_DEVICE(self), - UC_ISP_SLAVE_ADDR, + UC_ISP_TARGET_ADDR, UC_FOREGROUND_STATUS, read_buf, 6, @@ -318,7 +318,7 @@ return FALSE; } if (!fu_rts54hub_rtd21xx_device_i2c_write(FU_RTS54HUB_RTD21XX_DEVICE(self), - UC_ISP_SLAVE_ADDR, + UC_ISP_TARGET_ADDR, UC_FOREGROUND_OPCODE, write_buf, project_id_count + 1, @@ -333,7 +333,7 @@ write_buf[0] = ISP_CMD_FW_UPDATE_START; fu_common_write_uint16(write_buf + 1, ISP_DATA_BLOCKSIZE, G_BIG_ENDIAN); if (!fu_rts54hub_rtd21xx_device_i2c_write(FU_RTS54HUB_RTD21XX_DEVICE(self), - UC_ISP_SLAVE_ADDR, + UC_ISP_TARGET_ADDR, UC_FOREGROUND_OPCODE, write_buf, 3, @@ -355,7 +355,7 @@ error)) return FALSE; if (!fu_rts54hub_rtd21xx_device_i2c_write(FU_RTS54HUB_RTD21XX_DEVICE(self), - UC_ISP_SLAVE_ADDR, + UC_ISP_TARGET_ADDR, UC_FOREGROUND_ISP_DATA_OPCODE, fu_chunk_get_data(chk), fu_chunk_get_data_sz(chk), @@ -378,7 +378,7 @@ return FALSE; write_buf[0] = ISP_CMD_FW_UPDATE_ISP_DONE; if (!fu_rts54hub_rtd21xx_device_i2c_write(FU_RTS54HUB_RTD21XX_DEVICE(self), - UC_ISP_SLAVE_ADDR, + UC_ISP_TARGET_ADDR, UC_FOREGROUND_OPCODE, write_buf, 1, diff -Nru fwupd-1.7.4/plugins/synaptics-mst/fu-self-test.c fwupd-1.7.5/plugins/synaptics-mst/fu-self-test.c --- fwupd-1.7.4/plugins/synaptics-mst/fu-self-test.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/synaptics-mst/fu-self-test.c 2022-02-07 16:24:38.000000000 +0000 @@ -193,7 +193,6 @@ int main(int argc, char **argv) { - g_setenv("FWUPD_DATADIR_QUIRKS", PLUGINSOURCEDIR, TRUE); g_test_init(&argc, &argv, NULL); /* only critical and error are fatal */ diff -Nru fwupd-1.7.4/plugins/synaptics-mst/meson.build fwupd-1.7.5/plugins/synaptics-mst/meson.build --- fwupd-1.7.4/plugins/synaptics-mst/meson.build 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/synaptics-mst/meson.build 2022-02-07 16:24:38.000000000 +0000 @@ -43,7 +43,7 @@ env.set('G_TEST_SRCDIR', meson.current_source_dir()) env.set('G_TEST_BUILDDIR', meson.current_build_dir()) env.set('FWUPD_LOCALSTATEDIR', '/tmp/fwupd-self-test/var') - cargs += '-DPLUGINSOURCEDIR="' + meson.current_source_dir() + '"' + env.set('FWUPD_DATADIR_QUIRKS', meson.current_source_dir()) e = executable( 'synaptics-mst-self-test', fu_hash, diff -Nru fwupd-1.7.4/plugins/thunderbolt/fu-self-test.c fwupd-1.7.5/plugins/thunderbolt/fu-self-test.c --- fwupd-1.7.4/plugins/thunderbolt/fu-self-test.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/thunderbolt/fu-self-test.c 2022-02-07 16:24:38.000000000 +0000 @@ -1385,9 +1385,6 @@ g_test_init(&argc, &argv, NULL); g_log_set_fatal_mask(NULL, G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL); - quirkdatadir = g_test_build_filename(G_TEST_DIST, "tests", "quirks.d", NULL); - g_setenv("FWUPD_DATADIR_QUIRKS", quirkdatadir, FALSE); - g_test_add("/thunderbolt/basic", ThunderboltTest, NULL, diff -Nru fwupd-1.7.4/plugins/thunderbolt/fu-thunderbolt-controller.c fwupd-1.7.5/plugins/thunderbolt/fu-thunderbolt-controller.c --- fwupd-1.7.4/plugins/thunderbolt/fu-thunderbolt-controller.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/thunderbolt/fu-thunderbolt-controller.c 2022-02-07 16:24:38.000000000 +0000 @@ -151,7 +151,7 @@ } static gboolean -fu_thunderbolt_controller_set_port_offline_cb(gpointer user_data) +fu_thunderbolt_controller_set_port_online_cb(gpointer user_data) { FuThunderboltController *self = FU_THUNDERBOLT_CONTROLLER(user_data); g_autoptr(GError) error_local = NULL; @@ -170,7 +170,7 @@ if (!fu_thunderbolt_udev_set_port_offline(FU_UDEV_DEVICE(self), error)) return FALSE; self->host_online_timer_id = - g_timeout_add_seconds(5, fu_thunderbolt_controller_set_port_offline_cb, self); + g_timeout_add_seconds(5, fu_thunderbolt_controller_set_port_online_cb, self); return TRUE; } diff -Nru fwupd-1.7.4/plugins/thunderbolt/fu-thunderbolt-device.c fwupd-1.7.5/plugins/thunderbolt/fu-thunderbolt-device.c --- fwupd-1.7.4/plugins/thunderbolt/fu-thunderbolt-device.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/thunderbolt/fu-thunderbolt-device.c 2022-02-07 16:24:38.000000000 +0000 @@ -436,7 +436,7 @@ } /* whether to wait for a device replug or not */ - if (fu_device_has_flag(device, FWUPD_DEVICE_FLAG_USABLE_DURING_UPDATE)) { + if (!fu_device_has_flag(device, FWUPD_DEVICE_FLAG_USABLE_DURING_UPDATE)) { fu_device_set_remove_delay(device, FU_PLUGIN_THUNDERBOLT_UPDATE_TIMEOUT); fu_progress_set_status(progress, FWUPD_STATUS_DEVICE_RESTART); } diff -Nru fwupd-1.7.4/plugins/thunderbolt/fu-thunderbolt-retimer.c fwupd-1.7.5/plugins/thunderbolt/fu-thunderbolt-retimer.c --- fwupd-1.7.4/plugins/thunderbolt/fu-thunderbolt-retimer.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/thunderbolt/fu-thunderbolt-retimer.c 2022-02-07 16:24:38.000000000 +0000 @@ -98,6 +98,10 @@ guint16 vid; g_autofree gchar *instance = NULL; + /* get version */ + if (!fu_thunderbolt_device_get_version(FU_THUNDERBOLT_DEVICE(self), error)) + return FALSE; + /* as defined in PCIe 4.0 spec */ vid = fu_udev_device_get_vendor(FU_UDEV_DEVICE(self)); if (vid == 0x0) { @@ -143,7 +147,6 @@ "that forms two separate electrical link segments"); fu_device_add_flag(FU_DEVICE(self), FWUPD_DEVICE_FLAG_DUAL_IMAGE); fu_device_add_flag(FU_DEVICE(self), FWUPD_DEVICE_FLAG_INTERNAL); - fu_device_add_flag(FU_DEVICE(self), FWUPD_DEVICE_FLAG_SKIPS_RESTART); fu_device_add_internal_flag(FU_DEVICE(self), FU_DEVICE_INTERNAL_FLAG_NO_AUTO_REMOVE); } diff -Nru fwupd-1.7.4/plugins/thunderbolt/meson.build fwupd-1.7.5/plugins/thunderbolt/meson.build --- fwupd-1.7.4/plugins/thunderbolt/meson.build 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/thunderbolt/meson.build 2022-02-07 16:24:38.000000000 +0000 @@ -45,6 +45,7 @@ env.set('G_TEST_SRCDIR', meson.current_source_dir()) env.set('G_TEST_BUILDDIR', meson.current_build_dir()) env.set('FWUPD_LOCALSTATEDIR', '/tmp/fwupd-self-test/var') + env.set('FWUPD_DATADIR_QUIRKS', meson.current_source_dir()) e = executable( 'thunderbolt-self-test', fu_hash, diff -Nru fwupd-1.7.4/plugins/thunderbolt/tests/quirks.d/thunderbolt.quirk fwupd-1.7.5/plugins/thunderbolt/tests/quirks.d/thunderbolt.quirk --- fwupd-1.7.4/plugins/thunderbolt/tests/quirks.d/thunderbolt.quirk 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/thunderbolt/tests/quirks.d/thunderbolt.quirk 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -[THUNDERBOLT\TYPE_THUNDERBOLT_DEVICE] -Plugin = thunderbolt -GType = FuThunderboltController - -[THUNDERBOLT\TYPE_THUNDERBOLT_RETIMER] -Plugin = thunderbolt -GType = FuThunderboltRetimer diff -Nru fwupd-1.7.4/plugins/uefi-capsule/fu-plugin-uefi-capsule.c fwupd-1.7.5/plugins/uefi-capsule/fu-plugin-uefi-capsule.c --- fwupd-1.7.4/plugins/uefi-capsule/fu-plugin-uefi-capsule.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/uefi-capsule/fu-plugin-uefi-capsule.c 2022-02-07 16:24:38.000000000 +0000 @@ -637,7 +637,7 @@ /* clone the info from real device but prevent it from being flashed */ device_flags_alt = fu_device_get_flags(device_alt); fu_device_set_flags(device, device_flags_alt); - fu_device_remove_flag(device_alt, FWUPD_DEVICE_FLAG_UPDATABLE); + fu_device_inhibit(device_alt, "alt-device", "Preventing upgrades as alternate"); /* make sure that this unlocked device can be updated */ fu_device_set_version_format(device, FWUPD_VERSION_FORMAT_QUAD); diff -Nru fwupd-1.7.4/plugins/uefi-capsule/fu-uefi-bootmgr.c fwupd-1.7.5/plugins/uefi-capsule/fu-uefi-bootmgr.c --- fwupd-1.7.4/plugins/uefi-capsule/fu-uefi-bootmgr.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/uefi-capsule/fu-uefi-bootmgr.c 2022-02-07 16:24:38.000000000 +0000 @@ -304,7 +304,7 @@ device, FU_UEFI_DEVICE_FLAG_FALLBACK_TO_REMOVABLE_PATH)) { shim_app = - fu_uefi_get_esp_app_path(device, esp_path, "boot", error); + fu_uefi_get_fallback_app_path(device, esp_path, "boot", error); if (shim_app == NULL) return FALSE; } @@ -327,11 +327,12 @@ } use_fwup_path = FALSE; } else if ((flags & FU_UEFI_BOOTMGR_FLAG_USE_SHIM_FOR_SB) > 0) { - g_set_error_literal(error, - FWUPD_ERROR, - FWUPD_ERROR_BROKEN_SYSTEM, - "Secure boot is enabled, but shim isn't installed to " - "the EFI system partition"); + g_set_error(error, + FWUPD_ERROR, + FWUPD_ERROR_BROKEN_SYSTEM, + "Secure boot is enabled, but shim isn't installed to " + "%s", + shim_app); return FALSE; } } diff -Nru fwupd-1.7.4/plugins/uefi-capsule/fu-uefi-common.c fwupd-1.7.5/plugins/uefi-capsule/fu-uefi-common.c --- fwupd-1.7.4/plugins/uefi-capsule/fu-uefi-common.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/uefi-capsule/fu-uefi-common.c 2022-02-07 16:24:38.000000000 +0000 @@ -60,6 +60,21 @@ } gchar * +fu_uefi_get_fallback_app_path(FuDevice *device, + const gchar *esp_path, + const gchar *cmd, + GError **error) +{ + const gchar *suffix = fu_uefi_bootmgr_get_suffix(error); + g_autofree gchar *base = NULL; + if (suffix == NULL) + return NULL; + + base = g_build_filename(esp_path, "EFI", "boot", NULL); + return g_strdup_printf("%s/%s%s.efi", base, cmd, suffix); +} + +gchar * fu_uefi_get_esp_app_path(FuDevice *device, const gchar *esp_path, const gchar *cmd, GError **error) { const gchar *suffix = fu_uefi_bootmgr_get_suffix(error); @@ -221,12 +236,6 @@ } } } - /* try to fallback to use UEFI removable path if ID_LIKE path doesn't exist */ - if (fu_device_has_private_flag(device, FU_UEFI_DEVICE_FLAG_FALLBACK_TO_REMOVABLE_PATH)) { - esp_path = g_build_filename(base, "EFI", "boot", NULL); - if (!g_file_test(esp_path, G_FILE_TEST_IS_DIR)) - g_debug("failed to fallback due to missing %s", esp_path); - } return g_steal_pointer(&esp_path); #else return g_build_filename(base, "EFI", EFI_OS_DIR, NULL); diff -Nru fwupd-1.7.4/plugins/uefi-capsule/fu-uefi-common.h fwupd-1.7.5/plugins/uefi-capsule/fu-uefi-common.h --- fwupd-1.7.4/plugins/uefi-capsule/fu-uefi-common.h 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/uefi-capsule/fu-uefi-common.h 2022-02-07 16:24:38.000000000 +0000 @@ -9,6 +9,10 @@ #include +#ifdef HAVE_EFI_TIME_T +#include +#endif + #include #define EFI_CAPSULE_HEADER_FLAGS_PERSIST_ACROSS_RESET 0x00010000 @@ -17,6 +21,7 @@ #define EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED 0x0000000000000004ULL +#ifndef HAVE_EFI_TIME_T typedef struct __attribute__((__packed__)) { guint16 year; guint8 month; @@ -30,6 +35,7 @@ guint8 daylight; guint8 pad2; } efi_time_t; +#endif typedef struct __attribute__((__packed__)) { fwupd_guid_t guid; @@ -61,6 +67,11 @@ #define FU_UEFI_COMMON_REQUIRED_ESP_FREE_SPACE (32 * 1024 * 1024) gchar * +fu_uefi_get_fallback_app_path(FuDevice *device, + const gchar *esp_path, + const gchar *cmd, + GError **error); +gchar * fu_uefi_get_esp_app_path(FuDevice *device, const gchar *esp_path, const gchar *cmd, GError **error); gchar * fu_uefi_get_built_app_path(GError **error); diff -Nru fwupd-1.7.4/plugins/vli/fu-vli-usbhub-msp430-device.c fwupd-1.7.5/plugins/vli/fu-vli-usbhub-msp430-device.c --- fwupd-1.7.4/plugins/vli/fu-vli-usbhub-msp430-device.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/vli/fu-vli-usbhub-msp430-device.c 2022-02-07 16:24:38.000000000 +0000 @@ -311,11 +311,10 @@ fu_vli_usbhub_msp430_device_set_progress(FuDevice *self, FuProgress *progress) { fu_progress_set_id(progress, G_STRLOC); - fu_progress_add_flag(progress, FU_PROGRESS_FLAG_GUESSED); fu_progress_add_step(progress, FWUPD_STATUS_DEVICE_RESTART, 2); /* detach */ - fu_progress_add_step(progress, FWUPD_STATUS_DEVICE_WRITE, 94); /* write */ - fu_progress_add_step(progress, FWUPD_STATUS_DEVICE_RESTART, 2); /* attach */ - fu_progress_add_step(progress, FWUPD_STATUS_DEVICE_BUSY, 2); /* reload */ + fu_progress_add_step(progress, FWUPD_STATUS_DEVICE_WRITE, 13); /* write */ + fu_progress_add_step(progress, FWUPD_STATUS_DEVICE_RESTART, 85); /* attach */ + fu_progress_add_step(progress, FWUPD_STATUS_DEVICE_BUSY, 0); /* reload */ } static void diff -Nru fwupd-1.7.4/plugins/vli/fu-vli-usbhub-rtd21xx-device.c fwupd-1.7.5/plugins/vli/fu-vli-usbhub-rtd21xx-device.c --- fwupd-1.7.4/plugins/vli/fu-vli-usbhub-rtd21xx-device.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/plugins/vli/fu-vli-usbhub-rtd21xx-device.c 2022-02-07 16:24:38.000000000 +0000 @@ -23,7 +23,7 @@ #define I2C_DELAY_AFTER_SEND 5000 /* us */ -#define UC_FOREGROUND_SLAVE_ADDR 0x3A +#define UC_FOREGROUND_TARGET_ADDR 0x3A #define UC_FOREGROUND_STATUS 0x31 #define UC_FOREGROUND_OPCODE 0x33 #define UC_FOREGROUND_ISP_DATA_OPCODE 0x34 @@ -131,7 +131,7 @@ FuVliUsbhubDevice *parent = FU_VLI_USBHUB_DEVICE(fu_device_get_parent(FU_DEVICE(self))); guint8 buf[] = {0x00}; if (!fu_vli_usbhub_device_i2c_read(parent, - UC_FOREGROUND_SLAVE_ADDR, + UC_FOREGROUND_TARGET_ADDR, UC_FOREGROUND_STATUS, buf, sizeof(buf), @@ -177,7 +177,7 @@ g_autofree gchar *version = NULL; if (!fu_vli_usbhub_device_i2c_write(parent, - UC_FOREGROUND_SLAVE_ADDR, + UC_FOREGROUND_TARGET_ADDR, UC_FOREGROUND_OPCODE, buf_req, sizeof(buf_req), @@ -189,7 +189,7 @@ /* wait for device ready */ g_usleep(300000); if (!fu_vli_usbhub_device_i2c_read(parent, - UC_FOREGROUND_SLAVE_ADDR, + UC_FOREGROUND_TARGET_ADDR, 0x00, buf_rep, sizeof(buf_rep), @@ -286,7 +286,7 @@ if (locker == NULL) return FALSE; if (!fu_vli_usbhub_device_i2c_write(parent, - UC_FOREGROUND_SLAVE_ADDR, + UC_FOREGROUND_TARGET_ADDR, UC_FOREGROUND_OPCODE, buf, sizeof(buf), @@ -341,7 +341,7 @@ write_buf[0] = ISP_CMD_ENTER_FW_UPDATE; write_buf[1] = 0x01; if (!fu_vli_usbhub_device_i2c_write(parent, - UC_FOREGROUND_SLAVE_ADDR, + UC_FOREGROUND_TARGET_ADDR, UC_FOREGROUND_OPCODE, write_buf, 2, @@ -355,7 +355,7 @@ /* get project ID address */ write_buf[0] = ISP_CMD_GET_PROJECT_ID_ADDR; if (!fu_vli_usbhub_device_i2c_write(parent, - UC_FOREGROUND_SLAVE_ADDR, + UC_FOREGROUND_TARGET_ADDR, UC_FOREGROUND_OPCODE, write_buf, 1, @@ -367,7 +367,7 @@ /* read back 6 bytes data */ g_usleep(I2C_DELAY_AFTER_SEND * 40); if (!fu_vli_usbhub_device_i2c_read(parent, - UC_FOREGROUND_SLAVE_ADDR, + UC_FOREGROUND_TARGET_ADDR, UC_FOREGROUND_STATUS, read_buf, 6, @@ -402,7 +402,7 @@ return FALSE; } if (!fu_vli_usbhub_device_i2c_write(parent, - UC_FOREGROUND_SLAVE_ADDR, + UC_FOREGROUND_TARGET_ADDR, UC_FOREGROUND_OPCODE, write_buf, project_id_count + 1, @@ -417,7 +417,7 @@ write_buf[0] = ISP_CMD_FW_UPDATE_START; fu_common_write_uint16(write_buf + 1, ISP_DATA_BLOCKSIZE, G_BIG_ENDIAN); if (!fu_vli_usbhub_device_i2c_write(parent, - UC_FOREGROUND_SLAVE_ADDR, + UC_FOREGROUND_TARGET_ADDR, UC_FOREGROUND_OPCODE, write_buf, 3, @@ -437,7 +437,7 @@ if (!fu_vli_usbhub_device_rtd21xx_read_status(self, NULL, error)) return FALSE; if (!fu_vli_usbhub_device_i2c_write(parent, - UC_FOREGROUND_SLAVE_ADDR, + UC_FOREGROUND_TARGET_ADDR, UC_FOREGROUND_ISP_DATA_OPCODE, fu_chunk_get_data_out(chk), fu_chunk_get_data_sz(chk), @@ -460,7 +460,7 @@ return FALSE; write_buf[0] = ISP_CMD_FW_UPDATE_ISP_DONE; if (!fu_vli_usbhub_device_i2c_write(parent, - UC_FOREGROUND_SLAVE_ADDR, + UC_FOREGROUND_TARGET_ADDR, UC_FOREGROUND_OPCODE, write_buf, 1, @@ -475,7 +475,7 @@ return FALSE; write_buf[0] = ISP_CMD_FW_UPDATE_EXIT; if (!fu_vli_usbhub_device_i2c_write(parent, - UC_FOREGROUND_SLAVE_ADDR, + UC_FOREGROUND_TARGET_ADDR, UC_FOREGROUND_OPCODE, write_buf, 1, diff -Nru fwupd-1.7.4/po/ca.po fwupd-1.7.5/po/ca.po --- fwupd-1.7.4/po/ca.po 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/po/ca.po 2022-02-07 16:24:38.000000000 +0000 @@ -3,7 +3,7 @@ # This file is distributed under the same license as the fwupd package. # # Translators: -# Antoni Bella Pérez , 2017-2021 +# Antoni Bella Pérez , 2017-2022 # Robert Antoni Buj Gelonch , 2017 msgid "" msgstr "" @@ -503,10 +503,6 @@ msgstr "Trieu un volum:" #. TRANSLATORS: command description -msgid "Clears any updates scheduled to be updated offline" -msgstr "Neteja qualsevol actualització programada per a ser actualitzada sense connexió." - -#. TRANSLATORS: command description msgid "Clears the results from the last update" msgstr "Esborra els resultats de l'última actualització." @@ -868,6 +864,10 @@ msgstr "NOM_FITXER ID_DISPOSITIU" #. TRANSLATORS: command argument: uppercase, spaces->dashes +msgid "FILENAME OFFSET DATA [FIRMWARE-TYPE]" +msgstr "NOM_FITXER DESPLAÇAMENT DADES [TIPUS_MICROPROGRAMARI]" + +#. TRANSLATORS: command argument: uppercase, spaces->dashes msgid "FILENAME [DEVICE-ID|GUID]" msgstr "NOM_FITXER [ID_DISPOSITIU|GUID]" @@ -1027,7 +1027,6 @@ msgstr "Actualitzacions de microprogramari inhabilitades: executeu «fwupdmgr unlock» per a habilitar-les" #. TRANSLATORS: description of plugin state, e.g. disabled -#. TRANSLATORS: release properties msgid "Flags" msgstr "Etiquetes" @@ -1528,6 +1527,10 @@ msgid "Password" msgstr "Contrasenya" +#. TRANSLATORS: command description +msgid "Patch a firmware blob at a known offset" +msgstr "Apedaça un blob de microprogramari amb un desplaçament conegut" + msgid "Payload" msgstr "Carrega útil" @@ -2217,10 +2220,6 @@ msgid "Update State" msgstr "Estat en actualitzar" -#. TRANSLATORS: command description -msgid "Update all devices that match local metadata" -msgstr "Actualitza tots els dispositius que coincideixin amb les metadades locals." - #. TRANSLATORS: the server sent the user a small message msgid "Update failure is a known issue, visit this URL for more information:" msgstr "Que falli en actualitzar és un problema conegut, visiteu aquest URL per a obtenir més informació:" @@ -2244,10 +2243,6 @@ msgid "Update the stored metadata with current contents" msgstr "Actualitza les metadades emmagatzemades amb el contingut actual." -#. TRANSLATORS: command description -msgid "Updates all firmware to latest versions available" -msgstr "Actualitza tot el microprogramari a les versions més recents." - msgid "Updating" msgstr "S'està actualitzant" diff -Nru fwupd-1.7.4/po/cs.po fwupd-1.7.5/po/cs.po --- fwupd-1.7.4/po/cs.po 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/po/cs.po 2022-02-07 16:24:38.000000000 +0000 @@ -329,6 +329,10 @@ msgid "Allow switching firmware branch" msgstr "Umožnit přepnutí varianty firmware" +#. TRANSLATORS: is not the main firmware stream +msgid "Alternate branch" +msgstr "Alternativní větev" + #. TRANSLATORS: explain why we want to reboot msgid "An update requires a reboot to complete." msgstr "Některá z aktualizací vyžaduje pro dokončení restart počítače." @@ -449,6 +453,10 @@ msgid "Blocked firmware files:" msgstr "Blokované soubory s firmware:" +#. TRANSLATORS: version cannot be installed due to policy +msgid "Blocked version" +msgstr "Blokovaná verze" + #. TRANSLATORS: we will not offer this firmware to the user msgid "Blocking firmware:" msgstr "Blokuje se firmware:" @@ -523,10 +531,6 @@ msgstr "Zvolte svazek:" #. TRANSLATORS: command description -msgid "Clears any updates scheduled to be updated offline" -msgstr "Odstranit vše naplánované pro aktualizaci při příštím spuštění systému" - -#. TRANSLATORS: command description msgid "Clears the results from the last update" msgstr "Smazat výsledky z poslední aktualizace" @@ -534,6 +538,10 @@ msgid "Command not found" msgstr "Příkaz nenalezen" +#. TRANSLATORS: is not supported by the vendor +msgid "Community supported" +msgstr "Podporováno komunitou" + #. TRANSLATORS: command description msgid "Convert a firmware file" msgstr "Převést soubor s firmware" @@ -812,6 +820,10 @@ msgid "Enabled fwupdate debugging" msgstr "Zapnuto ladění fwupdate" +#. TRANSLATORS: Plugin is active only if hardware is found +msgid "Enabled if hardware matches" +msgstr "Zapnuto pokud je odpovídající hardware" + #. TRANSLATORS: command description msgid "Enables a given remote" msgstr "Povolit zadaný vzdálený zdroj" @@ -1053,7 +1065,6 @@ msgstr "Aktualizace firmware jsou zakázané. Pokud je chcete povolit, spusťte „fwupdmgr unlock“" #. TRANSLATORS: description of plugin state, e.g. disabled -#. TRANSLATORS: release properties msgid "Flags" msgstr "Příznaky" @@ -1238,6 +1249,10 @@ msgid "Installing on %s…" msgstr "Instalace na %s…" +#. TRANSLATORS: if it breaks, you get to keep both pieces +msgid "Installing this update may also void any device warranty." +msgstr "Instalace této aktualizace také může zneplatnit jakékoli záruky na zařízení." + #. TRANSLATORS: Title: BootGuard is a trademark from Intel msgid "Intel BootGuard" msgstr "Intel BootGuard" @@ -1289,10 +1304,18 @@ msgid "Invalid" msgstr "Neplatné" +#. TRANSLATORS: version is older +msgid "Is downgrade" +msgstr "Je starší verzí" + #. TRANSLATORS: Is currently in bootloader mode msgid "Is in bootloader mode" msgstr "Je v režimu zavaděče firmware" +#. TRANSLATORS: version is newer +msgid "Is upgrade" +msgstr "Je novější verzí" + #. TRANSLATORS: issue fixed with the release, e.g. CVE msgid "Issue" msgid_plural "Issues" @@ -1306,6 +1329,14 @@ msgstr "KLÍČ,HODNOTA" #. TRANSLATORS: HSI event title +msgid "Kernel is no longer tainted" +msgstr "Jádro už není pozměněno" + +#. TRANSLATORS: HSI event title +msgid "Kernel is tainted" +msgstr "Jádro je pozměněno" + +#. TRANSLATORS: HSI event title msgid "Kernel lockdown disabled" msgstr "Uzamčení jádra vypnuto" @@ -1444,6 +1475,10 @@ msgid "Mounts the ESP" msgstr "Připojit ESP oddíl" +#. TRANSLATORS: we're poking around as a power user +msgid "NOTE: This program may only work correctly as root" +msgstr "POZN.: Tento program může správně fungovat jen pod uživatelem root" + #. TRANSLATORS: Requires a reboot to apply firmware or to reload hardware msgid "Needs a reboot after installation" msgstr "Po instalaci vyžaduje restart" @@ -1501,6 +1536,10 @@ msgid "No updates were applied" msgstr "Nebyly provedeny žádné aktualizace" +#. TRANSLATORS: version cannot be installed due to policy +msgid "Not approved" +msgstr "Neschváleno" + #. TRANSLATORS: Suffix: the HSI result msgid "Not found" msgstr "Nenalezeno" @@ -1595,6 +1634,14 @@ msgid "Pre-boot DMA protection" msgstr "Ochrana přímého přístupu do paměti před startem operačního systému" +#. TRANSLATORS: HSI event title +msgid "Pre-boot DMA protection is disabled" +msgstr "Ochrana přímého přístupu do paměti před startem operačního systému je vypnuta" + +#. TRANSLATORS: HSI event title +msgid "Pre-boot DMA protection is enabled" +msgstr "Ochrana přímého přístupu do paměti před startem operačního systému je zapnuta" + #. TRANSLATORS: version number of previous firmware msgid "Previous version" msgstr "Předchozí verze" @@ -1682,6 +1729,10 @@ msgid "Release Branch" msgstr "Větev vydání" +#. TRANSLATORS: release attributes +msgid "Release Flags" +msgstr "Příznaky vydání" + #. TRANSLATORS: the exact component on the server msgid "Release ID" msgstr "Identif. vydání" @@ -2031,6 +2082,10 @@ msgid "TPM PCR0 reconstruction" msgstr "Rekonstrukce TPM PCR0" +#. TRANSLATORS: HSI event title +msgid "TPM PCR0 reconstruction is invalid" +msgstr "Rekonstrukce TPM PCR0 není platná" + #. TRANSLATORS: Title: PCRs (Platform Configuration Registers) shouldn't be #. empty msgid "TPM empty PCRs" @@ -2086,6 +2141,10 @@ msgid "The system clock has not been set correctly and downloading files may fail." msgstr "Systémové hodiny nemají správný čas – stahování souborů se kvůli tomu nemusí zdařit." +#. TRANSLATORS: naughty vendor +msgid "The vendor did not supply any release notes." +msgstr "Výrobce neposkytl žádné poznámky k vydání." + #. TRANSLATORS: nothing to show msgid "There are no blocked firmware files" msgstr "Nejsou zde žádné blokované soubory s firmware" @@ -2101,6 +2160,10 @@ msgid "This device will be reverted back to %s when the %s command is performed." msgstr "Vykonáním příkazu %s bude toto zařízení vráceno zpět na verzi %s." +#. TRANSLATORS: the vendor did not upload this +msgid "This firmware is provided by LVFS community members and is not provided (or supported) by the original hardware vendor." +msgstr "Tento firmware je poskytován členy komunity LVFS a není poskytován (ani podporován) původním výrobcem hardware." + #. TRANSLATORS: unsupported build of the package msgid "This package has not been validated, it may not work properly." msgstr "Tento balíček nebyl ověřen – může se stát, že nebude fungovat správně." @@ -2148,6 +2211,14 @@ msgid "Transient failure" msgstr "Přechodný nezdar" +#. TRANSLATORS: We verified the meatdata against the server +msgid "Trusted metadata" +msgstr "Důvěryhodná metadata" + +#. TRANSLATORS: We verified the payload against the server +msgid "Trusted payload" +msgstr "Důvěryhodný obsah" + #. TRANSLATORS: remote type, e.g. remote or local msgid "Type" msgstr "Typ" @@ -2255,10 +2326,6 @@ msgid "Update State" msgstr "Stav aktualizace" -#. TRANSLATORS: command description -msgid "Update all devices that match local metadata" -msgstr "Aktualizovat veškerá zařízení, která se shodují s místními metadaty" - #. TRANSLATORS: the server sent the user a small message msgid "Update failure is a known issue, visit this URL for more information:" msgstr "Problém s nezdařenou aktualizací je už znám, další informace naleznete na této adrese:" @@ -2283,8 +2350,8 @@ msgstr "Aktualizovat uložená metadata stávajícím obsahem" #. TRANSLATORS: command description -msgid "Updates all firmware to latest versions available" -msgstr "Aktualizovat veškeré firmwary na nejnovější dostupné verze" +msgid "Updates all specified devices to latest firmware version, or all devices if unspecified" +msgstr "Aktualizuje firmware veškerých zadaných zařízení na nejnovější verzi, případně na všech zařízeních, pokud nejsou žádná vyjmenována" msgid "Updating" msgstr "Aktualizuje se" diff -Nru fwupd-1.7.4/po/da.po fwupd-1.7.5/po/da.po --- fwupd-1.7.4/po/da.po 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/po/da.po 2022-02-07 16:24:38.000000000 +0000 @@ -464,10 +464,6 @@ msgstr "Vælg et diskområde:" #. TRANSLATORS: command description -msgid "Clears any updates scheduled to be updated offline" -msgstr "Rydder opdateringer som er planlagt til at blive opdateret offline" - -#. TRANSLATORS: command description msgid "Clears the results from the last update" msgstr "Rydder resultaterne fra den sidste opdatering" @@ -974,7 +970,6 @@ msgstr "Firmwareopdateringer deaktiveret; kør 'fwupdmgr unlock' for at aktivere" #. TRANSLATORS: description of plugin state, e.g. disabled -#. TRANSLATORS: release properties msgid "Flags" msgstr "Flag" @@ -2073,10 +2068,6 @@ msgid "Update State" msgstr "Opdateringstilstand" -#. TRANSLATORS: command description -msgid "Update all devices that match local metadata" -msgstr "Opdater alle enheder som matcher lokale metadata" - #. TRANSLATORS: the server sent the user a small message msgid "Update failure is a known issue, visit this URL for more information:" msgstr "Opdateringer som mislykkes er et velkendt problem. Besøg URL'en for mere information:" @@ -2100,10 +2091,6 @@ msgid "Update the stored metadata with current contents" msgstr "Opdater det gemte metadata med det nuværende indhold" -#. TRANSLATORS: command description -msgid "Updates all firmware to latest versions available" -msgstr "Opdaterer alle firmware til de seneste versioner" - msgid "Updating" msgstr "Opdaterer" diff -Nru fwupd-1.7.4/po/de.po fwupd-1.7.5/po/de.po --- fwupd-1.7.4/po/de.po 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/po/de.po 2022-02-07 16:24:38.000000000 +0000 @@ -453,10 +453,6 @@ msgstr "Wählen Sie einen Datenträger:" #. TRANSLATORS: command description -msgid "Clears any updates scheduled to be updated offline" -msgstr "Löscht alle für die Offline-Aktualisierung geplanten Aktualisierungen" - -#. TRANSLATORS: command description msgid "Clears the results from the last update" msgstr "Bereinigt die Ergebnisse der letzten Aktualisierung" @@ -1914,10 +1910,6 @@ msgid "Update State" msgstr "Aktualisierungsstatus" -#. TRANSLATORS: command description -msgid "Update all devices that match local metadata" -msgstr "Alle Geräte aktualisieren, die mit lokalen Metadaten übereinstimmen" - #. TRANSLATORS: the server sent the user a small message msgid "Update failure is a known issue, visit this URL for more information:" msgstr "Der Aktualisierungsfehler ist ein bekanntes Problem, besuchen Sie diese URL für weitere Informationen:" @@ -1941,10 +1933,6 @@ msgid "Update the stored metadata with current contents" msgstr "Die gespeicherten Metadaten mit dem aktuellen Inhalt aktualisieren" -#. TRANSLATORS: command description -msgid "Updates all firmware to latest versions available" -msgstr "Alle Firmware auf die neueste verfügbare Version aktualisieren" - msgid "Updating" msgstr "Wird aktualisiert" diff -Nru fwupd-1.7.4/po/en_GB.po fwupd-1.7.5/po/en_GB.po --- fwupd-1.7.4/po/en_GB.po 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/po/en_GB.po 2022-02-07 16:24:38.000000000 +0000 @@ -311,6 +311,10 @@ msgid "Allow switching firmware branch" msgstr "Allow switching firmware branch" +#. TRANSLATORS: is not the main firmware stream +msgid "Alternate branch" +msgstr "Alternate branch" + #. TRANSLATORS: explain why we want to reboot msgid "An update requires a reboot to complete." msgstr "An update requires a reboot to complete." @@ -429,6 +433,10 @@ msgid "Blocked firmware files:" msgstr "Blocked firmware files:" +#. TRANSLATORS: version cannot be installed due to policy +msgid "Blocked version" +msgstr "Blocked version" + #. TRANSLATORS: we will not offer this firmware to the user msgid "Blocking firmware:" msgstr "Blocking firmware:" @@ -503,10 +511,6 @@ msgstr "Choose a volume:" #. TRANSLATORS: command description -msgid "Clears any updates scheduled to be updated offline" -msgstr "Clears any updates scheduled to be updated offline" - -#. TRANSLATORS: command description msgid "Clears the results from the last update" msgstr "Clears the results from the last update" @@ -514,6 +518,10 @@ msgid "Command not found" msgstr "Command not found" +#. TRANSLATORS: is not supported by the vendor +msgid "Community supported" +msgstr "Community supported" + #. TRANSLATORS: command description msgid "Convert a firmware file" msgstr "Convert a firmware file" @@ -792,6 +800,10 @@ msgid "Enabled fwupdate debugging" msgstr "Enabled fwupdate debugging" +#. TRANSLATORS: Plugin is active only if hardware is found +msgid "Enabled if hardware matches" +msgstr "Enabled if hardware matches" + #. TRANSLATORS: command description msgid "Enables a given remote" msgstr "Enables a given remote" @@ -1031,7 +1043,6 @@ msgstr "Firmware updates disabled; run 'fwupdmgr unlock' to enable" #. TRANSLATORS: description of plugin state, e.g. disabled -#. TRANSLATORS: release properties msgid "Flags" msgstr "Flags" @@ -1214,6 +1225,10 @@ msgid "Installing on %s…" msgstr "Installing on %s…" +#. TRANSLATORS: if it breaks, you get to keep both pieces +msgid "Installing this update may also void any device warranty." +msgstr "Installing this update may also void any device warranty." + #. TRANSLATORS: Title: BootGuard is a trademark from Intel msgid "Intel BootGuard" msgstr "Intel BootGuard" @@ -1265,10 +1280,18 @@ msgid "Invalid" msgstr "Invalid" +#. TRANSLATORS: version is older +msgid "Is downgrade" +msgstr "Is downgrade" + #. TRANSLATORS: Is currently in bootloader mode msgid "Is in bootloader mode" msgstr "Is in bootloader mode" +#. TRANSLATORS: version is newer +msgid "Is upgrade" +msgstr "Is upgrade" + #. TRANSLATORS: issue fixed with the release, e.g. CVE msgid "Issue" msgid_plural "Issues" @@ -1280,6 +1303,14 @@ msgstr "KEY,VALUE" #. TRANSLATORS: HSI event title +msgid "Kernel is no longer tainted" +msgstr "Kernel is no longer tainted" + +#. TRANSLATORS: HSI event title +msgid "Kernel is tainted" +msgstr "Kernel is tainted" + +#. TRANSLATORS: HSI event title msgid "Kernel lockdown disabled" msgstr "Kernel lockdown disabled" @@ -1418,6 +1449,10 @@ msgid "Mounts the ESP" msgstr "Mounts the ESP" +#. TRANSLATORS: we're poking around as a power user +msgid "NOTE: This program may only work correctly as root" +msgstr "NOTE: This program may only work correctly as root" + #. TRANSLATORS: Requires a reboot to apply firmware or to reload hardware msgid "Needs a reboot after installation" msgstr "Needs a reboot after installation" @@ -1475,6 +1510,10 @@ msgid "No updates were applied" msgstr "No updates were applied" +#. TRANSLATORS: version cannot be installed due to policy +msgid "Not approved" +msgstr "Not approved" + #. TRANSLATORS: Suffix: the HSI result msgid "Not found" msgstr "Not found" @@ -1569,6 +1608,14 @@ msgid "Pre-boot DMA protection" msgstr "Pre-boot DMA protection" +#. TRANSLATORS: HSI event title +msgid "Pre-boot DMA protection is disabled" +msgstr "Pre-boot DMA protection is disabled" + +#. TRANSLATORS: HSI event title +msgid "Pre-boot DMA protection is enabled" +msgstr "Pre-boot DMA protection is enabled" + #. TRANSLATORS: version number of previous firmware msgid "Previous version" msgstr "Previous version" @@ -1656,6 +1703,10 @@ msgid "Release Branch" msgstr "Release Branch" +#. TRANSLATORS: release attributes +msgid "Release Flags" +msgstr "Release Flags" + #. TRANSLATORS: the exact component on the server msgid "Release ID" msgstr "Release ID" @@ -2003,6 +2054,10 @@ msgid "TPM PCR0 reconstruction" msgstr "TPM PCR0 reconstruction" +#. TRANSLATORS: HSI event title +msgid "TPM PCR0 reconstruction is invalid" +msgstr "TPM PCR0 reconstruction is invalid" + #. TRANSLATORS: Title: PCRs (Platform Configuration Registers) shouldn't be #. empty msgid "TPM empty PCRs" @@ -2056,6 +2111,10 @@ msgid "The system clock has not been set correctly and downloading files may fail." msgstr "The system clock has not been set correctly and downloading files may fail." +#. TRANSLATORS: naughty vendor +msgid "The vendor did not supply any release notes." +msgstr "The vendor did not supply any release notes." + #. TRANSLATORS: nothing to show msgid "There are no blocked firmware files" msgstr "There are no blocked firmware files" @@ -2071,6 +2130,10 @@ msgid "This device will be reverted back to %s when the %s command is performed." msgstr "This device will be reverted back to %s when the %s command is performed." +#. TRANSLATORS: the vendor did not upload this +msgid "This firmware is provided by LVFS community members and is not provided (or supported) by the original hardware vendor." +msgstr "This firmware is provided by LVFS community members and is not provided (or supported) by the original hardware vendor." + #. TRANSLATORS: unsupported build of the package msgid "This package has not been validated, it may not work properly." msgstr "This package has not been validated, it may not work properly." @@ -2118,6 +2181,14 @@ msgid "Transient failure" msgstr "Transient failure" +#. TRANSLATORS: We verified the meatdata against the server +msgid "Trusted metadata" +msgstr "Trusted metadata" + +#. TRANSLATORS: We verified the payload against the server +msgid "Trusted payload" +msgstr "Trusted payload" + #. TRANSLATORS: remote type, e.g. remote or local msgid "Type" msgstr "Type" @@ -2225,10 +2296,6 @@ msgid "Update State" msgstr "Update State" -#. TRANSLATORS: command description -msgid "Update all devices that match local metadata" -msgstr "Update all devices that match local metadata" - #. TRANSLATORS: the server sent the user a small message msgid "Update failure is a known issue, visit this URL for more information:" msgstr "Update failure is a known issue, visit this URL for more information:" @@ -2253,8 +2320,8 @@ msgstr "Update the stored metadata with current contents" #. TRANSLATORS: command description -msgid "Updates all firmware to latest versions available" -msgstr "Updates all firmware to latest versions available" +msgid "Updates all specified devices to latest firmware version, or all devices if unspecified" +msgstr "Updates all specified devices to latest firmware version, or all devices if unspecified" msgid "Updating" msgstr "Updating" diff -Nru fwupd-1.7.4/po/fi.po fwupd-1.7.5/po/fi.po --- fwupd-1.7.4/po/fi.po 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/po/fi.po 2022-02-07 16:24:38.000000000 +0000 @@ -498,10 +498,6 @@ msgstr "Valitse asema:" #. TRANSLATORS: command description -msgid "Clears any updates scheduled to be updated offline" -msgstr "Tyhjentää päivitykset, jotka on tarkoitus päivittää yhteydettömässä tilassa" - -#. TRANSLATORS: command description msgid "Clears the results from the last update" msgstr "Tyhjennä viimeisimmän päivityksen tulokset" @@ -1016,7 +1012,6 @@ msgstr "Laiteohjelmiston päivitykset poistettu käytöstä; suorita 'fwupdmgr unlock' ottaaksesi ne käyttöön" #. TRANSLATORS: description of plugin state, e.g. disabled -#. TRANSLATORS: release properties msgid "Flags" msgstr "Liput" @@ -2186,10 +2181,6 @@ msgid "Update State" msgstr "Päivityksen tila" -#. TRANSLATORS: command description -msgid "Update all devices that match local metadata" -msgstr "Päivitä kaikki paikallisia metatietoja vastaavat laitteet" - #. TRANSLATORS: the server sent the user a small message msgid "Update failure is a known issue, visit this URL for more information:" msgstr "Päivityksen epäonnistuminen on tunnettu ongelma. Saat lisätietoja tästä URL-osoitteesta:" @@ -2213,10 +2204,6 @@ msgid "Update the stored metadata with current contents" msgstr "Päivitä tallennetut metatiedot nykyisellä sisällöllä" -#. TRANSLATORS: command description -msgid "Updates all firmware to latest versions available" -msgstr "Päivittää kaikki laiteohjelmistot uusimpiin saatavilla oleviin versioihin" - msgid "Updating" msgstr "Päivittää" diff -Nru fwupd-1.7.4/po/fr.po fwupd-1.7.5/po/fr.po --- fwupd-1.7.4/po/fr.po 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/po/fr.po 2022-02-07 16:24:38.000000000 +0000 @@ -7,6 +7,7 @@ # Corentin Noël , 2020 # Franck , 2015 # Julien Humbert , 2020-2021 +# Yolopix ​, 2022 msgid "" msgstr "" "Project-Id-Version: fwupd\n" @@ -151,6 +152,14 @@ msgstr "Une authentification est nécessaire pour signer les données en utilisant le certificat du client" #. TRANSLATORS: this is the PolicyKit modal dialog +msgid "Authentication is required to unlock a device" +msgstr "Authentification requise pour déverrouiller un périphérique" + +#. TRANSLATORS: this is the PolicyKit modal dialog +msgid "Authentication is required to update the firmware on a removable device" +msgstr "Authentification requise pour mettre à jour le micrologiciel sur un périphérique amovible" + +#. TRANSLATORS: this is the PolicyKit modal dialog msgid "Authentication is required to update the firmware on this machine" msgstr "Une authentification est nécessaire pour mettre à jour le micrologiciel sur cette machine" @@ -262,6 +271,10 @@ msgid "Device removed:" msgstr "Périphérique retiré :" +#. TRANSLATORS: command line option +msgid "Device update method" +msgstr "Méthode de mise à jour du périphérique" + #. TRANSLATORS: Suffix: the HSI result #. TRANSLATORS: Plugin is inactive and not used msgid "Disabled" @@ -275,6 +288,10 @@ msgstr "Afficher la version" #. TRANSLATORS: command line option +msgid "Do not check for old metadata" +msgstr "Ne pas vérifier d'anciennes métadonnées" + +#. TRANSLATORS: command line option msgid "Do not write to the history database" msgstr "Ne pas écrire dans la base de données de l'historique" @@ -347,6 +364,10 @@ msgid "Failed to apply update" msgstr "Échec d'application de la mise à jour" +#. TRANSLATORS: we could not get the devices to update offline +msgid "Failed to get pending devices" +msgstr "Impossible d'obtenir les périphériques en attente" + #. TRANSLATORS: we could not install for some reason msgid "Failed to install firmware update" msgstr "Échec d'installation de la mise à jour du micrologiciel" @@ -436,7 +457,6 @@ msgstr "Les mises à jour de micrologiciel sont désactivées ; exécutez «fwupdmgr unlock» pour les activer" #. TRANSLATORS: description of plugin state, e.g. disabled -#. TRANSLATORS: release properties msgid "Flags" msgstr "Drapeaux" @@ -444,6 +464,10 @@ msgid "Found" msgstr "Trouvé" +#. TRANSLATORS: title text, shown as a warning +msgid "Full Disk Encryption Detected" +msgstr "Chiffrement complet du disque détecté" + #. TRANSLATORS: global ID common to all similar hardware msgid "GUID" msgid_plural "GUIDs" @@ -488,13 +512,23 @@ msgid "Install a firmware file on this hardware" msgstr "Installer un fichier de micrologiciel sur ce matériel" +msgid "Install signed device firmware" +msgstr "Installer le micrologiciel signé du périphérique" + msgid "Install signed system firmware" msgstr "Installer le micrologiciel signé du système" +msgid "Install unsigned system firmware" +msgstr "Installer le micrologiciel non signé du système" + #. TRANSLATORS: console message when no Plymouth is installed msgid "Installing Firmware…" msgstr "Installation de micrologiciel…" +#. TRANSLATORS: this is shown when updating the firmware after the reboot +msgid "Installing firmware update…" +msgstr "Installation de la mise à jour du micrologiciel..." + #. TRANSLATORS: %1 is a device name #, c-format msgid "Installing on %s…" @@ -563,6 +597,10 @@ msgid "List entries in dbx" msgstr "Afficher la liste des entrées de la base dbx" +#. TRANSLATORS: command line option +msgid "List supported firmware updates" +msgstr "Liste les mises à jour de micrologiciel supportées" + #. TRANSLATORS: parsing the firmware information msgid "Loading…" msgstr "Chargement…" @@ -706,6 +744,10 @@ msgid "Rebooting…" msgstr "Redémarrage…" +#. TRANSLATORS: command description +msgid "Reinstall firmware on a device" +msgstr "Réinstaller le micrologiciel sur un périphérique" + #. TRANSLATORS: the first replacement is a display name #. * e.g. "ColorHugALS" and the second is a version number #. * e.g. "1.2.3" @@ -741,6 +783,22 @@ msgid "Run `fwupdmgr get-upgrades` for more information." msgstr "Exécutez «fwupdmgr get-upgrades» pour plus d'informations." +#. TRANSLATORS: this is shown in the MOTD +msgid "Run `fwupdmgr sync-bkc` to complete this action." +msgstr "Exécutez `fwupdmgr sync-bkc` pour terminer cette action." + +#. TRANSLATORS: scheduling an update to be done on the next boot +msgid "Scheduling…" +msgstr "Planification..." + +#. TRANSLATORS: HSI event title +msgid "Secure Boot disabled" +msgstr "Démarrage sécurisé désactivé" + +#. TRANSLATORS: HSI event title +msgid "Secure Boot enabled" +msgstr "Démarrage sécurisé activé" + #. TRANSLATORS: %s is a link to a website #, c-format msgid "See %s for more information." @@ -924,6 +982,10 @@ msgid "Unlocked" msgstr "Déverrouillé" +#. TRANSLATORS: command description +msgid "Unlocks the device for firmware access" +msgstr "Déverrouille le périphérique pour l'accès au micrologiciel" + #. TRANSLATORS: Device is updatable in this or any other mode msgid "Updatable" msgstr "Mise à jour possible" @@ -953,10 +1015,6 @@ msgid "Update requires a reboot" msgstr "La mise à jour nécessite un redémarrage" -#. TRANSLATORS: command description -msgid "Updates all firmware to latest versions available" -msgstr "Met à jour tous les micrologiciels aux dernières versions disponibles" - msgid "Updating" msgstr "Mise à jour" diff -Nru fwupd-1.7.4/po/fur.po fwupd-1.7.5/po/fur.po --- fwupd-1.7.4/po/fur.po 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/po/fur.po 2022-02-07 16:24:38.000000000 +0000 @@ -168,10 +168,6 @@ msgstr "Sielç une publicazion:" #. TRANSLATORS: command description -msgid "Clears any updates scheduled to be updated offline" -msgstr "Al nete ducj i inzornaments programâts di fâ fûr rêt" - -#. TRANSLATORS: command description msgid "Clears the results from the last update" msgstr "Al nete i risultâts dal ultin inzornament" @@ -812,10 +808,6 @@ msgid "Update the stored device verification information" msgstr "Inzorne lis informazions di verifiche dal dispositîf archiviadis" -#. TRANSLATORS: command description -msgid "Updates all firmware to latest versions available" -msgstr "Al inzorne ducj i firmware ae ultime version disponibile" - #. TRANSLATORS: the first replacement is a display name #. * e.g. "ColorHugALS" and the second and third are #. * version numbers e.g. "1.2.3" diff -Nru fwupd-1.7.4/po/gl.po fwupd-1.7.5/po/gl.po --- fwupd-1.7.4/po/gl.po 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/po/gl.po 2022-02-07 16:24:38.000000000 +0000 @@ -892,10 +892,6 @@ msgid "Unset the debugging flag during update" msgstr "Quitar a bandeira de depuración durante a actualización" -#. TRANSLATORS: command description -msgid "Update all devices that match local metadata" -msgstr "Actualizar todos os dispositivos que coincidan os metadatos locais" - #. TRANSLATORS: ask the user if we can update the metadata msgid "Update now?" msgstr "Actualizar agora" diff -Nru fwupd-1.7.4/po/he.po fwupd-1.7.5/po/he.po --- fwupd-1.7.4/po/he.po 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/po/he.po 2022-02-07 16:24:38.000000000 +0000 @@ -767,7 +767,6 @@ msgstr "עדכוני קושחה מושבתים, נא להריץ את ‚fwupdmgr unlock’ כדי להפעיל." #. TRANSLATORS: description of plugin state, e.g. disabled -#. TRANSLATORS: release properties msgid "Flags" msgstr "דגלים" @@ -1610,10 +1609,6 @@ msgid "Update State" msgstr "מצב עדכון" -#. TRANSLATORS: command description -msgid "Update all devices that match local metadata" -msgstr "עדכון כל ההתקנים שתואמים את נתוני העל המקומיים" - #. TRANSLATORS: the server sent the user a small message msgid "Update failure is a known issue, visit this URL for more information:" msgstr "כשל בעדכון זאת תקלה מוכרת, יש לבקר בכתובת למידע נוסף:" @@ -1633,10 +1628,6 @@ msgid "Update the stored metadata with current contents" msgstr "עדכון נתוני העל המאוחסנים בתכנים נוכחיים" -#. TRANSLATORS: command description -msgid "Updates all firmware to latest versions available" -msgstr "מעדכן את כל הקושחה לגרסאות הזמינות העדכניות ביותר" - msgid "Updating" msgstr "מתבצע עדכון" diff -Nru fwupd-1.7.4/po/hr.po fwupd-1.7.5/po/hr.po --- fwupd-1.7.4/po/hr.po 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/po/hr.po 2022-02-07 16:24:38.000000000 +0000 @@ -7,7 +7,7 @@ # gogo , 2016 # Ping , 2020-2021 # Ping , 2021 -# gogo , 2016-2021 +# gogo , 2016-2022 msgid "" msgstr "" "Project-Id-Version: fwupd\n" @@ -322,6 +322,10 @@ msgid "Allow switching firmware branch" msgstr "Dopusti prebacivanje između firmver grana" +#. TRANSLATORS: is not the main firmware stream +msgid "Alternate branch" +msgstr "Alternativni ogranak" + #. TRANSLATORS: explain why we want to reboot msgid "An update requires a reboot to complete." msgstr "Nadopuna zahtijeva ponovno pokretanje za završetak." @@ -441,6 +445,10 @@ msgid "Blocked firmware files:" msgstr "Datoteke blokiranog firmvera:" +#. TRANSLATORS: version cannot be installed due to policy +msgid "Blocked version" +msgstr "Blokirana inačica" + #. TRANSLATORS: we will not offer this firmware to the user msgid "Blocking firmware:" msgstr "Blokiranje firmvera:" @@ -515,10 +523,6 @@ msgstr "Odaberite uređaj:" #. TRANSLATORS: command description -msgid "Clears any updates scheduled to be updated offline" -msgstr "Uklanja sve nadopune zakazne za izvanmrežno nadopunjivanje" - -#. TRANSLATORS: command description msgid "Clears the results from the last update" msgstr "Uklanja rezultate posljednje nadopune" @@ -526,6 +530,10 @@ msgid "Command not found" msgstr "Naredba nije pronađena" +#. TRANSLATORS: is not supported by the vendor +msgid "Community supported" +msgstr "Podržano od strane zajednice" + #. TRANSLATORS: command description msgid "Convert a firmware file" msgstr "Pretvori datoteku firmvera" @@ -804,6 +812,10 @@ msgid "Enabled fwupdate debugging" msgstr "Omogući fwupdate otklanjanje grešaka" +#. TRANSLATORS: Plugin is active only if hardware is found +msgid "Enabled if hardware matches" +msgstr "Omogućeno ako se hardver podudara" + #. TRANSLATORS: command description msgid "Enables a given remote" msgstr "Omogućuje zadane udaljene lokacije" @@ -880,6 +892,10 @@ msgstr "NAZIV DATOTEKE ID-UREĐAJA" #. TRANSLATORS: command argument: uppercase, spaces->dashes +msgid "FILENAME OFFSET DATA [FIRMWARE-TYPE]" +msgstr "NAZIV DATOTEKE POMAKA PODATAKA [FIRMVER-VRSTA]" + +#. TRANSLATORS: command argument: uppercase, spaces->dashes msgid "FILENAME [DEVICE-ID|GUID]" msgstr "NAZIV DATOTEKA [UREĐAJ-ID|GUID]" @@ -1040,7 +1056,6 @@ msgstr "Nadopune firmvera su onemogućene ; pokrenite 'fwupdmgr unlock' za omogućavanje" #. TRANSLATORS: description of plugin state, e.g. disabled -#. TRANSLATORS: release properties msgid "Flags" msgstr "Oznake" @@ -1224,6 +1239,10 @@ msgid "Installing on %s…" msgstr "Instaliram na %s…" +#. TRANSLATORS: if it breaks, you get to keep both pieces +msgid "Installing this update may also void any device warranty." +msgstr "Instaliranje ove nadopune može poništiti svako jamstvo uređaja." + #. TRANSLATORS: Title: BootGuard is a trademark from Intel msgid "Intel BootGuard" msgstr "Intel BootGuard" @@ -1275,10 +1294,18 @@ msgid "Invalid" msgstr "Nevaljano" +#. TRANSLATORS: version is older +msgid "Is downgrade" +msgstr "Je nadogradnja na stariju inačicu" + #. TRANSLATORS: Is currently in bootloader mode msgid "Is in bootloader mode" msgstr "U načinu učitača pokretanja je" +#. TRANSLATORS: version is newer +msgid "Is upgrade" +msgstr "Je nadogradnja" + #. TRANSLATORS: issue fixed with the release, e.g. CVE msgid "Issue" msgid_plural "Issues" @@ -1291,6 +1318,14 @@ msgstr "KLJUČ,VRIJEDNOST" #. TRANSLATORS: HSI event title +msgid "Kernel is no longer tainted" +msgstr "Kernel više nije kontaminiran" + +#. TRANSLATORS: HSI event title +msgid "Kernel is tainted" +msgstr "Kernel je kontaminiran" + +#. TRANSLATORS: HSI event title msgid "Kernel lockdown disabled" msgstr "Zaključavanje kernela onemogućeno" @@ -1319,10 +1354,10 @@ msgstr "Licenca" msgid "Linux Vendor Firmware Service (stable firmware)" -msgstr "Firmver Usluga Linux Proizvođača (LVFS) (stabilni firmver)." +msgstr "Firmver Usluga Linux Proizvođača (LVFS) (stabilni firmver)" msgid "Linux Vendor Firmware Service (testing firmware)" -msgstr "Firmver Usluga Linux Proizvođača (LVFS) (testni firmver)." +msgstr "Firmver Usluga Linux Proizvođača (LVFS) (testni firmver)" #. TRANSLATORS: Title: if it's tainted or not msgid "Linux kernel" @@ -1429,6 +1464,10 @@ msgid "Mounts the ESP" msgstr "Montira ESP" +#. TRANSLATORS: we're poking around as a power user +msgid "NOTE: This program may only work correctly as root" +msgstr "NAPOMENA: Ovaj program može samo raditi samo s korijenskim ovlastima" + #. TRANSLATORS: Requires a reboot to apply firmware or to reload hardware msgid "Needs a reboot after installation" msgstr "Potrebno je ponovno pokretanje nakon instalacije" @@ -1486,6 +1525,10 @@ msgid "No updates were applied" msgstr "Nema primijenjenih nadopuna" +#. TRANSLATORS: version cannot be installed due to policy +msgid "Not approved" +msgstr "Nije odobreno" + #. TRANSLATORS: Suffix: the HSI result msgid "Not found" msgstr "Nije pronađeno" @@ -1543,6 +1586,10 @@ msgid "Password" msgstr "Lozinka" +#. TRANSLATORS: command description +msgid "Patch a firmware blob at a known offset" +msgstr "Zakrpaj datoteku firmvera na poznati pomak" + msgid "Payload" msgstr "Sadržaj prijenosa" @@ -1576,6 +1623,14 @@ msgid "Pre-boot DMA protection" msgstr "DMA zaštita predpokretanja" +#. TRANSLATORS: HSI event title +msgid "Pre-boot DMA protection is disabled" +msgstr "DMA zaštita prije pokretanja je onemogućena" + +#. TRANSLATORS: HSI event title +msgid "Pre-boot DMA protection is enabled" +msgstr "DMA zaštita prije pokretanja je omogućena" + #. TRANSLATORS: version number of previous firmware msgid "Previous version" msgstr "Prijašnja inačica" @@ -1663,6 +1718,10 @@ msgid "Release Branch" msgstr "Ogranak izdanja" +#. TRANSLATORS: release attributes +msgid "Release Flags" +msgstr "Oznake izdanja" + #. TRANSLATORS: the exact component on the server msgid "Release ID" msgstr "ID izdanja" @@ -2011,6 +2070,10 @@ msgid "TPM PCR0 reconstruction" msgstr "TPM PCR0 rekonstrukcija" +#. TRANSLATORS: HSI event title +msgid "TPM PCR0 reconstruction is invalid" +msgstr "TPM PCR0 rekonstrukcija je nevaljana" + #. TRANSLATORS: Title: PCRs (Platform Configuration Registers) shouldn't be #. empty msgid "TPM empty PCRs" @@ -2065,6 +2128,10 @@ msgid "The system clock has not been set correctly and downloading files may fail." msgstr "Sat sustava nije pravilno postavljen i preuzimanje datoteka možda ne uspije." +#. TRANSLATORS: naughty vendor +msgid "The vendor did not supply any release notes." +msgstr "Proizvođač nije objavio nikakve bilješke izdanja." + #. TRANSLATORS: nothing to show msgid "There are no blocked firmware files" msgstr "Nema blokiranih firmvera" @@ -2080,6 +2147,10 @@ msgid "This device will be reverted back to %s when the %s command is performed." msgstr "Ovaj uređaj će biti vraćen natrag na %s kada se %s naredba pokrene." +#. TRANSLATORS: the vendor did not upload this +msgid "This firmware is provided by LVFS community members and is not provided (or supported) by the original hardware vendor." +msgstr "Ovaj firmver je omogućen od strane LVFS članova zajednice i nije omogućen (ili podržan) od strane izvornog proizvođača hardvera." + #. TRANSLATORS: unsupported build of the package msgid "This package has not been validated, it may not work properly." msgstr "Ovaj paket još nije provjeren, možda neće ispravno raditi." @@ -2127,6 +2198,14 @@ msgid "Transient failure" msgstr "Privremeni kvar" +#. TRANSLATORS: We verified the meatdata against the server +msgid "Trusted metadata" +msgstr "Provjereni metapodaci" + +#. TRANSLATORS: We verified the payload against the server +msgid "Trusted payload" +msgstr "Provjereni sadržaj prijenosa" + #. TRANSLATORS: remote type, e.g. remote or local msgid "Type" msgstr "Vrsta" @@ -2234,10 +2313,6 @@ msgid "Update State" msgstr "Stanje nadopune" -#. TRANSLATORS: command description -msgid "Update all devices that match local metadata" -msgstr "Nadopuni sve uređaje koji se podudaraju s lokalnim metapodacima" - #. TRANSLATORS: the server sent the user a small message msgid "Update failure is a known issue, visit this URL for more information:" msgstr "Neuspješna nadopuna je poznat problem, posjetite ovaj URL za više informacija:" @@ -2262,8 +2337,8 @@ msgstr "Nadopuni pohranjene metapodatke s trenutnim sadržajem" #. TRANSLATORS: command description -msgid "Updates all firmware to latest versions available" -msgstr "Nadopuni sav firmver na najnovije dostupne inačice" +msgid "Updates all specified devices to latest firmware version, or all devices if unspecified" +msgstr "Nadopuni sve navedene uređaje na najnovije inačice firmvera, ili sve uređaje ako nisu navedeni" msgid "Updating" msgstr "Nadopunjivanje" diff -Nru fwupd-1.7.4/po/hu.po fwupd-1.7.5/po/hu.po --- fwupd-1.7.4/po/hu.po 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/po/hu.po 2022-02-07 16:24:38.000000000 +0000 @@ -295,10 +295,6 @@ msgstr "Válasszon kiadást:" #. TRANSLATORS: command description -msgid "Clears any updates scheduled to be updated offline" -msgstr "Törli a beütemezett offline frissítéseket" - -#. TRANSLATORS: command description msgid "Clears the results from the last update" msgstr "Törli a legutóbbi frissítésből származó eredményeket" @@ -580,7 +576,6 @@ msgstr "A firmware frissítések támogatottak ezen a gépen." #. TRANSLATORS: description of plugin state, e.g. disabled -#. TRANSLATORS: release properties msgid "Flags" msgstr "Jelzők" @@ -1193,10 +1188,6 @@ msgid "Update State" msgstr "Frissítés állapota" -#. TRANSLATORS: command description -msgid "Update all devices that match local metadata" -msgstr "Az összes olyan eszköz frissítése, amely illeszkedik a helyi metaadatokra" - #. TRANSLATORS: the server sent the user a small message msgid "Update failure is a known issue, visit this URL for more information:" msgstr "A feltöltési hiba ismert probléma, további információkért látogassa meg ezt az URL-t:" @@ -1220,10 +1211,6 @@ msgid "Update the stored metadata with current contents" msgstr "A tárolt metaadatok frissítése a jelenlegi tartalommal" -#. TRANSLATORS: command description -msgid "Updates all firmware to latest versions available" -msgstr "Minden firmware-t az elérhető legfrissebb verziókra frissít" - #. TRANSLATORS: the first replacement is a display name #. * e.g. "ColorHugALS" and the second and third are #. * version numbers e.g. "1.2.3" diff -Nru fwupd-1.7.4/po/id.po fwupd-1.7.5/po/id.po --- fwupd-1.7.4/po/id.po 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/po/id.po 2022-02-07 16:24:38.000000000 +0000 @@ -476,10 +476,6 @@ msgstr "Pilih volume:" #. TRANSLATORS: command description -msgid "Clears any updates scheduled to be updated offline" -msgstr "Membersihkan semua pembaruan yang dijadwalkan untuk diperbarui luring" - -#. TRANSLATORS: command description msgid "Clears the results from the last update" msgstr "Membersihkan hasil dari pemutakhiran terakhir" @@ -993,7 +989,6 @@ msgstr "Pembaruan firmware dinonaktifkan; jalankan 'fwupdmgr unlock' untuk mengaktifkan" #. TRANSLATORS: description of plugin state, e.g. disabled -#. TRANSLATORS: release properties msgid "Flags" msgstr "Flag" @@ -2147,10 +2142,6 @@ msgid "Update State" msgstr "Keadaan Pembaruan" -#. TRANSLATORS: command description -msgid "Update all devices that match local metadata" -msgstr "Perbarui semua perangkat yang cocok dengan metadata lokal" - #. TRANSLATORS: the server sent the user a small message msgid "Update failure is a known issue, visit this URL for more information:" msgstr "Kegagalan pembaruan adalah masalah yang telah diketahui, kunjungi URL ini untuk informasi lebih lanjut:" @@ -2174,10 +2165,6 @@ msgid "Update the stored metadata with current contents" msgstr "Perbarui metadata yang disimpan dengan konten saat ini" -#. TRANSLATORS: command description -msgid "Updates all firmware to latest versions available" -msgstr "Mutakhirkan semua firmware ke versi terbaru yang tersedia" - msgid "Updating" msgstr "Memutakhirkan" diff -Nru fwupd-1.7.4/po/it.po fwupd-1.7.5/po/it.po --- fwupd-1.7.4/po/it.po 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/po/it.po 2022-02-07 16:24:38.000000000 +0000 @@ -503,10 +503,6 @@ msgstr "Scegliere un volume:" #. TRANSLATORS: command description -msgid "Clears any updates scheduled to be updated offline" -msgstr "Annulla gli aggiornamenti pianificati per essere eseguiti offline" - -#. TRANSLATORS: command description msgid "Clears the results from the last update" msgstr "Pulisce i risultati dell'ultimo aggiornamento" @@ -562,6 +558,12 @@ msgid "Details" msgstr "Dettagli" +#. TRANSLATORS: the best known configuration is a set of software that we know +#. works well +#. * together. In the OEM and ODM industries it is often called a BKC +msgid "Deviate from the best known configuration?" +msgstr "Allontanarsi dalla migliore configurazione nota?" + #. TRANSLATORS: description of device ability msgid "Device Flags" msgstr "Flag dispositivo" @@ -1025,7 +1027,6 @@ msgstr "Aggiornamenti firmware disabilitati; eseguire «fwupdmgr unlock» per abilitarli" #. TRANSLATORS: description of plugin state, e.g. disabled -#. TRANSLATORS: release properties msgid "Flags" msgstr "Flag" @@ -1981,6 +1982,10 @@ msgid "Switch the firmware branch on the device" msgstr "Cambia il ramo del firmware sul dispositivo" +#. TRANSLATORS: command description +msgid "Sync firmware versions to the host best known configuration" +msgstr "Sincronizza le versioni del firmware con quelle migliori note dell'host" + #. TRANSLATORS: Must be plugged in to an outlet msgid "System requires external power source" msgstr "Il sistema richiede una sorgente elettrica esterna" @@ -2055,6 +2060,12 @@ msgid "There is no approved firmware." msgstr "Non ci sono firmware approvati." +#. TRANSLATORS: %1 is the current device version number, and %2 is the +#. command name, e.g. `fwupdmgr sync-bkc` +#, c-format +msgid "This device will be reverted back to %s when the %s command is performed." +msgstr "Questo dispositivo verrà retrocesso alla versione %s all'esecuzione del comando %s. " + #. TRANSLATORS: unsupported build of the package msgid "This package has not been validated, it may not work properly." msgstr "Questo pacchetto non è stato verificato, potrebbe non funzionare correttamente." @@ -2209,10 +2220,6 @@ msgid "Update State" msgstr "Stato aggiornamento" -#. TRANSLATORS: command description -msgid "Update all devices that match local metadata" -msgstr "Aggiorna tutti i dispositivi corrispondenti ai metadati locali" - #. TRANSLATORS: the server sent the user a small message msgid "Update failure is a known issue, visit this URL for more information:" msgstr "Questo è un problema noto, consultare il seguente URL per maggiori informazioni:" @@ -2236,10 +2243,6 @@ msgid "Update the stored metadata with current contents" msgstr "Aggiorna i metadati salvati con il contenuto attuale" -#. TRANSLATORS: command description -msgid "Updates all firmware to latest versions available" -msgstr "Aggiorna tutti i firmware all'ultima versione disponibile" - msgid "Updating" msgstr "Aggiornamento in corso" diff -Nru fwupd-1.7.4/po/ko.po fwupd-1.7.5/po/ko.po --- fwupd-1.7.4/po/ko.po 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/po/ko.po 2022-02-07 16:24:38.000000000 +0000 @@ -456,10 +456,6 @@ msgstr "볼륨 선택:" #. TRANSLATORS: command description -msgid "Clears any updates scheduled to be updated offline" -msgstr "오프라인으로 업데이트할 업데이트 지우기" - -#. TRANSLATORS: command description msgid "Clears the results from the last update" msgstr "최근 업데이트 결과 지우기" @@ -965,7 +961,6 @@ msgstr "펌웨어 업그레이드 비활성화됨. 활성화하려면 'fwupdmgr unlock' 명령을 실행하십시오" #. TRANSLATORS: description of plugin state, e.g. disabled -#. TRANSLATORS: release properties msgid "Flags" msgstr "플래그" @@ -2061,10 +2056,6 @@ msgid "Update State" msgstr "업데이트 상태" -#. TRANSLATORS: command description -msgid "Update all devices that match local metadata" -msgstr "로컬 메타데이터와 일치하는 모든 장치 업데이트" - #. TRANSLATORS: the server sent the user a small message msgid "Update failure is a known issue, visit this URL for more information:" msgstr "알 수 없는 이유로 업데이트가 실패했습니다. 더 많은 정보를 보려면 다음 URL을 참조하십시오:" @@ -2088,10 +2079,6 @@ msgid "Update the stored metadata with current contents" msgstr "저장된 메타데이터를 현재 내용으로 업데이트" -#. TRANSLATORS: command description -msgid "Updates all firmware to latest versions available" -msgstr "모든 펌웨어를 사용할 수 있는 최신 버전으로 업데이트" - msgid "Updating" msgstr "업데이트" diff -Nru fwupd-1.7.4/po/lt.po fwupd-1.7.5/po/lt.po --- fwupd-1.7.4/po/lt.po 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/po/lt.po 2022-02-07 16:24:38.000000000 +0000 @@ -330,10 +330,6 @@ msgstr "Pasirinkite laidą:" #. TRANSLATORS: command description -msgid "Clears any updates scheduled to be updated offline" -msgstr "Išvalo visus autonominiam atnaujinimui suplanuotus atnaujinimus" - -#. TRANSLATORS: command description msgid "Clears the results from the last update" msgstr "Išvalo rezultatus iš paskutinio atnaujinimo" @@ -672,7 +668,6 @@ msgstr "Šiame kompiuteryje yra prieinami programinės aparatinės įrangos atnaujinimai." #. TRANSLATORS: description of plugin state, e.g. disabled -#. TRANSLATORS: release properties msgid "Flags" msgstr "Vėliavėlės" @@ -1322,10 +1317,6 @@ msgid "Update State" msgstr "Atnaujinimo būsena" -#. TRANSLATORS: command description -msgid "Update all devices that match local metadata" -msgstr "Atnaujinti visus įrenginius, kurie atitinka vietinius metaduomenis" - #. TRANSLATORS: the server sent the user a small message msgid "Update failure is a known issue, visit this URL for more information:" msgstr "Atnaujinimo nesėkmė yra žinoma problema, išsamesnei informacijai apsilankykite šiame URL:" @@ -1345,10 +1336,6 @@ msgid "Update the stored metadata with current contents" msgstr "Atnaujinti saugomus metaduomenis esamu turiniu" -#. TRANSLATORS: command description -msgid "Updates all firmware to latest versions available" -msgstr "Atnaujina visą programinę aparatinę įrangą iki naujausios prieinamos versijos" - msgid "Updating" msgstr "Atnaujinama" diff -Nru fwupd-1.7.4/po/nl.po fwupd-1.7.5/po/nl.po --- fwupd-1.7.4/po/nl.po 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/po/nl.po 2022-02-07 16:24:38.000000000 +0000 @@ -244,10 +244,6 @@ msgid "Update the stored device verification information" msgstr "Opgeslagen apparaatverificatie-informatie bijwerken" -#. TRANSLATORS: command description -msgid "Updates all firmware to latest versions available" -msgstr "Werkt alle firmware bij naar de nieuwste versies die beschikbaar zijn" - #. TRANSLATORS: the first replacement is a display name #. * e.g. "ColorHugALS" and the second and third are #. * version numbers e.g. "1.2.3" diff -Nru fwupd-1.7.4/po/pl.po fwupd-1.7.5/po/pl.po --- fwupd-1.7.4/po/pl.po 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/po/pl.po 2022-02-07 16:24:38.000000000 +0000 @@ -3,7 +3,7 @@ # This file is distributed under the same license as the fwupd package. # # Translators: -# Piotr Drąg , 2015-2021 +# Piotr Drąg , 2015-2022 msgid "" msgstr "" "Project-Id-Version: fwupd\n" @@ -326,6 +326,10 @@ msgid "Allow switching firmware branch" msgstr "Umożliwia przełączanie gałęzi oprogramowania sprzętowego" +#. TRANSLATORS: is not the main firmware stream +msgid "Alternate branch" +msgstr "Alternatywna gałąź" + #. TRANSLATORS: explain why we want to reboot msgid "An update requires a reboot to complete." msgstr "Ukończenie aktualizacji wymaga ponownego uruchomienia." @@ -446,6 +450,10 @@ msgid "Blocked firmware files:" msgstr "Zablokowane pliki oprogramowania sprzętowego:" +#. TRANSLATORS: version cannot be installed due to policy +msgid "Blocked version" +msgstr "Zablokowana wersja" + #. TRANSLATORS: we will not offer this firmware to the user msgid "Blocking firmware:" msgstr "Blokowanie oprogramowania sprzętowego:" @@ -520,10 +528,6 @@ msgstr "Proszę wybrać wolumin:" #. TRANSLATORS: command description -msgid "Clears any updates scheduled to be updated offline" -msgstr "Usuwa wszystkie zaplanowane aktualizacje w trybie offline" - -#. TRANSLATORS: command description msgid "Clears the results from the last update" msgstr "Usuwa wyniki z ostatniej aktualizacji" @@ -531,6 +535,10 @@ msgid "Command not found" msgstr "Nie odnaleziono polecenia" +#. TRANSLATORS: is not supported by the vendor +msgid "Community supported" +msgstr "Wspierane przez społeczność" + #. TRANSLATORS: command description msgid "Convert a firmware file" msgstr "Konwertuje plik oprogramowania sprzętowego" @@ -809,6 +817,10 @@ msgid "Enabled fwupdate debugging" msgstr "Włączono debugowanie fwupdate" +#. TRANSLATORS: Plugin is active only if hardware is found +msgid "Enabled if hardware matches" +msgstr "Włączone, jeśli sprzęt pasuje" + #. TRANSLATORS: command description msgid "Enables a given remote" msgstr "Włącza podane repozytorium" @@ -885,6 +897,10 @@ msgstr "NAZWA-PLIKU IDENTYFIKATOR-URZĄDZENIA" #. TRANSLATORS: command argument: uppercase, spaces->dashes +msgid "FILENAME OFFSET DATA [FIRMWARE-TYPE]" +msgstr "NAZWA-PLIKU WYRÓWNANIE DANE [TYP-OPROGRAMOWANIA-SPRZĘTOWEGO]" + +#. TRANSLATORS: command argument: uppercase, spaces->dashes msgid "FILENAME [DEVICE-ID|GUID]" msgstr "NAZWA-PLIKU [IDENTYFIKATOR-URZĄDZENIA|GUID]" @@ -1046,7 +1062,6 @@ msgstr "Aktualizacje oprogramowania sprzętowego są wyłączone; wykonanie polecenia „fwupdmgr unlock” je włączy" #. TRANSLATORS: description of plugin state, e.g. disabled -#. TRANSLATORS: release properties msgid "Flags" msgstr "Flagi" @@ -1231,6 +1246,10 @@ msgid "Installing on %s…" msgstr "Instalowanie na urządzeniu %s…" +#. TRANSLATORS: if it breaks, you get to keep both pieces +msgid "Installing this update may also void any device warranty." +msgstr "Zainstalowanie tej aktualizacji może także spowodować utratę wszelkiej gwarancji na urządzenie." + #. TRANSLATORS: Title: BootGuard is a trademark from Intel msgid "Intel BootGuard" msgstr "Intel BootGuard" @@ -1282,10 +1301,18 @@ msgid "Invalid" msgstr "Nieprawidłowe" +#. TRANSLATORS: version is older +msgid "Is downgrade" +msgstr "Jest instalacją poprzedniej wersji" + #. TRANSLATORS: Is currently in bootloader mode msgid "Is in bootloader mode" msgstr "Jest w trybie programu startowego" +#. TRANSLATORS: version is newer +msgid "Is upgrade" +msgstr "Jest aktualizacją" + #. TRANSLATORS: issue fixed with the release, e.g. CVE msgid "Issue" msgid_plural "Issues" @@ -1299,6 +1326,14 @@ msgstr "KLUCZ,WARTOŚĆ" #. TRANSLATORS: HSI event title +msgid "Kernel is no longer tainted" +msgstr "Jądro nie jest już skażone" + +#. TRANSLATORS: HSI event title +msgid "Kernel is tainted" +msgstr "Jądro jest skażone" + +#. TRANSLATORS: HSI event title msgid "Kernel lockdown disabled" msgstr "Wyłączono blokadę jądra" @@ -1437,6 +1472,10 @@ msgid "Mounts the ESP" msgstr "Montuje MSP" +#. TRANSLATORS: we're poking around as a power user +msgid "NOTE: This program may only work correctly as root" +msgstr "UWAGA: ten program może działać poprawnie tylko jako root" + #. TRANSLATORS: Requires a reboot to apply firmware or to reload hardware msgid "Needs a reboot after installation" msgstr "Wymaga ponownego uruchomienia po instalacji" @@ -1494,6 +1533,10 @@ msgid "No updates were applied" msgstr "Nie zastosowano żadnych aktualizacji" +#. TRANSLATORS: version cannot be installed due to policy +msgid "Not approved" +msgstr "Niezatwierdzone" + #. TRANSLATORS: Suffix: the HSI result msgid "Not found" msgstr "Nie odnaleziono" @@ -1551,6 +1594,10 @@ msgid "Password" msgstr "Hasło" +#. TRANSLATORS: command description +msgid "Patch a firmware blob at a known offset" +msgstr "Łata zamknięte oprogramowanie sprzętowe pod znanym wyrównaniem" + msgid "Payload" msgstr "Dane" @@ -1584,6 +1631,14 @@ msgid "Pre-boot DMA protection" msgstr "Ochrona DMA przed uruchomieniem" +#. TRANSLATORS: HSI event title +msgid "Pre-boot DMA protection is disabled" +msgstr "Ochrona DMA przed uruchomieniem jest wyłączona" + +#. TRANSLATORS: HSI event title +msgid "Pre-boot DMA protection is enabled" +msgstr "Ochrona DMA przed uruchomieniem jest włączona" + #. TRANSLATORS: version number of previous firmware msgid "Previous version" msgstr "Poprzednia wersja" @@ -1671,6 +1726,10 @@ msgid "Release Branch" msgstr "Gałąź wydania" +#. TRANSLATORS: release attributes +msgid "Release Flags" +msgstr "Flagi wydania" + #. TRANSLATORS: the exact component on the server msgid "Release ID" msgstr "Identyfikator wydania" @@ -2020,6 +2079,10 @@ msgid "TPM PCR0 reconstruction" msgstr "Rekonstrukcja PCR0 TPM" +#. TRANSLATORS: HSI event title +msgid "TPM PCR0 reconstruction is invalid" +msgstr "Rekonstrukcja PCR0 TPM jest nieprawidłowa" + #. TRANSLATORS: Title: PCRs (Platform Configuration Registers) shouldn't be #. empty msgid "TPM empty PCRs" @@ -2075,6 +2138,10 @@ msgid "The system clock has not been set correctly and downloading files may fail." msgstr "Zegar komputera nie jest poprawnie ustawiony i pobieranie plików może się nie powieść." +#. TRANSLATORS: naughty vendor +msgid "The vendor did not supply any release notes." +msgstr "Dostawca nie dostarczył żadnych informacji o wydaniu." + #. TRANSLATORS: nothing to show msgid "There are no blocked firmware files" msgstr "Nie ma zablokowanych plików oprogramowania sprzętowego" @@ -2090,6 +2157,10 @@ msgid "This device will be reverted back to %s when the %s command is performed." msgstr "To urządzenie zostanie przywrócone do wersji %s po wykonaniu polecenia %s." +#. TRANSLATORS: the vendor did not upload this +msgid "This firmware is provided by LVFS community members and is not provided (or supported) by the original hardware vendor." +msgstr "To oprogramowanie sprzętowe jest dostarczane przez członków społeczności LVFS i nie jest dostarczane (ani wspierane) przez oryginalnego dostawcę sprzętu." + #. TRANSLATORS: unsupported build of the package msgid "This package has not been validated, it may not work properly." msgstr "Ten pakiet nie został zweryfikowany, może nie działać poprawnie." @@ -2137,6 +2208,14 @@ msgid "Transient failure" msgstr "Przejściowe niepowodzenie" +#. TRANSLATORS: We verified the meatdata against the server +msgid "Trusted metadata" +msgstr "Zweryfikowane metadane" + +#. TRANSLATORS: We verified the payload against the server +msgid "Trusted payload" +msgstr "Zweryfikowane dane" + #. TRANSLATORS: remote type, e.g. remote or local msgid "Type" msgstr "Typ" @@ -2244,10 +2323,6 @@ msgid "Update State" msgstr "Stan aktualizacji" -#. TRANSLATORS: command description -msgid "Update all devices that match local metadata" -msgstr "Aktualizuje wszystkie urządzenia pasujące do lokalnych metadanych" - #. TRANSLATORS: the server sent the user a small message msgid "Update failure is a known issue, visit this URL for more information:" msgstr "Niepowodzenie aktualizacji to znany problem, pod tym adresem dostępnych jest więcej informacji:" @@ -2272,8 +2347,8 @@ msgstr "Aktualizuje przechowywane metadane obecną zawartością" #. TRANSLATORS: command description -msgid "Updates all firmware to latest versions available" -msgstr "Aktualizuje całe oprogramowanie sprzętowe do najnowszych dostępnych wersji" +msgid "Updates all specified devices to latest firmware version, or all devices if unspecified" +msgstr "Aktualizuje wszystkie podane urządzenia do najnowszej wersji oprogramowania sprzętowego, lub wszystkie urządzenia, jeśli nie podano żadnych" msgid "Updating" msgstr "Aktualizowanie" diff -Nru fwupd-1.7.4/po/pt_BR.po fwupd-1.7.5/po/pt_BR.po --- fwupd-1.7.4/po/pt_BR.po 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/po/pt_BR.po 2022-02-07 16:24:38.000000000 +0000 @@ -467,10 +467,6 @@ msgstr "Escolha um volume:" #. TRANSLATORS: command description -msgid "Clears any updates scheduled to be updated offline" -msgstr "Limpa quaisquer atualizações agendadas a serem atualizadas desconectadas" - -#. TRANSLATORS: command description msgid "Clears the results from the last update" msgstr "Limpa os resultados da última atualização" @@ -977,7 +973,6 @@ msgstr "Atualizações de firmware desabilitadas; execute \"fwupdmgr unlock\" para habilitar" #. TRANSLATORS: description of plugin state, e.g. disabled -#. TRANSLATORS: release properties msgid "Flags" msgstr "Opções" @@ -2076,10 +2071,6 @@ msgid "Update State" msgstr "Estado da atualização" -#. TRANSLATORS: command description -msgid "Update all devices that match local metadata" -msgstr "Atualiza todos os dispositivos que correspondem aos metadados locais" - #. TRANSLATORS: the server sent the user a small message msgid "Update failure is a known issue, visit this URL for more information:" msgstr "A falha de atualização é um problema conhecido, visite essa URL para mais informações:" @@ -2103,10 +2094,6 @@ msgid "Update the stored metadata with current contents" msgstr "Atualiza os metadados armazenados com o conteúdo atual" -#. TRANSLATORS: command description -msgid "Updates all firmware to latest versions available" -msgstr "Atualiza todos os firmwares para a versão mais recente disponível" - msgid "Updating" msgstr "Atualizando" diff -Nru fwupd-1.7.4/po/pt.po fwupd-1.7.5/po/pt.po --- fwupd-1.7.4/po/pt.po 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/po/pt.po 2022-02-07 16:24:38.000000000 +0000 @@ -464,10 +464,6 @@ msgstr "Escolha um volume:" #. TRANSLATORS: command description -msgid "Clears any updates scheduled to be updated offline" -msgstr "Limpa quaisquer atualizações agendadas a serem atualizadas desconectadas" - -#. TRANSLATORS: command description msgid "Clears the results from the last update" msgstr "Limpa os resultados da última atualização" @@ -974,7 +970,6 @@ msgstr "Atualizações de firmware desabilitadas; execute \"fwupdmgr unlock\" para habilitar" #. TRANSLATORS: description of plugin state, e.g. disabled -#. TRANSLATORS: release properties msgid "Flags" msgstr "Opções" @@ -2091,10 +2086,6 @@ msgid "Update State" msgstr "Estado da atualização" -#. TRANSLATORS: command description -msgid "Update all devices that match local metadata" -msgstr "Atualiza todos os dispositivos que correspondem aos metadados locais" - #. TRANSLATORS: the server sent the user a small message msgid "Update failure is a known issue, visit this URL for more information:" msgstr "A falha de atualização é um problema conhecido, visite esta URL para mais informações:" @@ -2118,10 +2109,6 @@ msgid "Update the stored metadata with current contents" msgstr "Atualiza os metadados armazenados com o conteúdo atual" -#. TRANSLATORS: command description -msgid "Updates all firmware to latest versions available" -msgstr "Atualiza todos os firmwares para a versão mais recente disponível" - msgid "Updating" msgstr "Atualizando" diff -Nru fwupd-1.7.4/po/ru.po fwupd-1.7.5/po/ru.po --- fwupd-1.7.4/po/ru.po 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/po/ru.po 2022-02-07 16:24:38.000000000 +0000 @@ -254,10 +254,6 @@ msgstr "Выберите релиз:" #. TRANSLATORS: command description -msgid "Clears any updates scheduled to be updated offline" -msgstr "Очистить все обновления, которые запланированы для автономного режима" - -#. TRANSLATORS: command description msgid "Clears the results from the last update" msgstr "Очистить результаты c последнего обновления" @@ -477,7 +473,6 @@ msgstr "Обновления прошивки поддерживаются на этой машине." #. TRANSLATORS: description of plugin state, e.g. disabled -#. TRANSLATORS: release properties msgid "Flags" msgstr "Флаги" @@ -882,10 +877,6 @@ msgid "Unsupported daemon version %s, client version is %s" msgstr "Неподдерживаемая фоновая служба версии %s, клиент версии %s" -#. TRANSLATORS: command description -msgid "Update all devices that match local metadata" -msgstr "Обновить все устройства, которые соответствуют локальным метаданным" - #. TRANSLATORS: the server sent the user a small message msgid "Update failure is a known issue, visit this URL for more information:" msgstr "Ошибка обновления — известная проблема, посетите этот URL для получения дополнительной информации:" @@ -901,10 +892,6 @@ msgid "Update the stored metadata with current contents" msgstr "Обновить сохраненные метаданные с текущим содержимым" -#. TRANSLATORS: command description -msgid "Updates all firmware to latest versions available" -msgstr "Обновить все прошивки до их последних доступных версий" - #. TRANSLATORS: the first replacement is a display name #. * e.g. "ColorHugALS" and the second and third are #. * version numbers e.g. "1.2.3" diff -Nru fwupd-1.7.4/po/sk.po fwupd-1.7.5/po/sk.po --- fwupd-1.7.4/po/sk.po 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/po/sk.po 2022-02-07 16:24:38.000000000 +0000 @@ -211,10 +211,6 @@ msgid "Unlocks the device for firmware access" msgstr "Odomkne zariadenie pre prístup k firmvéru" -#. TRANSLATORS: command description -msgid "Updates all firmware to latest versions available" -msgstr "Aktualizuje všetok firmvér na najnovšiu dostupnú verziu" - #. TRANSLATORS: the first replacement is a display name #. * e.g. "ColorHugALS" and the second and third are #. * version numbers e.g. "1.2.3" diff -Nru fwupd-1.7.4/po/sr.po fwupd-1.7.5/po/sr.po --- fwupd-1.7.4/po/sr.po 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/po/sr.po 2022-02-07 16:24:38.000000000 +0000 @@ -95,10 +95,6 @@ msgstr "Изаберите издање:" #. TRANSLATORS: command description -msgid "Clears any updates scheduled to be updated offline" -msgstr "Очисти сва ажурирања заказана за ажурирање ван мреже" - -#. TRANSLATORS: command description msgid "Clears the results from the last update" msgstr "Чисти резултате последњег ажурирања" @@ -457,10 +453,6 @@ msgid "Update the stored device verification information" msgstr "Ажурирајте причуване податке потврђивања уређаја" -#. TRANSLATORS: command description -msgid "Updates all firmware to latest versions available" -msgstr "Ажурира сав фирмвер на последња доступна издања" - #. TRANSLATORS: the first replacement is a display name #. * e.g. "ColorHugALS" and the second and third are #. * version numbers e.g. "1.2.3" diff -Nru fwupd-1.7.4/po/sv.po fwupd-1.7.5/po/sv.po --- fwupd-1.7.4/po/sv.po 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/po/sv.po 2022-02-07 16:24:38.000000000 +0000 @@ -3,7 +3,7 @@ # This file is distributed under the same license as the fwupd package. # # Translators: -# Anders Jonsson , 2017,2019-2021 +# Anders Jonsson , 2017,2019-2022 # Andreas Henriksson , 2017 # Josef Andersson , 2015,2017-2018 # Josef Andersson , 2015,2017 @@ -316,6 +316,10 @@ msgid "Allow switching firmware branch" msgstr "Tillåt att byta gren för fast programvara" +#. TRANSLATORS: is not the main firmware stream +msgid "Alternate branch" +msgstr "Alternativ gren" + #. TRANSLATORS: explain why we want to reboot msgid "An update requires a reboot to complete." msgstr "En uppdatering kräver en omstart för att färdigställas." @@ -434,6 +438,10 @@ msgid "Blocked firmware files:" msgstr "Blockerade fast programvarufiler:" +#. TRANSLATORS: version cannot be installed due to policy +msgid "Blocked version" +msgstr "Blockerad version" + #. TRANSLATORS: we will not offer this firmware to the user msgid "Blocking firmware:" msgstr "Blockera fast programvara:" @@ -508,10 +516,6 @@ msgstr "Välj en volym:" #. TRANSLATORS: command description -msgid "Clears any updates scheduled to be updated offline" -msgstr "Rensa eventuella uppdateringar som schemalagts att bli tillämpade frånkopplade" - -#. TRANSLATORS: command description msgid "Clears the results from the last update" msgstr "Rensar resultaten från senaste uppdateringen" @@ -519,6 +523,10 @@ msgid "Command not found" msgstr "Kommandot hittades inte" +#. TRANSLATORS: is not supported by the vendor +msgid "Community supported" +msgstr "Stöds av gemenskapen" + #. TRANSLATORS: command description msgid "Convert a firmware file" msgstr "Konvertera en fast programvarufil" @@ -797,6 +805,10 @@ msgid "Enabled fwupdate debugging" msgstr "Aktiverade fwupdate-felsökning" +#. TRANSLATORS: Plugin is active only if hardware is found +msgid "Enabled if hardware matches" +msgstr "Aktiverad om hårdvaran matchar" + #. TRANSLATORS: command description msgid "Enables a given remote" msgstr "Aktiverar en given fjärrkälla" @@ -873,6 +885,10 @@ msgstr "FILNAMN ENHETS-ID" #. TRANSLATORS: command argument: uppercase, spaces->dashes +msgid "FILENAME OFFSET DATA [FIRMWARE-TYPE]" +msgstr "FILNAMN AVSTÅND DATA [FAST-PROGRAMVARUTYP]" + +#. TRANSLATORS: command argument: uppercase, spaces->dashes msgid "FILENAME [DEVICE-ID|GUID]" msgstr "FILNAMN [ENHETS-ID|GUID]" @@ -1032,7 +1048,6 @@ msgstr "Uppdateringar för fast programvara är inaktiverade; kör ”fwupdmgr unlock” för att aktivera" #. TRANSLATORS: description of plugin state, e.g. disabled -#. TRANSLATORS: release properties msgid "Flags" msgstr "Flaggor" @@ -1215,6 +1230,10 @@ msgid "Installing on %s…" msgstr "Installerar på %s…" +#. TRANSLATORS: if it breaks, you get to keep both pieces +msgid "Installing this update may also void any device warranty." +msgstr "Installation av denna uppdatering kan också ogiltigförklara eventuell garanti för enheten." + #. TRANSLATORS: Title: BootGuard is a trademark from Intel msgid "Intel BootGuard" msgstr "Intel BootGuard" @@ -1266,10 +1285,18 @@ msgid "Invalid" msgstr "Ogiltig" +#. TRANSLATORS: version is older +msgid "Is downgrade" +msgstr "Är nedgradering" + #. TRANSLATORS: Is currently in bootloader mode msgid "Is in bootloader mode" msgstr "Är i starthanterarläge" +#. TRANSLATORS: version is newer +msgid "Is upgrade" +msgstr "Är uppgradering" + #. TRANSLATORS: issue fixed with the release, e.g. CVE msgid "Issue" msgid_plural "Issues" @@ -1281,6 +1308,14 @@ msgstr "NYCKEL,VÄRDE" #. TRANSLATORS: HSI event title +msgid "Kernel is no longer tainted" +msgstr "Kärnan är ej längre befläckad" + +#. TRANSLATORS: HSI event title +msgid "Kernel is tainted" +msgstr "Kärnan är befläckad" + +#. TRANSLATORS: HSI event title msgid "Kernel lockdown disabled" msgstr "Lockdown för Linux-kärnan inaktiverad" @@ -1419,6 +1454,10 @@ msgid "Mounts the ESP" msgstr "Monterar ESP" +#. TRANSLATORS: we're poking around as a power user +msgid "NOTE: This program may only work correctly as root" +msgstr "OBS: Detta program kommer endast fungera korrekt som root" + #. TRANSLATORS: Requires a reboot to apply firmware or to reload hardware msgid "Needs a reboot after installation" msgstr "Kräver en omstart efter installation" @@ -1476,6 +1515,10 @@ msgid "No updates were applied" msgstr "Inga uppdateringar applicerades" +#. TRANSLATORS: version cannot be installed due to policy +msgid "Not approved" +msgstr "Inte godkänd" + #. TRANSLATORS: Suffix: the HSI result msgid "Not found" msgstr "Hittades inte" @@ -1533,6 +1576,10 @@ msgid "Password" msgstr "Lösenord" +#. TRANSLATORS: command description +msgid "Patch a firmware blob at a known offset" +msgstr "Patcha en fast programvaru-blob på ett känt avstånd" + msgid "Payload" msgstr "Nyttolast" @@ -1566,6 +1613,14 @@ msgid "Pre-boot DMA protection" msgstr "DMA-skydd före uppstart" +#. TRANSLATORS: HSI event title +msgid "Pre-boot DMA protection is disabled" +msgstr "DMA-skydd före uppstart är inaktiverat" + +#. TRANSLATORS: HSI event title +msgid "Pre-boot DMA protection is enabled" +msgstr "DMA-skydd före uppstart är aktiverat" + #. TRANSLATORS: version number of previous firmware msgid "Previous version" msgstr "Föregående version" @@ -1653,6 +1708,10 @@ msgid "Release Branch" msgstr "Utgåvegren" +#. TRANSLATORS: release attributes +msgid "Release Flags" +msgstr "Utgåveflaggor" + #. TRANSLATORS: the exact component on the server msgid "Release ID" msgstr "Utgåva-ID" @@ -2000,6 +2059,10 @@ msgid "TPM PCR0 reconstruction" msgstr "TPM PCR0-rekonstruktion" +#. TRANSLATORS: HSI event title +msgid "TPM PCR0 reconstruction is invalid" +msgstr "TPM PCR0-rekonstruktion är ogiltig" + #. TRANSLATORS: Title: PCRs (Platform Configuration Registers) shouldn't be #. empty msgid "TPM empty PCRs" @@ -2053,6 +2116,10 @@ msgid "The system clock has not been set correctly and downloading files may fail." msgstr "Systemklockan har inte ställts in korrekt och hämtning av filer kan misslyckas." +#. TRANSLATORS: naughty vendor +msgid "The vendor did not supply any release notes." +msgstr "Tillverkaren tillhandahöll inte några kommentarer till utgåvan." + #. TRANSLATORS: nothing to show msgid "There are no blocked firmware files" msgstr "Det finns inga blockerade fast programvarufiler" @@ -2068,6 +2135,10 @@ msgid "This device will be reverted back to %s when the %s command is performed." msgstr "Denna enhet kommer att återställas till %s när kommandot %s körs." +#. TRANSLATORS: the vendor did not upload this +msgid "This firmware is provided by LVFS community members and is not provided (or supported) by the original hardware vendor." +msgstr "Denna fasta programvara tillhandahålls av medlemmar av LVFS-gemenskapen och varken tillhandahålls (eller stöds) av den ursprungliga hårdvarutillverkaren." + #. TRANSLATORS: unsupported build of the package msgid "This package has not been validated, it may not work properly." msgstr "Detta paket har inte validerats, det kanske inte fungerar korrekt." @@ -2115,6 +2186,14 @@ msgid "Transient failure" msgstr "Tillfälligt misslyckande" +#. TRANSLATORS: We verified the meatdata against the server +msgid "Trusted metadata" +msgstr "Betrodda metadata" + +#. TRANSLATORS: We verified the payload against the server +msgid "Trusted payload" +msgstr "Betrodd nyttolast" + #. TRANSLATORS: remote type, e.g. remote or local msgid "Type" msgstr "Typ" @@ -2222,10 +2301,6 @@ msgid "Update State" msgstr "Uppdateringstillstånd" -#. TRANSLATORS: command description -msgid "Update all devices that match local metadata" -msgstr "Uppdatera alla enheter som matchar lokal metadata" - #. TRANSLATORS: the server sent the user a small message msgid "Update failure is a known issue, visit this URL for more information:" msgstr "Misslyckad uppdatering är ett känt fel, besök denna URL för mer information:" @@ -2250,8 +2325,8 @@ msgstr "Uppdatera lagrad metadata med aktuellt innehåll" #. TRANSLATORS: command description -msgid "Updates all firmware to latest versions available" -msgstr "Uppdaterar all fast programvara till de senast tillgängliga versionerna" +msgid "Updates all specified devices to latest firmware version, or all devices if unspecified" +msgstr "Uppdaterar alla angivna enheter till senaste version av fast programvara, eller alla enheter om ej angivet" msgid "Updating" msgstr "Uppdaterar" diff -Nru fwupd-1.7.4/po/tr.po fwupd-1.7.5/po/tr.po --- fwupd-1.7.4/po/tr.po 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/po/tr.po 2022-02-07 16:24:38.000000000 +0000 @@ -296,10 +296,6 @@ msgstr "Bölüm seçiniz:" #. TRANSLATORS: command description -msgid "Clears any updates scheduled to be updated offline" -msgstr "Çevrimdışı olarak güncellenmesi planlanan tüm güncellemeleri temizler" - -#. TRANSLATORS: command description msgid "Clears the results from the last update" msgstr "Son güncellemenin sonuçlarını temizler" @@ -563,7 +559,6 @@ msgstr "Ürün yazılımı güncellemeleri bu makinede destekleniyor." #. TRANSLATORS: description of plugin state, e.g. disabled -#. TRANSLATORS: release properties msgid "Flags" msgstr "Bayraklar" @@ -1238,10 +1233,6 @@ msgid "Update the stored device verification information" msgstr "Saklanan aygıt doğrulama bilgilerini güncelle" -#. TRANSLATORS: command description -msgid "Updates all firmware to latest versions available" -msgstr "Tüm ürün yazılımlarını mevcut en son sürümlere güncelle" - #. TRANSLATORS: %1 is a device name #, c-format msgid "Updating %s…" diff -Nru fwupd-1.7.4/po/uk.po fwupd-1.7.5/po/uk.po --- fwupd-1.7.4/po/uk.po 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/po/uk.po 2022-02-07 16:24:38.000000000 +0000 @@ -326,6 +326,10 @@ msgid "Allow switching firmware branch" msgstr "Дозволити перемикання гілок мікропрограми" +#. TRANSLATORS: is not the main firmware stream +msgid "Alternate branch" +msgstr "Альтернативна гілка" + #. TRANSLATORS: explain why we want to reboot msgid "An update requires a reboot to complete." msgstr "Для завершення оновлення слід перезавантажити систему." @@ -446,6 +450,10 @@ msgid "Blocked firmware files:" msgstr "Заблоковані файли мікропрограм:" +#. TRANSLATORS: version cannot be installed due to policy +msgid "Blocked version" +msgstr "Заблокована версія" + #. TRANSLATORS: we will not offer this firmware to the user msgid "Blocking firmware:" msgstr "Блокуємо мікропрограму:" @@ -520,10 +528,6 @@ msgstr "Виберіть том:" #. TRANSLATORS: command description -msgid "Clears any updates scheduled to be updated offline" -msgstr "Спорожняє список усіх оновлень, які заплановано для автономного режиму" - -#. TRANSLATORS: command description msgid "Clears the results from the last update" msgstr "Вилучає результати останнього оновлення" @@ -531,6 +535,10 @@ msgid "Command not found" msgstr "Такої команди не знайдено" +#. TRANSLATORS: is not supported by the vendor +msgid "Community supported" +msgstr "Підтримка спільноти" + #. TRANSLATORS: command description msgid "Convert a firmware file" msgstr "Перетворити файл мікропрограми" @@ -809,6 +817,10 @@ msgid "Enabled fwupdate debugging" msgstr "Увімкнено діагностику fwupdate" +#. TRANSLATORS: Plugin is active only if hardware is found +msgid "Enabled if hardware matches" +msgstr "Увімкнено, якщо обладнання є відповідним" + #. TRANSLATORS: command description msgid "Enables a given remote" msgstr "Вмикає вказане віддалене сховище" @@ -1050,7 +1062,6 @@ msgstr "Оновлення мікропрограми вимкнено; віддайте команду 'fwupdmgr unlock', щоб їх увімкнути" #. TRANSLATORS: description of plugin state, e.g. disabled -#. TRANSLATORS: release properties msgid "Flags" msgstr "Прапорці" @@ -1235,6 +1246,10 @@ msgid "Installing on %s…" msgstr "Встановлюємо на %s…" +#. TRANSLATORS: if it breaks, you get to keep both pieces +msgid "Installing this update may also void any device warranty." +msgstr "Встановлення цього оновлення може призвести до припинення будь-яких гарантійних зобов'язань щодо пристрою." + #. TRANSLATORS: Title: BootGuard is a trademark from Intel msgid "Intel BootGuard" msgstr "Intel BootGuard" @@ -1286,10 +1301,18 @@ msgid "Invalid" msgstr "Некоректна" +#. TRANSLATORS: version is older +msgid "Is downgrade" +msgstr "Є старішою версією" + #. TRANSLATORS: Is currently in bootloader mode msgid "Is in bootloader mode" msgstr "Перебуває у режимі завантажувача" +#. TRANSLATORS: version is newer +msgid "Is upgrade" +msgstr "Є оновленням" + #. TRANSLATORS: issue fixed with the release, e.g. CVE msgid "Issue" msgid_plural "Issues" @@ -1303,6 +1326,14 @@ msgstr "КЛЮЧ,ЗНАЧЕННЯ" #. TRANSLATORS: HSI event title +msgid "Kernel is no longer tainted" +msgstr "Ядро більше не використовує сторонні модулі" + +#. TRANSLATORS: HSI event title +msgid "Kernel is tainted" +msgstr "Ядро використовує сторонні модулі" + +#. TRANSLATORS: HSI event title msgid "Kernel lockdown disabled" msgstr "Вимкнено блокування ядра" @@ -1441,6 +1472,10 @@ msgid "Mounts the ESP" msgstr "Монтує ESP" +#. TRANSLATORS: we're poking around as a power user +msgid "NOTE: This program may only work correctly as root" +msgstr "Зауваження: програма зможе працювати належними чином лише від імені користувача root" + #. TRANSLATORS: Requires a reboot to apply firmware or to reload hardware msgid "Needs a reboot after installation" msgstr "Потребує перезавантаження після встановлення" @@ -1498,6 +1533,10 @@ msgid "No updates were applied" msgstr "Не застосовано жодного оновлення" +#. TRANSLATORS: version cannot be installed due to policy +msgid "Not approved" +msgstr "Не затверджено" + #. TRANSLATORS: Suffix: the HSI result msgid "Not found" msgstr "Не знайдено" @@ -1592,6 +1631,14 @@ msgid "Pre-boot DMA protection" msgstr "Захист DMA до завантаження" +#. TRANSLATORS: HSI event title +msgid "Pre-boot DMA protection is disabled" +msgstr "Захист DMA перед завантаженням вимкнено" + +#. TRANSLATORS: HSI event title +msgid "Pre-boot DMA protection is enabled" +msgstr "Захист DMA перед завантаженням увімкнено" + #. TRANSLATORS: version number of previous firmware msgid "Previous version" msgstr "Попередня версія" @@ -1679,6 +1726,10 @@ msgid "Release Branch" msgstr "Гілка випусків" +#. TRANSLATORS: release attributes +msgid "Release Flags" +msgstr "Прапорці випуску" + #. TRANSLATORS: the exact component on the server msgid "Release ID" msgstr "Ідентифікатор випуску" @@ -2028,6 +2079,10 @@ msgid "TPM PCR0 reconstruction" msgstr "Відновлення PCR0 TPM" +#. TRANSLATORS: HSI event title +msgid "TPM PCR0 reconstruction is invalid" +msgstr "Відновлення PCR0 TPM є некоректним" + #. TRANSLATORS: Title: PCRs (Platform Configuration Registers) shouldn't be #. empty msgid "TPM empty PCRs" @@ -2083,6 +2138,10 @@ msgid "The system clock has not been set correctly and downloading files may fail." msgstr "Годинник системи налаштовано неправильно — це може зашкодити отриманню файлів." +#. TRANSLATORS: naughty vendor +msgid "The vendor did not supply any release notes." +msgstr "Виробником не надано ніяких нотаток щодо випуску." + #. TRANSLATORS: nothing to show msgid "There are no blocked firmware files" msgstr "Заблокованих файлів мікропрограм немає" @@ -2098,6 +2157,10 @@ msgid "This device will be reverted back to %s when the %s command is performed." msgstr "Цей пристрій буде повернуто до %s у результаті виконання команди %s." +#. TRANSLATORS: the vendor did not upload this +msgid "This firmware is provided by LVFS community members and is not provided (or supported) by the original hardware vendor." +msgstr "Цю мікропрограму створено учасниками спільноти LVFS. Її не було надано початковим виробником обладнання. Виробник також не здійснюватиме підтримки цієї мікропрограми." + #. TRANSLATORS: unsupported build of the package msgid "This package has not been validated, it may not work properly." msgstr "Цей пакунок не було перевірено. Його належну роботу не можна гарантувати." @@ -2145,6 +2208,14 @@ msgid "Transient failure" msgstr "Проміжна помилка" +#. TRANSLATORS: We verified the meatdata against the server +msgid "Trusted metadata" +msgstr "Надійні метадані" + +#. TRANSLATORS: We verified the payload against the server +msgid "Trusted payload" +msgstr "Надійні дані" + #. TRANSLATORS: remote type, e.g. remote or local msgid "Type" msgstr "Тип" @@ -2252,10 +2323,6 @@ msgid "Update State" msgstr "Стан оновлення" -#. TRANSLATORS: command description -msgid "Update all devices that match local metadata" -msgstr "Оновити усі пристрої, які відповідають локальним метаданим" - #. TRANSLATORS: the server sent the user a small message msgid "Update failure is a known issue, visit this URL for more information:" msgstr "Нам відомо про помилку під час оновлення. Будь ласка, відвідайте цю адресу, щоб дізнатися більше:" @@ -2280,8 +2347,8 @@ msgstr "Оновити збережені метадані поточними даними" #. TRANSLATORS: command description -msgid "Updates all firmware to latest versions available" -msgstr "Оновлює усі мікропрограми до найновіших доступних версій" +msgid "Updates all specified devices to latest firmware version, or all devices if unspecified" +msgstr "Оновлює усі вказані пристрої до найсвіжішої версії мікропрограми. Якщо пристрої не вказано, оновлює усі пристрої." msgid "Updating" msgstr "Оновлення" diff -Nru fwupd-1.7.4/po/zh_CN.po fwupd-1.7.5/po/zh_CN.po --- fwupd-1.7.4/po/zh_CN.po 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/po/zh_CN.po 2022-02-07 16:24:38.000000000 +0000 @@ -3,7 +3,7 @@ # This file is distributed under the same license as the fwupd package. # # Translators: -# Boyuan Yang <073plan@gmail.com>, 2017,2020 +# Boyuan Yang <073plan@gmail.com>, 2017,2020,2022 # Dingzhong Chen , 2020-2021 # Dingzhong Chen , 2016-2019 # Mingcong Bai , 2017-2018 @@ -460,10 +460,6 @@ msgstr "选择卷:" #. TRANSLATORS: command description -msgid "Clears any updates scheduled to be updated offline" -msgstr "清除任何计划的离线更新" - -#. TRANSLATORS: command description msgid "Clears the results from the last update" msgstr "清除从最后一次更新获取的结果" @@ -969,7 +965,6 @@ msgstr "固件更新已禁用;运行“fwupdmgr unlock”以启用" #. TRANSLATORS: description of plugin state, e.g. disabled -#. TRANSLATORS: release properties msgid "Flags" msgstr "标志" @@ -984,6 +979,10 @@ msgid "Found" msgstr "找到" +#. TRANSLATORS: title text, shown as a warning +msgid "Full Disk Encryption Detected" +msgstr "探测到全盘加密" + #. TRANSLATORS: global ID common to all similar hardware msgid "GUID" msgid_plural "GUIDs" @@ -1059,6 +1058,14 @@ msgid "IOMMU" msgstr "IOMMU" +#. TRANSLATORS: HSI event title +msgid "IOMMU device protection disabled" +msgstr "IOMMU 设备保护已禁用" + +#. TRANSLATORS: HSI event title +msgid "IOMMU device protection enabled" +msgstr "IOMMU 设备保护已启用" + #. TRANSLATORS: daemon is inactive msgid "Idle…" msgstr "空闲…" @@ -1095,6 +1102,12 @@ msgid "Install a firmware file on this hardware" msgstr "在此硬件上安装固件文件" +msgid "Install old version of signed system firmware" +msgstr "安装旧版本的已签名系统固件" + +msgid "Install old version of unsigned system firmware" +msgstr "安装旧版本的未签名系统固件" + msgid "Install signed device firmware" msgstr "安装已签名的设备固件" @@ -1429,6 +1442,10 @@ msgid "Password" msgstr "密码" +#. TRANSLATORS: command description +msgid "Patch a firmware blob at a known offset" +msgstr "在已知偏移量处对固件二进制文件打补丁" + msgid "Payload" msgstr "载荷" @@ -1597,6 +1614,10 @@ msgid "Run `fwupdmgr get-upgrades` for more information." msgstr "运行 \"fwupdmgr get-upgrades\" 获取更多信息。" +#. TRANSLATORS: this is shown in the MOTD +msgid "Run `fwupdmgr sync-bkc` to complete this action." +msgstr "运行 `fwupdmgr sync-bkc` 以完成此操作。" + #. TRANSLATORS: command line option msgid "Run the plugin composite cleanup routine when using install-blob" msgstr "当使用安装比特块时运行插件组合清理例程" @@ -1649,6 +1670,14 @@ msgid "Scheduling…" msgstr "正在计划…" +#. TRANSLATORS: HSI event title +msgid "Secure Boot disabled" +msgstr "安全启动已禁用" + +#. TRANSLATORS: HSI event title +msgid "Secure Boot enabled" +msgstr "安全启动已启用" + #. TRANSLATORS: %s is a link to a website #, c-format msgid "See %s for more information." @@ -1870,6 +1899,11 @@ msgid "TPM v2.0" msgstr "TPM v2.0" +#. TRANSLATORS: release tag set for release, e.g. lenovo-2021q3 +msgid "Tag" +msgid_plural "Tags" +msgstr[0] "标签" + #. TRANSLATORS: Suffix: the HSI result msgid "Tainted" msgstr "受污染" @@ -1893,6 +1927,12 @@ msgid "The daemon has loaded 3rd party code and is no longer supported by the upstream developers!" msgstr "守护进程已经加载了第三方代码,并且上游开发者不再支持。" +#. TRANSLATORS: this is for the device tests, %1 is the device +#. * version, %2 is what we expected +#, c-format +msgid "The device version did not match: got %s, expected %s" +msgstr "设备版本不匹配:得到 %s,期望 %s" + #. TRANSLATORS: %1 is the firmware vendor, %2 is the device vendor name #, c-format msgid "The firmware from %s is not supplied by %s, the hardware vendor." @@ -2065,10 +2105,6 @@ msgid "Update State" msgstr "更新状态" -#. TRANSLATORS: command description -msgid "Update all devices that match local metadata" -msgstr "更新所有符合本地元数据的设备" - #. TRANSLATORS: the server sent the user a small message msgid "Update failure is a known issue, visit this URL for more information:" msgstr "更新失败为已知问题,请访问此 URL 以获取详情:" @@ -2092,10 +2128,6 @@ msgid "Update the stored metadata with current contents" msgstr "使用当前内容更新存储的元数据" -#. TRANSLATORS: command description -msgid "Updates all firmware to latest versions available" -msgstr "将所有固件都更新为最新版本" - msgid "Updating" msgstr "正在更新" diff -Nru fwupd-1.7.4/po/zh_TW.po fwupd-1.7.5/po/zh_TW.po --- fwupd-1.7.4/po/zh_TW.po 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/po/zh_TW.po 2022-02-07 16:24:38.000000000 +0000 @@ -115,10 +115,6 @@ msgstr "選擇發行版:" #. TRANSLATORS: command description -msgid "Clears any updates scheduled to be updated offline" -msgstr "清除任何排程好的離線更新" - -#. TRANSLATORS: command description msgid "Clears the results from the last update" msgstr "清除上次更新的結果" @@ -617,10 +613,6 @@ msgid "Update the stored device verification information" msgstr "更新儲存的裝置核驗資訊" -#. TRANSLATORS: command description -msgid "Updates all firmware to latest versions available" -msgstr "將所有韌體更新至可用的最新版本" - #. TRANSLATORS: the first replacement is a display name #. * e.g. "ColorHugALS" and the second and third are #. * version numbers e.g. "1.2.3" diff -Nru fwupd-1.7.4/README.md fwupd-1.7.5/README.md --- fwupd-1.7.4/README.md 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/README.md 2022-02-07 16:24:38.000000000 +0000 @@ -79,10 +79,6 @@ `# fwupdmgr report-history` -To clear the local history of updates: - -`# fwupdmgr clear-history` - Only updates that were distributed from the LVFS will be reported to the LVFS. ## Enterprise use @@ -106,6 +102,59 @@ Additionally, the list of approved firmware can be supplemented using `fwupdmgr set-approved-firmware baz` or using the D-Bus interface. +## Local metadata + +Local metadata can be saved in `/var/lib/fwupd/local.d` or `/usr/share/fwupd/local.d` +which are scanned at daemon startup. This can be used to add site-specific BKC +tags to existing metadata stores. For instance: + + + + + + 3ef35d3b-ceeb-5e27-8c0a-ac25f90367ab + 2ef35d3b-ceeb-5e27-8c0a-ac25f90367ac + 1ef35d3b-ceeb-5e27-8c0a-ac25f90367ad + + + + + + + mycompanyname-2022q1 + + + + +This then appears when getting the releases for that specific GUID: + + fwupdmgr get-releases --json 3ef35d3b-ceeb-5e27-8c0a-ac25f90367ab + { + "Releases" : [ + { + ... + "Version" : "225.53.1649", + "Tags" : [ + "mycompanyname-2022q1" + ], + ... + }, + { + ... + "Version" : "224.48.1605", + "Tags" : [ + "mycompanyname-2022q1" + ], + ... + }, + { + ... + "Version" : "224.45.1389", + ... + } + ] + } + ## Other frontends 1. [GNOME Software](https://wiki.gnome.org/Apps/Software) is the graphical diff -Nru fwupd-1.7.4/RELEASE fwupd-1.7.5/RELEASE --- fwupd-1.7.4/RELEASE 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/RELEASE 2022-02-07 16:24:38.000000000 +0000 @@ -10,7 +10,7 @@ Write release entries: -git log --format="%s" --cherry-pick --right-only 1.7.3... | grep -i -v trivial | grep -v Merge | sort | uniq +git log --format="%s" --cherry-pick --right-only 1.7.4... | grep -i -v trivial | grep -v Merge | sort | uniq Add any user visible changes into ../data/org.freedesktop.fwupd.metainfo.xml appstream-util appdata-to-news ../data/org.freedesktop.fwupd.metainfo.xml > NEWS @@ -25,7 +25,7 @@ 2. Commit changes to git: # MAKE SURE THIS IS CORRECT -export release_ver="1.7.4" +export release_ver="1.7.5" git commit -a -m "Release fwupd ${release_ver}" --no-verify git tag -s -f -m "Release fwupd ${release_ver}" "${release_ver}" diff -Nru fwupd-1.7.4/src/fu-config.c fwupd-1.7.5/src/fu-config.c --- fwupd-1.7.4/src/fu-config.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/src/fu-config.c 2022-02-07 16:24:38.000000000 +0000 @@ -23,15 +23,15 @@ struct _FuConfig { GObject parent_instance; - GFileMonitor *monitor; + GPtrArray *monitors; /* (element-type GFileMonitor) */ GPtrArray *disabled_devices; /* (element-type utf-8) */ GPtrArray *disabled_plugins; /* (element-type utf-8) */ GPtrArray *approved_firmware; /* (element-type utf-8) */ GPtrArray *blocked_firmware; /* (element-type utf-8) */ GPtrArray *uri_schemes; /* (element-type utf-8) */ + GPtrArray *filenames; /* (element-type utf-8) */ guint64 archive_size_max; guint idle_timeout; - gchar *config_file; gchar *host_bkc; gboolean update_motd; gboolean enumerate_all_devices; @@ -65,13 +65,30 @@ g_autoptr(GError) error_ignore_power = NULL; g_autoptr(GError) error_only_trusted = NULL; g_autoptr(GError) error_enumerate_all = NULL; + g_autoptr(GByteArray) buf = g_byte_array_new(); - if (g_file_test(self->config_file, G_FILE_TEST_EXISTS)) { - g_debug("loading config values from %s", self->config_file); - if (!g_key_file_load_from_file(keyfile, self->config_file, G_KEY_FILE_NONE, error)) + /* we have to load each file into a buffer as g_key_file_load_from_file() clears the + * GKeyFile state before loading each file, and we want to allow the mutable version to be + * incomplete and just *override* a specific option */ + for (guint i = 0; i < self->filenames->len; i++) { + const gchar *fn = g_ptr_array_index(self->filenames, i); + g_debug("trying to load config values from %s", fn); + if (g_file_test(fn, G_FILE_TEST_EXISTS)) { + g_autoptr(GBytes) blob = fu_common_get_contents_bytes(fn, error); + if (blob == NULL) + return FALSE; + fu_byte_array_append_bytes(buf, blob); + } + } + + /* load if either file found */ + if (buf->len > 0) { + if (!g_key_file_load_from_data(keyfile, + (const gchar *)buf->data, + buf->len, + G_KEY_FILE_NONE, + error)) return FALSE; - } else { - g_warning("Daemon configuration %s not found", self->config_file); } /* get disabled devices */ @@ -223,7 +240,8 @@ { FuConfig *self = FU_CONFIG(user_data); g_autoptr(GError) error = NULL; - g_debug("%s changed, reloading all configs", self->config_file); + g_autofree gchar *fn = g_file_get_path(file); + g_debug("%s changed, reloading all configs", fn); if (!fu_config_reload(self, &error)) g_warning("failed to rescan daemon config: %s", error->message); fu_config_emit_changed(self); @@ -233,38 +251,55 @@ fu_config_set_key_value(FuConfig *self, const gchar *key, const gchar *value, GError **error) { g_autoptr(GKeyFile) keyfile = g_key_file_new(); - if (!g_key_file_load_from_file(keyfile, self->config_file, G_KEY_FILE_KEEP_COMMENTS, error)) + const gchar *fn; + + /* sanity check */ + if (self->filenames->len == 0) { + g_set_error(error, G_IO_ERROR, G_IO_ERROR_NOT_INITIALIZED, "no config to load"); + return FALSE; + } + + /* only write the file in /etc */ + fn = g_ptr_array_index(self->filenames, 0); + if (!g_key_file_load_from_file(keyfile, fn, G_KEY_FILE_KEEP_COMMENTS, error)) return FALSE; g_key_file_set_string(keyfile, "fwupd", key, value); - if (!g_key_file_save_to_file(keyfile, self->config_file, error)) + if (!g_key_file_save_to_file(keyfile, fn, error)) return FALSE; + return fu_config_reload(self, error); } gboolean fu_config_load(FuConfig *self, GError **error) { - g_autofree gchar *configdir = NULL; - g_autoptr(GFile) file = NULL; + g_autofree gchar *configdir_mut = fu_common_get_path(FU_PATH_KIND_LOCALCONFDIR_PKG); + g_autofree gchar *configdir = fu_common_get_path(FU_PATH_KIND_SYSCONFDIR_PKG); g_return_val_if_fail(FU_IS_CONFIG(self), FALSE); - g_return_val_if_fail(self->config_file == NULL, FALSE); + g_return_val_if_fail(self->filenames->len == 0, FALSE); /* load the main daemon config file */ - configdir = fu_common_get_path(FU_PATH_KIND_SYSCONFDIR_PKG); - self->config_file = g_build_filename(configdir, "daemon.conf", NULL); + g_ptr_array_add(self->filenames, g_build_filename(configdir, "daemon.conf", NULL)); + g_ptr_array_add(self->filenames, g_build_filename(configdir_mut, "daemon.conf", NULL)); if (!fu_config_reload(self, error)) return FALSE; - /* set up a notify watch */ - file = g_file_new_for_path(self->config_file); - self->monitor = g_file_monitor(file, G_FILE_MONITOR_NONE, NULL, error); - if (self->monitor == NULL) - return FALSE; - g_signal_connect(G_FILE_MONITOR(self->monitor), - "changed", - G_CALLBACK(fu_config_monitor_changed_cb), - self); + /* set up a notify watches */ + for (guint i = 0; i < self->filenames->len; i++) { + const gchar *fn = g_ptr_array_index(self->filenames, i); + g_autoptr(GFile) file = g_file_new_for_path(fn); + g_autoptr(GFileMonitor) monitor = NULL; + + monitor = g_file_monitor(file, G_FILE_MONITOR_NONE, NULL, error); + if (monitor == NULL) + return FALSE; + g_signal_connect(G_FILE_MONITOR(monitor), + "changed", + G_CALLBACK(fu_config_monitor_changed_cb), + self); + g_ptr_array_add(self->monitors, g_steal_pointer(&monitor)); + } /* success */ return TRUE; @@ -391,11 +426,13 @@ static void fu_config_init(FuConfig *self) { + self->filenames = g_ptr_array_new_with_free_func(g_free); self->disabled_devices = g_ptr_array_new_with_free_func(g_free); self->disabled_plugins = g_ptr_array_new_with_free_func(g_free); self->approved_firmware = g_ptr_array_new_with_free_func(g_free); self->blocked_firmware = g_ptr_array_new_with_free_func(g_free); self->uri_schemes = g_ptr_array_new_with_free_func(g_free); + self->monitors = g_ptr_array_new_with_free_func((GDestroyNotify)g_object_unref); } static void @@ -403,16 +440,17 @@ { FuConfig *self = FU_CONFIG(obj); - if (self->monitor != NULL) { - g_file_monitor_cancel(self->monitor); - g_object_unref(self->monitor); + for (guint i = 0; i < self->monitors->len; i++) { + GFileMonitor *monitor = g_ptr_array_index(self->monitors, i); + g_file_monitor_cancel(monitor); } + g_ptr_array_unref(self->filenames); + g_ptr_array_unref(self->monitors); g_ptr_array_unref(self->disabled_devices); g_ptr_array_unref(self->disabled_plugins); g_ptr_array_unref(self->approved_firmware); g_ptr_array_unref(self->blocked_firmware); g_ptr_array_unref(self->uri_schemes); - g_free(self->config_file); g_free(self->host_bkc); G_OBJECT_CLASS(fu_config_parent_class)->finalize(obj); diff -Nru fwupd-1.7.4/src/fu-device-list.c fwupd-1.7.5/src/fu-device-list.c --- fwupd-1.7.4/src/fu-device-list.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/src/fu-device-list.c 2022-02-07 16:24:38.000000000 +0000 @@ -434,9 +434,6 @@ static void fu_device_list_remove_with_delay(FuDeviceItem *item) { - /* we can't do anything with an unconnected device */ - fu_device_remove_flag(item->device, FWUPD_DEVICE_FLAG_UPDATABLE); - /* give the hardware time to re-enumerate or the user time to * re-insert the device with a magic button pressed */ g_debug("waiting %ums for %s device removal", @@ -478,6 +475,9 @@ return; } + /* we can't do anything with an unconnected device */ + fu_device_inhibit(item->device, "unconnected", "Device has been removed"); + /* ensure never fired if the remove delay is changed */ if (item->remove_id > 0) { g_source_remove(item->remove_id); @@ -584,6 +584,7 @@ fu_device_remove_flag(item->device_old, FWUPD_DEVICE_FLAG_WAIT_FOR_REPLUG); } } + fu_device_uninhibit(item->device, "unconnected"); /* optional debug */ if (g_getenv("FWUPD_DEVICE_LIST_VERBOSE") != NULL) { @@ -747,6 +748,7 @@ /* same ID, different object */ g_debug("found existing device %s, reusing item", fu_device_get_id(item->device)); fu_device_list_replace(self, item, device); + fu_device_uninhibit(device, "unconnected"); return; } @@ -761,6 +763,7 @@ fu_device_get_plugin(item->device), fu_device_get_plugin(device)); fu_device_list_replace(self, item, device); + fu_device_uninhibit(device, "unconnected"); return; } @@ -775,6 +778,7 @@ fu_device_get_plugin(item->device), fu_device_get_plugin(device)); fu_device_list_replace(self, item, device); + fu_device_uninhibit(device, "unconnected"); return; } else { g_debug("not adding matching %s for device add, use " diff -Nru fwupd-1.7.4/src/fu-engine.c fwupd-1.7.5/src/fu-engine.c --- fwupd-1.7.4/src/fu-engine.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/src/fu-engine.c 2022-02-07 16:24:38.000000000 +0000 @@ -19,6 +19,12 @@ #endif #include +#ifdef _WIN32 +#include +#include +#include +#endif + #include "fwupd-common-private.h" #include "fwupd-enums-private.h" #include "fwupd-error.h" @@ -123,6 +129,7 @@ gboolean loaded; gchar *host_security_id; FuSecurityAttrs *host_security_attrs; + GPtrArray *local_monitors; /* (element-type GFileMonitor) */ }; enum { @@ -463,6 +470,76 @@ return g_string_free(xpath, FALSE); } +/* add any client-side BKC tags */ +static gboolean +fu_engine_add_local_release_metadata(FuEngine *self, + FuDevice *dev, + FwupdRelease *rel, + GError **error) +{ + GPtrArray *guids = fu_device_get_guids(dev); + g_autoptr(XbQuery) query = NULL; + g_autoptr(GError) error_query = NULL; + + /* prepare query with bound GUID parameter */ + query = xb_query_new_full(self->silo, + "local/components/component[@merge='append']/provides/" + "firmware[text()=?]/../../releases/release[@version=?]/../../" + "tags/tag", + XB_QUERY_FLAG_OPTIMIZE | XB_QUERY_FLAG_USE_INDEXES, + &error_query); + if (query == NULL) { + if (g_error_matches(error_query, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT)) + return TRUE; + g_propagate_error(error, g_steal_pointer(&error_query)); + return FALSE; + } + + /* use prepared query for each GUID */ + for (guint i = 0; i < guids->len; i++) { + const gchar *guid = g_ptr_array_index(guids, i); + g_autoptr(GError) error_local = NULL; + g_autoptr(GPtrArray) tags = NULL; +#if LIBXMLB_CHECK_VERSION(0, 3, 0) + g_auto(XbQueryContext) context = XB_QUERY_CONTEXT_INIT(); +#endif + + /* bind GUID and then query */ +#if LIBXMLB_CHECK_VERSION(0, 3, 0) + xb_value_bindings_bind_str(xb_query_context_get_bindings(&context), 0, guid, NULL); + xb_value_bindings_bind_str(xb_query_context_get_bindings(&context), + 1, + fwupd_release_get_version(rel), + NULL); + tags = xb_silo_query_with_context(self->silo, query, &context, &error_local); +#else + if (!xb_query_bind_str(query, 0, guid, error)) { + g_prefix_error(error, "failed to bind GUID: "); + return FALSE; + } + if (!xb_query_bind_str(query, 1, fwupd_release_get_version(rel), error)) { + g_prefix_error(error, "failed to bind version: "); + return FALSE; + } + tags = xb_silo_query_full(self->silo, query, &error_local); +#endif + if (tags == NULL) { + if (g_error_matches(error_local, G_IO_ERROR, G_IO_ERROR_NOT_FOUND) || + g_error_matches(error_local, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT)) + continue; + g_propagate_error(error, g_steal_pointer(&error_local)); + return FALSE; + } + for (guint j = 0; j < tags->len; j++) { + XbNode *tag = g_ptr_array_index(tags, j); + fwupd_release_add_tag(rel, xb_node_get_text(tag)); + } + } + + /* success */ + return TRUE; +} + static gboolean fu_engine_set_release_from_appstream(FuEngine *self, FuEngineRequest *request, @@ -536,6 +613,9 @@ if (remote == NULL) g_warning("no remote found for release %s", version_rel); } + tmp = xb_node_query_text(component, "../custom/value[@key='LVFS::Distributor']", NULL); + if (g_strcmp0(tmp, "community") == 0) + fwupd_release_add_flag(rel, FWUPD_RELEASE_FLAG_IS_COMMUNITY); artifact = xb_node_query_first(release, "artifacts/artifact", NULL); if (artifact != NULL) { if (!fu_engine_set_release_from_artifact(self, rel, remote, artifact, error)) @@ -556,6 +636,17 @@ "updating this firmware. Please ensure you have the volume " "recovery key before continuing.

"); } + if (fwupd_release_has_flag(rel, FWUPD_RELEASE_FLAG_IS_COMMUNITY) && + request != NULL && + !fu_engine_request_has_feature_flag(request, + FWUPD_FEATURE_FLAG_COMMUNITY_TEXT)) { + g_string_prepend( + str, + "

This firmware is provided by LVFS community " + "members and is not provided (or supported) by the original " + "hardware vendor. " + "Installing this update may also void any device warranty.

"); + } if (str->len > 0) fwupd_release_set_description(rel, str->str); } @@ -671,11 +762,19 @@ fwupd_release_set_update_image(rel, tmp); } } + if (xb_node_get_attr(release, "date_eol") != NULL) + fu_device_add_flag(dev, FWUPD_DEVICE_FLAG_END_OF_LIFE); /* sort the locations by scheme */ g_ptr_array_sort_with_data(fwupd_release_get_locations(rel), fu_engine_scheme_compare_cb, self); + + /* add any client-side BKC tags */ + if (!fu_engine_add_local_release_metadata(self, dev, rel, error)) + return FALSE; + + /* success */ return TRUE; } @@ -741,13 +840,18 @@ fu_engine_modify_config(FuEngine *self, const gchar *key, const gchar *value, GError **error) { const gchar *keys[] = {"ArchiveSizeMax", - "DisabledDevices", + "ApprovedFirmware", "BlockedFirmware", + "DisabledDevices", "DisabledPlugins", + "EnumerateAllDevices", + "HostBkc", "IdleTimeout", - "VerboseDomains", + "IgnorePower", + "OnlyTrusted", "UpdateMotd", - "EnumerateAllDevices", + "UriSchemes", + "VerboseDomains", NULL}; g_return_val_if_fail(FU_IS_ENGINE(self), FALSE); @@ -2053,6 +2157,11 @@ fu_engine_add_report_metadata_bool(hash, "FwupdSupported", FALSE); #endif + /* find out what BKC is being targeted to understand "odd" upgrade paths */ + tmp = fu_config_get_host_bkc(self->config); + if (tmp != NULL) + g_hash_table_insert(hash, g_strdup("HostBkc"), g_strdup(tmp)); + /* DMI data */ tmp = fu_context_get_hwid_value(self->ctx, FU_HWIDS_KEY_PRODUCT_NAME); if (tmp != NULL) @@ -3805,6 +3914,41 @@ } static gboolean +fu_engine_load_metadata_store_local(FuEngine *self, + XbBuilder *builder, + FuPathKind path_kind, + GError **error) +{ + g_autofree gchar *fn = fu_common_get_path(path_kind); + g_autofree gchar *metadata_path = g_build_filename(fn, "local.d", NULL); + g_autoptr(GError) error_local = NULL; + g_autoptr(GPtrArray) metadata_fns = NULL; + + metadata_fns = fu_common_filename_glob(metadata_path, "*.xml", &error_local); + if (metadata_fns == NULL) { + g_debug("ignoring: %s", error_local->message); + return TRUE; + } + for (guint i = 0; i < metadata_fns->len; i++) { + const gchar *path = g_ptr_array_index(metadata_fns, i); + g_autoptr(XbBuilderSource) source = xb_builder_source_new(); + g_autoptr(GFile) file = g_file_new_for_path(path); + g_debug("loading local metadata: %s", path); + if (!xb_builder_source_load_file(source, + file, + XB_BUILDER_SOURCE_FLAG_NONE, + NULL, + error)) + return FALSE; + xb_builder_source_set_prefix(source, "local"); + xb_builder_import_source(builder, source); + } + + /* success */ + return TRUE; +} + +static gboolean fu_engine_load_metadata_store(FuEngine *self, FuEngineLoadFlags flags, GError **error) { GPtrArray *remotes; @@ -3891,6 +4035,15 @@ xb_builder_import_source(builder, source); } + /* add any client-side data, e.g. BKC tags */ + if (!fu_engine_load_metadata_store_local(self, + builder, + FU_PATH_KIND_LOCALSTATEDIR_PKG, + error)) + return FALSE; + if (!fu_engine_load_metadata_store_local(self, builder, FU_PATH_KIND_DATADIR_PKG, error)) + return FALSE; + /* on a read-only filesystem don't care about the cache GUID */ if (flags & FU_ENGINE_LOAD_FLAG_READONLY) compile_flags |= XB_BUILDER_COMPILE_FLAG_IGNORE_GUID; @@ -3923,7 +4076,7 @@ } static void -fu_engine_remote_list_changed_cb(FuRemoteList *remote_list, FuEngine *self) +fu_engine_metadata_changed(FuEngine *self) { g_autoptr(GError) error_local = NULL; if (!fu_engine_load_metadata_store(self, FU_ENGINE_LOAD_FLAG_NONE, &error_local)) @@ -3939,6 +4092,12 @@ fu_engine_emit_changed(self); } +static void +fu_engine_remote_list_changed_cb(FuRemoteList *remote_list, FuEngine *self) +{ + fu_engine_metadata_changed(self); +} + static gint fu_engine_sort_jcat_results_timestamp_cb(gconstpointer a, gconstpointer b) { @@ -4291,6 +4450,7 @@ g_autoptr(FuDevice) dev = NULL; g_autoptr(FwupdRelease) rel = NULL; g_autoptr(GError) error_local = NULL; + g_autoptr(GError) error_reqs = NULL; g_autoptr(GPtrArray) provides = NULL; g_autoptr(GPtrArray) tags = NULL; g_autoptr(XbNode) description = NULL; @@ -4327,6 +4487,8 @@ fu_device_set_version_raw(dev, fu_device_get_version_raw(device)); fu_device_set_version_format(dev, fu_device_get_version_format(device)); fu_device_set_version(dev, fu_device_get_version(device)); + } else { + fu_device_inhibit(dev, "not-found", "Device was not found"); } /* add GUID */ @@ -4355,10 +4517,12 @@ request, task, FWUPD_INSTALL_FLAG_IGNORE_VID_PID, - error)) - return NULL; + &error_reqs)) { + fu_device_inhibit(dev, "failed-reqs", error_reqs->message); + /* continue */ + } - /* verify trust */ + /* verify trust */ #if LIBXMLB_CHECK_VERSION(0, 2, 0) query = xb_query_new_full(xb_node_get_silo(component), "releases/release", @@ -5516,6 +5680,10 @@ return FALSE; } + /* if the offline update never got run, unstage it */ + if (fu_device_get_update_state(device) == FWUPD_UPDATE_STATE_PENDING) + fu_device_set_update_state(device, FWUPD_UPDATE_STATE_UNKNOWN); + /* override */ fu_device_add_flag(device, FWUPD_DEVICE_FLAG_NOTIFIED); return fu_history_modify_device(self->history, device, error); @@ -6449,6 +6617,13 @@ FuDevice *device_tmp = g_ptr_array_index(devices, i); if (g_strcmp0(fu_device_get_backend_id(device_tmp), fu_device_get_backend_id(device)) == 0) { + if (fu_device_has_internal_flag(device_tmp, + FU_DEVICE_INTERNAL_FLAG_NO_AUTO_REMOVE)) { + g_debug("not auto-removing backend device %s [%s] due to flags", + fu_device_get_name(device_tmp), + fu_device_get_id(device_tmp)); + continue; + } g_debug("auto-removing backend device %s [%s]", fu_device_get_name(device_tmp), fu_device_get_id(device_tmp)); @@ -6739,8 +6914,9 @@ vendor = fu_context_get_hwid_replace_value(ctx, FU_HWIDS_KEY_MANUFACTURER, NULL); if (vendor != NULL) { + g_autofree gchar *vendor_guid = fwupd_guid_hash_string(vendor); battery_str = g_strdup( - fu_context_lookup_quirk_by_id(ctx, vendor, FU_QUIRKS_BATTERY_THRESHOLD)); + fu_context_lookup_quirk_by_id(ctx, vendor_guid, FU_QUIRKS_BATTERY_THRESHOLD)); } if (battery_str == NULL) minimum_battery = MINIMUM_BATTERY_PERCENTAGE_FALLBACK; @@ -6771,6 +6947,72 @@ return TRUE; } +static void +fu_engine_local_metadata_changed_cb(GFileMonitor *monitor, + GFile *file, + GFile *other_file, + GFileMonitorEvent event_type, + gpointer user_data) +{ + FuEngine *self = FU_ENGINE(user_data); + fu_engine_metadata_changed(self); +} + +static gboolean +fu_engine_load_local_metadata_watches(FuEngine *self, GError **error) +{ + const FuPathKind path_kinds[] = {FU_PATH_KIND_DATADIR_PKG, FU_PATH_KIND_LOCALSTATEDIR_PKG}; + + /* add the watches even if the directory does not exist */ + for (guint i = 0; i < G_N_ELEMENTS(path_kinds); i++) { + GFileMonitor *monitor; + GFile *file; + g_autoptr(GError) error_local = NULL; + g_autofree gchar *base = fu_common_get_path(path_kinds[i]); + g_autofree gchar *fn = g_build_filename(base, "local.d", NULL); + + file = g_file_new_for_path(fn); + monitor = g_file_monitor_directory(file, G_FILE_MONITOR_NONE, NULL, &error_local); + if (monitor == NULL) { + g_warning("failed to watch %s: %s", fn, error_local->message); + continue; + } + g_signal_connect(monitor, + "changed", + G_CALLBACK(fu_engine_local_metadata_changed_cb), + self); + g_ptr_array_add(self->local_monitors, g_steal_pointer(&monitor)); + } + + /* success */ + return TRUE; +} + +#ifdef _WIN32 +static gchar * +fu_common_win32_registry_get_string(HKEY hkey, + const gchar *subkey, + const gchar *value, + GError **error) +{ + gchar buf[255] = {'\0'}; + DWORD bufsz = sizeof(buf); + LSTATUS rc; + + rc = RegGetValue(hkey, subkey, value, RRF_RT_REG_SZ, NULL, (PVOID)&buf, &bufsz); + if (rc != ERROR_SUCCESS) { + g_set_error(error, + G_IO_ERROR, + G_IO_ERROR_INVAL, + "Failed to get registry string %s [0x%lX]", + subkey, + (unsigned long)rc); + return NULL; + } + return g_strndup(buf, bufsz); +} +#endif + /** * fu_engine_load: * @self: a #FuEngine @@ -6790,9 +7032,8 @@ g_autoptr(GPtrArray) checksums_approved = NULL; g_autoptr(GPtrArray) checksums_blocked = NULL; g_autoptr(GError) error_quirks = NULL; -#ifndef _WIN32 g_autoptr(GError) error_local = NULL; -#endif + g_return_val_if_fail(FU_IS_ENGINE(self), FALSE); g_return_val_if_fail(error == NULL || *error == NULL, FALSE); @@ -6820,13 +7061,18 @@ return FALSE; } -/* TODO: Read registry key [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography] "MachineGuid" */ -#ifndef _WIN32 /* cache machine ID so we can use it from a sandboxed app */ +#ifdef _WIN32 + self->host_machine_id = + fu_common_win32_registry_get_string(HKEY_LOCAL_MACHINE, + "SOFTWARE\\Microsoft\\Cryptography", + "MachineGuid", + &error_local); +#else self->host_machine_id = fwupd_build_machine_id("fwupd", &error_local); +#endif if (self->host_machine_id == NULL) g_debug("failed to build machine-id: %s", error_local->message); -#endif /* ensure these exist before starting */ if (!fu_engine_ensure_paths_exist(error)) @@ -6911,6 +7157,10 @@ return FALSE; } + /* watch the local.d directories for changes */ + if (!fu_engine_load_local_metadata_watches(self, error)) + return FALSE; + /* add the "built-in" firmware types */ fu_context_add_firmware_gtype(self->ctx, "raw", FU_TYPE_FIRMWARE); fu_context_add_firmware_gtype(self->ctx, "dfu", FU_TYPE_DFU_FIRMWARE); @@ -7201,6 +7451,7 @@ self->plugin_filter = g_ptr_array_new_with_free_func(g_free); self->host_security_attrs = fu_security_attrs_new(); self->backends = g_ptr_array_new_with_free_func((GDestroyNotify)g_object_unref); + self->local_monitors = g_ptr_array_new_with_free_func((GDestroyNotify)g_object_unref); self->runtime_versions = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); self->compile_versions = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); @@ -7278,9 +7529,6 @@ #endif g_hash_table_insert(self->compile_versions, - g_strdup("com.redhat.fwupdate"), - g_strdup("12")); - g_hash_table_insert(self->compile_versions, g_strdup("org.freedesktop.fwupd"), g_strdup(VERSION)); #ifdef HAVE_GUSB @@ -7298,6 +7546,11 @@ { FuEngine *self = FU_ENGINE(obj); + for (guint i = 0; i < self->local_monitors->len; i++) { + GFileMonitor *monitor = g_ptr_array_index(self->local_monitors, i); + g_file_monitor_cancel(monitor); + } + if (self->silo != NULL) g_object_unref(self->silo); if (self->query_component_by_guid != NULL) @@ -7321,6 +7574,7 @@ g_object_unref(self->jcat_context); g_ptr_array_unref(self->plugin_filter); g_ptr_array_unref(self->backends); + g_ptr_array_unref(self->local_monitors); g_hash_table_unref(self->runtime_versions); g_hash_table_unref(self->compile_versions); g_object_unref(self->plugin_list); diff -Nru fwupd-1.7.4/src/fu-engine-request.c fwupd-1.7.5/src/fu-engine-request.c --- fwupd-1.7.4/src/fu-engine-request.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/src/fu-engine-request.c 2022-02-07 16:24:38.000000000 +0000 @@ -80,6 +80,13 @@ self->device_flags = device_flags; } +gboolean +fu_engine_request_has_device_flag(FuEngineRequest *self, FwupdDeviceFlags device_flag) +{ + g_return_val_if_fail(FU_IS_ENGINE_REQUEST(self), FALSE); + return (self->device_flags & device_flag) > 0; +} + static void fu_engine_request_init(FuEngineRequest *self) { diff -Nru fwupd-1.7.4/src/fu-engine-request.h fwupd-1.7.5/src/fu-engine-request.h --- fwupd-1.7.4/src/fu-engine-request.h 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/src/fu-engine-request.h 2022-02-07 16:24:38.000000000 +0000 @@ -31,6 +31,8 @@ fu_engine_request_set_locale(FuEngineRequest *self, const gchar *locale); gboolean fu_engine_request_has_feature_flag(FuEngineRequest *self, FwupdFeatureFlags feature_flag); +gboolean +fu_engine_request_has_device_flag(FuEngineRequest *self, FwupdDeviceFlags device_flag); FwupdDeviceFlags fu_engine_request_get_device_flags(FuEngineRequest *self); void diff -Nru fwupd-1.7.4/src/fu-history.c fwupd-1.7.5/src/fu-history.c --- fwupd-1.7.4/src/fu-history.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/src/fu-history.c 2022-02-07 16:24:38.000000000 +0000 @@ -780,58 +780,6 @@ } /** - * fu_history_remove_all_with_state: - * @self: a #FuHistory - * @update_state: a #FwupdUpdateState - * @error: (nullable): optional return location for an error - * - * Remove all devices from the history database that match - * state update_state - * - * Returns: @TRUE if successful, @FALSE for failure - * - * Since: 1.0.4 - **/ -gboolean -fu_history_remove_all_with_state(FuHistory *self, FwupdUpdateState update_state, GError **error) -{ -#ifdef HAVE_SQLITE - gint rc; - g_autoptr(sqlite3_stmt) stmt = NULL; - g_autoptr(GRWLockWriterLocker) locker = NULL; - - g_return_val_if_fail(FU_IS_HISTORY(self), FALSE); - - /* lazy load */ - if (!fu_history_load(self, error)) - return FALSE; - - /* remove entries */ - locker = g_rw_lock_writer_locker_new(&self->db_mutex); - g_return_val_if_fail(locker != NULL, FALSE); - g_debug("removing all devices with update_state %s", - fwupd_update_state_to_string(update_state)); - rc = sqlite3_prepare_v2(self->db, - "DELETE FROM history WHERE update_state = ?1", - -1, - &stmt, - NULL); - if (rc != SQLITE_OK) { - g_set_error(error, - FWUPD_ERROR, - FWUPD_ERROR_INTERNAL, - "Failed to prepare SQL to delete history: %s", - sqlite3_errmsg(self->db)); - return FALSE; - } - sqlite3_bind_int(stmt, 1, update_state); - return fu_history_stmt_exec(self, stmt, NULL, error); -#else - return TRUE; -#endif -} - -/** * fu_history_remove_all: * @self: a #FuHistory * @error: (nullable): optional return location for an error diff -Nru fwupd-1.7.4/src/fu-history.h fwupd-1.7.5/src/fu-history.h --- fwupd-1.7.4/src/fu-history.h 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/src/fu-history.h 2022-02-07 16:24:38.000000000 +0000 @@ -29,8 +29,6 @@ fu_history_remove_device(FuHistory *self, FuDevice *device, GError **error); gboolean fu_history_remove_all(FuHistory *self, GError **error); -gboolean -fu_history_remove_all_with_state(FuHistory *self, FwupdUpdateState update_state, GError **error); FuDevice * fu_history_get_device_by_id(FuHistory *self, const gchar *device_id, GError **error); GPtrArray * diff -Nru fwupd-1.7.4/src/fu-main.c fwupd-1.7.5/src/fu-main.c --- fwupd-1.7.4/src/fu-main.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/src/fu-main.c 2022-02-07 16:24:38.000000000 +0000 @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #ifdef HAVE_MALLOC_H @@ -77,6 +78,7 @@ PolkitAuthority *authority; #endif guint owner_id; + guint process_quit_id; FuEngine *engine; gboolean update_in_progress; gboolean pending_sigterm; @@ -239,6 +241,12 @@ g_autoptr(FuEngineRequest) request = fu_engine_request_new(FU_ENGINE_REQUEST_KIND_ACTIVE); g_autoptr(GVariant) value = NULL; + /* if using FWUPD_DBUS_SOCKET... */ + if (sender == NULL) { + fu_engine_request_set_device_flags(request, FWUPD_DEVICE_FLAG_TRUSTED); + return g_steal_pointer(&request); + } + g_return_val_if_fail(sender != NULL, NULL); /* did the client set the list of supported features or any hints */ @@ -961,7 +969,11 @@ static FuSenderItem * fu_main_ensure_sender_item(FuMainPrivate *priv, const gchar *sender) { - FuSenderItem *sender_item; + FuSenderItem *sender_item = NULL; + + /* operating in point-to-point mode */ + if (sender == NULL) + sender = ""; sender_item = g_hash_table_lookup(priv->sender_items, sender); if (sender_item == NULL) { sender_item = g_new0(FuSenderItem, 1); @@ -982,6 +994,32 @@ return FALSE; } +static gboolean +fu_main_schedule_process_quit_cb(gpointer user_data) +{ + FuMainPrivate *priv = (FuMainPrivate *)user_data; + + g_debug("daemon asked to quit, shutting down"); + priv->process_quit_id = 0; + g_main_loop_quit(priv->loop); + return G_SOURCE_REMOVE; +} + +static void +fu_main_schedule_process_quit(FuMainPrivate *priv) +{ + /* busy? */ + if (priv->update_in_progress) { + g_warning("asked to quit during a firmware update, ignoring"); + return; + } + + /* allow the daemon to respond to the request, then quit */ + if (priv->process_quit_id != 0) + g_source_remove(priv->process_quit_id); + priv->process_quit_id = g_idle_add(fu_main_schedule_process_quit_cb, priv); +} + static void fu_main_daemon_method_call(GDBusConnection *connection, const gchar *sender, @@ -1165,6 +1203,18 @@ #endif /* HAVE_POLKIT */ return; } + if (g_strcmp0(method_name, "Quit") == 0) { + if (!fu_engine_request_has_device_flag(request, FWUPD_DEVICE_FLAG_TRUSTED)) { + g_dbus_method_invocation_return_error_literal(invocation, + FWUPD_ERROR, + FWUPD_ERROR_PERMISSION_DENIED, + "Permission denied"); + return; + } + fu_main_schedule_process_quit(priv); + g_dbus_method_invocation_return_value(invocation, NULL); + return; + } if (g_strcmp0(method_name, "SelfSign") == 0) { GVariant *prop_value; const gchar *prop_key; @@ -1849,18 +1899,15 @@ } static void -fu_main_on_bus_acquired_cb(GDBusConnection *connection, const gchar *name, gpointer user_data) +fu_main_register_object(FuMainPrivate *priv) { - FuMainPrivate *priv = (FuMainPrivate *)user_data; guint registration_id; - g_autoptr(GError) error = NULL; static const GDBusInterfaceVTable interface_vtable = {fu_main_daemon_method_call, fu_main_daemon_get_property, NULL}; - priv->connection = g_object_ref(connection); registration_id = - g_dbus_connection_register_object(connection, + g_dbus_connection_register_object(priv->connection, FWUPD_DBUS_PATH, priv->introspection_daemon->interfaces[0], &interface_vtable, @@ -1868,6 +1915,16 @@ NULL, /* user_data_free_func */ NULL); /* GError** */ g_assert(registration_id > 0); +} + +static void +fu_main_dbus_bus_acquired_cb(GDBusConnection *connection, const gchar *name, gpointer user_data) +{ + FuMainPrivate *priv = (FuMainPrivate *)user_data; + g_autoptr(GError) error = NULL; + + priv->connection = g_object_ref(connection); + fu_main_register_object(priv); /* connect to D-Bus directly */ priv->proxy_uid = g_dbus_proxy_new_sync(priv->connection, @@ -1886,13 +1943,13 @@ } static void -fu_main_on_name_acquired_cb(GDBusConnection *connection, const gchar *name, gpointer user_data) +fu_main_dbus_name_acquired_cb(GDBusConnection *connection, const gchar *name, gpointer user_data) { g_debug("acquired name: %s", name); } static void -fu_main_on_name_lost_cb(GDBusConnection *connection, const gchar *name, gpointer user_data) +fu_main_dbus_name_lost_cb(GDBusConnection *connection, const gchar *name, gpointer user_data) { FuMainPrivate *priv = (FuMainPrivate *)user_data; if (priv->update_in_progress) { @@ -1903,6 +1960,27 @@ g_main_loop_quit(priv->loop); } +static void +fu_main_dbus_connection_closed_cb(GDBusConnection *connection, + gboolean remote_peer_vanished, + GError *error, + gpointer user_data) +{ + FuMainPrivate *priv = (FuMainPrivate *)user_data; + g_debug("client connection closed: %s", error != NULL ? error->message : "unknown"); + g_clear_object(&priv->connection); +} + +static gboolean +fu_main_dbus_new_connection_cb(GDBusServer *server, GDBusConnection *connection, gpointer user_data) +{ + FuMainPrivate *priv = (FuMainPrivate *)user_data; + g_set_object(&priv->connection, connection); + g_signal_connect(connection, "closed", G_CALLBACK(fu_main_dbus_connection_closed_cb), priv); + fu_main_register_object(priv); + return TRUE; +} + static gboolean fu_main_timed_exit_cb(gpointer user_data) { @@ -1990,6 +2068,8 @@ fu_main_private_free(FuMainPrivate *priv) { g_hash_table_unref(priv->sender_items); + if (priv->process_quit_id != 0) + g_source_remove(priv->process_quit_id); if (priv->loop != NULL) g_main_loop_unref(priv->loop); if (priv->owner_id > 0) @@ -2034,6 +2114,7 @@ { gboolean immediate_exit = FALSE; gboolean timed_exit = FALSE; + const gchar *socket_filename = g_getenv("FWUPD_DBUS_SOCKET"); const GOptionEntry options[] = { {"timed-exit", '\0', @@ -2160,15 +2241,42 @@ } /* own the object */ - priv->owner_id = g_bus_own_name(G_BUS_TYPE_SYSTEM, - FWUPD_DBUS_SERVICE, - G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT | - G_BUS_NAME_OWNER_FLAGS_REPLACE, - fu_main_on_bus_acquired_cb, - fu_main_on_name_acquired_cb, - fu_main_on_name_lost_cb, - priv, - NULL); + if (socket_filename != NULL) { + g_autofree gchar *address = g_strdup_printf("unix:path=%s", socket_filename); + g_autofree gchar *guid = g_dbus_generate_guid(); + g_autoptr(GDBusServer) server = NULL; + + /* this must be owned by root */ +#ifndef HAVE_SYSTEMD + g_unlink(socket_filename); +#endif + server = g_dbus_server_new_sync(address, + G_DBUS_SERVER_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS, + guid, + NULL, + NULL, + &error); + + if (server == NULL) { + g_printerr("Failed to create D-Bus server: %s\n", error->message); + return EXIT_FAILURE; + } + g_dbus_server_start(server); + g_signal_connect(server, + "new-connection", + G_CALLBACK(fu_main_dbus_new_connection_cb), + priv); + } else { + priv->owner_id = g_bus_own_name(G_BUS_TYPE_SYSTEM, + FWUPD_DBUS_SERVICE, + G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT | + G_BUS_NAME_OWNER_FLAGS_REPLACE, + fu_main_dbus_bus_acquired_cb, + fu_main_dbus_name_acquired_cb, + fu_main_dbus_name_lost_cb, + priv, + NULL); + } /* Only timeout and close the mainloop if we have specified it * on the command line */ diff -Nru fwupd-1.7.4/src/fu-tool.c fwupd-1.7.5/src/fu-tool.c --- fwupd-1.7.4/src/fu-tool.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/src/fu-tool.c 2022-02-07 16:24:38.000000000 +0000 @@ -23,6 +23,7 @@ #include "fwupd-common-private.h" #include "fwupd-device-private.h" +#include "fwupd-plugin-private.h" #include "fu-cabinet.h" #include "fu-context-private.h" @@ -243,18 +244,19 @@ static gboolean fu_util_start_engine(FuUtilPrivate *priv, FuEngineLoadFlags flags, GError **error) { -#ifdef HAVE_SYSTEMD - g_autoptr(GError) error_local = NULL; -#endif - if (!fu_util_lock(priv, error)) { /* TRANSLATORS: another fwupdtool instance is already running */ g_prefix_error(error, "%s: ", _("Failed to lock")); return FALSE; } #ifdef HAVE_SYSTEMD - if (!fu_systemd_unit_stop(fu_util_get_systemd_unit(), &error_local)) - g_debug("Failed to stop daemon: %s", error_local->message); + if (getuid() != 0 || geteuid() != 0) { + g_debug("not attempting to stop daemon when running as user"); + } else { + g_autoptr(GError) error_local = NULL; + if (!fu_systemd_unit_stop(fu_util_get_systemd_unit(), &error_local)) + g_debug("Failed to stop daemon: %s", error_local->message); + } #endif if (!fu_engine_load(priv->engine, flags, error)) return FALSE; @@ -384,18 +386,24 @@ static void fu_main_engine_status_changed_cb(FuEngine *engine, FwupdStatus status, FuUtilPrivate *priv) { + if (priv->as_json) + return; fu_progressbar_update(priv->progressbar, status, 0); } static void fu_util_progress_percentage_changed_cb(FuProgress *progress, guint percentage, FuUtilPrivate *priv) { + if (priv->as_json) + return; fu_progressbar_update(priv->progressbar, fu_progress_get_status(progress), percentage); } static void fu_util_progress_status_changed_cb(FuProgress *progress, FwupdStatus status, FuUtilPrivate *priv) { + if (priv->as_json) + return; fu_progressbar_update(priv->progressbar, status, fu_progress_get_percentage(progress)); } @@ -415,6 +423,25 @@ } static gboolean +fu_util_get_plugins_as_json(FuUtilPrivate *priv, GPtrArray *plugins, GError **error) +{ + g_autoptr(JsonBuilder) builder = json_builder_new(); + json_builder_begin_object(builder); + + json_builder_set_member_name(builder, "Plugins"); + json_builder_begin_array(builder); + for (guint i = 0; i < plugins->len; i++) { + FwupdPlugin *plugin = g_ptr_array_index(plugins, i); + json_builder_begin_object(builder); + fwupd_plugin_to_json(plugin, builder); + json_builder_end_object(builder); + } + json_builder_end_array(builder); + json_builder_end_object(builder); + return fu_util_print_builder(builder, error); +} + +static gboolean fu_util_get_plugins(FuUtilPrivate *priv, gchar **values, GError **error) { GPtrArray *plugins; @@ -426,6 +453,10 @@ /* print */ plugins = fu_engine_get_plugins(priv->engine); g_ptr_array_sort(plugins, (GCompareFunc)fu_util_plugin_name_sort_cb); + if (priv->as_json) + return fu_util_get_plugins_as_json(priv, plugins, error); + + /* print */ for (guint i = 0; i < plugins->len; i++) { FuPlugin *plugin = g_ptr_array_index(plugins, i); g_autofree gchar *str = fu_util_plugin_to_string(FWUPD_PLUGIN(plugin), 0); @@ -1304,12 +1335,52 @@ } static gboolean -fu_util_update_all(FuUtilPrivate *priv, GError **error) +fu_util_update(FuUtilPrivate *priv, gchar **values, GError **error) { g_autoptr(GPtrArray) devices = NULL; gboolean no_updates_header = FALSE; gboolean latest_header = FALSE; + if (priv->flags & FWUPD_INSTALL_FLAG_ALLOW_OLDER) { + g_set_error_literal(error, + FWUPD_ERROR, + FWUPD_ERROR_INVALID_ARGS, + "--allow-older is not supported for this command"); + return FALSE; + } + + if (priv->flags & FWUPD_INSTALL_FLAG_ALLOW_REINSTALL) { + g_set_error_literal(error, + FWUPD_ERROR, + FWUPD_ERROR_INVALID_ARGS, + "--allow-reinstall is not supported for this command"); + return FALSE; + } + + if (!fu_util_start_engine(priv, + FU_ENGINE_LOAD_FLAG_COLDPLUG | FU_ENGINE_LOAD_FLAG_HWINFO | + FU_ENGINE_LOAD_FLAG_REMOTES, + error)) + return FALSE; + + /* DEVICE-ID and GUID are acceptable args to update */ + for (guint idx = 0; idx < g_strv_length(values); idx++) { + if (!fwupd_guid_is_valid(values[idx]) && !fwupd_device_id_is_valid(values[idx])) { + g_set_error(error, + FWUPD_ERROR, + FWUPD_ERROR_INVALID_ARGS, + "'%s' is not a valid GUID nor DEVICE-ID", + values[idx]); + return FALSE; + } + } + + priv->current_operation = FU_UTIL_OPERATION_UPDATE; + g_signal_connect(FU_ENGINE(priv->engine), + "device-changed", + G_CALLBACK(fu_util_update_device_changed_cb), + priv); + devices = fu_engine_get_devices(priv->engine, error); if (devices == NULL) return FALSE; @@ -1318,10 +1389,21 @@ for (guint i = 0; i < devices->len; i++) { FwupdDevice *dev = g_ptr_array_index(devices, i); FwupdRelease *rel; - const gchar *device_id; + const gchar *device_id = fu_device_get_id(dev); g_autoptr(GPtrArray) rels = NULL; g_autoptr(GError) error_local = NULL; + gboolean dev_skip_byid = TRUE; + /* only process particular DEVICE-ID or GUID if specified */ + for (guint idx = 0; idx < g_strv_length(values); idx++) { + const gchar *tmpid = values[idx]; + if (fwupd_device_has_guid(dev, tmpid) || g_strcmp0(device_id, tmpid) == 0) { + dev_skip_byid = FALSE; + break; + } + } + if (g_strv_length(values) > 0 && dev_skip_byid) + continue; if (!fu_util_is_interesting_device(dev)) continue; /* only show stuff that has metadata available */ @@ -1341,7 +1423,6 @@ if (!fu_util_filter_device(priv, dev)) continue; - device_id = fu_device_get_id(dev); rels = fu_engine_get_upgrades(priv->engine, priv->request, device_id, &error_local); if (rels == NULL) { if (!latest_header) { @@ -1372,85 +1453,6 @@ } fu_util_display_current_message(priv); } - return TRUE; -} - -static gboolean -fu_util_update_by_id(FuUtilPrivate *priv, const gchar *id, GError **error) -{ - FwupdRelease *rel; - g_autoptr(FuDevice) dev = NULL; - g_autoptr(GPtrArray) rels = NULL; - - /* do not allow a partial device-id, lookup GUIDs */ - dev = fu_util_get_device(priv, id, error); - if (dev == NULL) - return FALSE; - - /* get the releases for this device and filter for validity */ - rels = fu_engine_get_upgrades(priv->engine, priv->request, fu_device_get_id(dev), error); - if (rels == NULL) - return FALSE; - - /* detect bitlocker */ - if (!priv->no_safety_check) { - if (!fu_util_prompt_warning_fde(FWUPD_DEVICE(dev), error)) - return FALSE; - } - rel = g_ptr_array_index(rels, 0); - if (!fu_util_install_release(priv, rel, error)) - return FALSE; - fu_util_display_current_message(priv); - - return TRUE; -} - -static gboolean -fu_util_update(FuUtilPrivate *priv, gchar **values, GError **error) -{ - if (priv->flags & FWUPD_INSTALL_FLAG_ALLOW_OLDER) { - g_set_error_literal(error, - FWUPD_ERROR, - FWUPD_ERROR_INVALID_ARGS, - "--allow-older is not supported for this command"); - return FALSE; - } - - if (priv->flags & FWUPD_INSTALL_FLAG_ALLOW_REINSTALL) { - g_set_error_literal(error, - FWUPD_ERROR, - FWUPD_ERROR_INVALID_ARGS, - "--allow-reinstall is not supported for this command"); - return FALSE; - } - - if (g_strv_length(values) > 1) { - g_set_error_literal(error, - FWUPD_ERROR, - FWUPD_ERROR_INVALID_ARGS, - "Invalid arguments"); - return FALSE; - } - - if (!fu_util_start_engine(priv, - FU_ENGINE_LOAD_FLAG_COLDPLUG | FU_ENGINE_LOAD_FLAG_HWINFO | - FU_ENGINE_LOAD_FLAG_REMOTES, - error)) - return FALSE; - - priv->current_operation = FU_UTIL_OPERATION_UPDATE; - g_signal_connect(FU_ENGINE(priv->engine), - "device-changed", - G_CALLBACK(fu_util_update_device_changed_cb), - priv); - - if (g_strv_length(values) == 1) { - if (!fu_util_update_by_id(priv, values[0], error)) - return FALSE; - } else { - if (!fu_util_update_all(priv, error)) - return FALSE; - } /* we don't want to ask anything */ if (priv->no_reboot_check) { @@ -3068,6 +3070,32 @@ return fu_util_prompt_complete(priv->completion_flags, TRUE, error); } +static gboolean +fu_util_version(FuUtilPrivate *priv, GError **error) +{ + g_autoptr(GHashTable) metadata = NULL; + g_autofree gchar *str = NULL; + + /* get metadata */ + metadata = fu_engine_get_report_metadata(priv->engine, error); + if (metadata == NULL) + return FALSE; + + /* dump to the screen in the most appropriate format */ + if (priv->as_json) + return fu_util_project_versions_as_json(metadata, error); + str = fu_util_project_versions_to_string(metadata); + g_print("%s", str); + return TRUE; +} + +static gboolean +fu_util_clear_history(FuUtilPrivate *priv, gchar **values, GError **error) +{ + g_autoptr(FuHistory) history = fu_history_new(); + return fu_history_remove_all(history, error); +} + int main(int argc, char *argv[]) { @@ -3412,7 +3440,8 @@ /* TRANSLATORS: command argument: uppercase, spaces->dashes */ _("[DEVICE-ID|GUID]"), /* TRANSLATORS: command description */ - _("Update all devices that match local metadata"), + _("Updates all specified devices to latest firmware version, or all " + "devices if unspecified"), fu_util_update); fu_util_cmd_array_add(cmd_array, "self-sign", @@ -3534,6 +3563,12 @@ /* TRANSLATORS: command description */ _("Switch the firmware branch on the device"), fu_util_switch_branch); + fu_util_cmd_array_add(cmd_array, + "clear-history", + NULL, + /* TRANSLATORS: command description */ + _("Erase all firmware update history"), + fu_util_clear_history); /* do stuff on ctrl+c */ priv->cancellable = g_cancellable_new(); @@ -3557,7 +3592,8 @@ fu_engine_request_set_feature_flags( priv->request, FWUPD_FEATURE_FLAG_DETACH_ACTION | FWUPD_FEATURE_FLAG_SWITCH_BRANCH | - FWUPD_FEATURE_FLAG_FDE_WARNING | FWUPD_FEATURE_FLAG_UPDATE_ACTION); + FWUPD_FEATURE_FLAG_FDE_WARNING | FWUPD_FEATURE_FLAG_UPDATE_ACTION | + FWUPD_FEATURE_FLAG_COMMUNITY_TEXT); } fu_progressbar_set_interactive(priv->progressbar, priv->interactive); @@ -3641,8 +3677,10 @@ /* just show versions and exit */ if (version) { - g_autofree gchar *version_str = fu_util_get_versions(); - g_print("%s\n", version_str); + if (!fu_util_version(priv, &error)) { + g_printerr("%s\n", error->message); + return EXIT_FAILURE; + } return EXIT_SUCCESS; } diff -Nru fwupd-1.7.4/src/fu-udev-backend.c fwupd-1.7.5/src/fu-udev-backend.c --- fwupd-1.7.4/src/fu-udev-backend.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/src/fu-udev-backend.c 2022-02-07 16:24:38.000000000 +0000 @@ -41,8 +41,7 @@ /* find the device we enumerated */ device_tmp = fu_backend_lookup_by_id(FU_BACKEND(self), g_udev_device_get_sysfs_path(udev_device)); - if (device_tmp != NULL && - !fu_device_has_internal_flag(device_tmp, FU_DEVICE_INTERNAL_FLAG_NO_AUTO_REMOVE)) { + if (device_tmp != NULL) { if (g_getenv("FWUPD_PROBE_VERBOSE") != NULL) { g_debug("UDEV %s removed", g_udev_device_get_sysfs_path(udev_device)); } diff -Nru fwupd-1.7.4/src/fu-usb-backend.c fwupd-1.7.5/src/fu-usb-backend.c --- fwupd-1.7.4/src/fu-usb-backend.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/src/fu-usb-backend.c 2022-02-07 16:24:38.000000000 +0000 @@ -66,8 +66,7 @@ /* find the device we enumerated */ device_tmp = fu_backend_lookup_by_id(FU_BACKEND(self), g_usb_device_get_platform_id(usb_device)); - if (device_tmp != NULL && - !fu_device_has_internal_flag(device_tmp, FU_DEVICE_INTERNAL_FLAG_NO_AUTO_REMOVE)) + if (device_tmp != NULL) fu_backend_device_removed(backend, device_tmp); } diff -Nru fwupd-1.7.4/src/fu-util.c fwupd-1.7.5/src/fu-util.c --- fwupd-1.7.4/src/fu-util.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/src/fu-util.c 2022-02-07 16:24:38.000000000 +0000 @@ -18,7 +18,6 @@ #ifdef HAVE_GIO_UNIX #include #endif -#include #include #include #include @@ -29,7 +28,6 @@ #include "fwupd-release-private.h" #include "fwupd-remote-private.h" -#include "fu-history.h" #include "fu-plugin-private.h" #include "fu-polkit-agent.h" #include "fu-progressbar.h" @@ -254,7 +252,7 @@ } /* get all devices from the history database */ - devices = fwupd_client_get_history(priv->client, NULL, &error_local); + devices = fwupd_client_get_history(priv->client, priv->cancellable, &error_local); if (devices == NULL) { if (g_error_matches(error_local, FWUPD_ERROR, FWUPD_ERROR_NOTHING_TO_DO)) return TRUE; @@ -263,7 +261,7 @@ } /* create a map of RemoteID to RemoteURI */ - remotes = fwupd_client_get_remotes(priv->client, NULL, error); + remotes = fwupd_client_get_remotes(priv->client, priv->cancellable, error); if (remotes == NULL) return FALSE; remote_id_uri_map = g_hash_table_new(g_str_hash, g_str_equal); @@ -392,7 +390,7 @@ remote_id, "ReportURI", "", - NULL, + priv->cancellable, error)) return FALSE; } @@ -426,7 +424,7 @@ remote_id, "AutomaticReports", "true", - NULL, + priv->cancellable, error)) return FALSE; } @@ -469,32 +467,6 @@ return TRUE; } -static gboolean -fu_util_print_builder(JsonBuilder *builder, GError **error) -{ - g_autofree gchar *data = NULL; - g_autoptr(JsonGenerator) json_generator = NULL; - g_autoptr(JsonNode) json_root = NULL; - - /* export as a string */ - json_root = json_builder_get_root(builder); - json_generator = json_generator_new(); - json_generator_set_pretty(json_generator, TRUE); - json_generator_set_root(json_generator, json_root); - data = json_generator_to_data(json_generator, NULL); - if (data == NULL) { - g_set_error_literal(error, - FWUPD_ERROR, - FWUPD_ERROR_INTERNAL, - "Failed to convert to JSON string"); - return FALSE; - } - - /* just print */ - g_print("%s\n", data); - return TRUE; -} - static void fu_util_build_device_tree(FuUtilPrivate *priv, GNode *root, GPtrArray *devs, FwupdDevice *dev) { @@ -582,7 +554,7 @@ g_autofree gchar *title = fu_util_get_tree_title(priv); /* get results from daemon */ - devs = fwupd_client_get_devices(priv->client, NULL, error); + devs = fwupd_client_get_devices(priv->client, priv->cancellable, error); if (devs == NULL) return FALSE; @@ -632,7 +604,7 @@ g_autoptr(GPtrArray) plugins = NULL; /* get results from daemon */ - plugins = fwupd_client_get_plugins(priv->client, NULL, error); + plugins = fwupd_client_get_plugins(priv->client, priv->cancellable, error); if (plugins == NULL) return FALSE; if (priv->as_json) @@ -747,7 +719,8 @@ g_autoptr(GPtrArray) devices = NULL; g_debug("looking for guid %s", guid); - devices = fwupd_client_get_devices_by_guid(priv->client, guid, NULL, NULL); + devices = + fwupd_client_get_devices_by_guid(priv->client, guid, priv->cancellable, NULL); if (devices == NULL) continue; if (devices->len > 1) { @@ -867,7 +840,7 @@ FWUPD_DEVICE_ID_ANY, filename, priv->flags, - NULL, + priv->cancellable, &error_local)) { if (g_error_matches(error_local, FWUPD_ERROR, FWUPD_ERROR_NOT_FOUND)) { json_builder_set_member_name(helper->builder, "info"); @@ -1132,7 +1105,12 @@ return FALSE; } - if (!fwupd_client_install(priv->client, id, filename, priv->flags, NULL, error)) + if (!fwupd_client_install(priv->client, + id, + filename, + priv->flags, + priv->cancellable, + error)) return FALSE; fu_util_display_current_message(priv); @@ -1184,7 +1162,7 @@ /* implied, important for get-details on a device not in your system */ priv->show_all = TRUE; - array = fwupd_client_get_details(priv->client, values[0], NULL, error); + array = fwupd_client_get_details(priv->client, values[0], priv->cancellable, error); if (array == NULL) return FALSE; if (priv->as_json) @@ -1197,13 +1175,6 @@ } static gboolean -fu_util_clear_history(FuUtilPrivate *priv, gchar **values, GError **error) -{ - g_autoptr(FuHistory) history = fu_history_new(); - return fu_history_remove_all(history, error); -} - -static gboolean fu_util_report_history_for_remote(FuUtilPrivate *priv, const gchar *remote_id, GPtrArray *devices, @@ -1230,7 +1201,7 @@ return FALSE; } - remote = fwupd_client_get_remote_by_id(priv->client, remote_id, NULL, error); + remote = fwupd_client_get_remote_by_id(priv->client, remote_id, priv->cancellable, error); if (remote == NULL) return FALSE; @@ -1281,7 +1252,7 @@ /* get all devices from the history database, then filter them, * adding to a hash map of report-ids */ - devices = fwupd_client_get_history(priv->client, NULL, error); + devices = fwupd_client_get_history(priv->client, priv->cancellable, error); if (devices == NULL) return FALSE; report_map = g_hash_table_new_full(g_str_hash, @@ -1319,7 +1290,10 @@ g_debug("%s has no RemoteID", fwupd_device_get_id(dev)); continue; } - remote = fwupd_client_get_remote_by_id(priv->client, remote_id, NULL, error); + remote = fwupd_client_get_remote_by_id(priv->client, + remote_id, + priv->cancellable, + error); if (remote == NULL) return FALSE; if (fwupd_remote_get_report_uri(remote) == NULL) { @@ -1362,7 +1336,7 @@ fwupd_device_get_id(dev), "Flags", "reported", - NULL, + priv->cancellable, error)) return FALSE; } @@ -1387,7 +1361,7 @@ g_autofree gchar *title = fu_util_get_tree_title(priv); /* get all devices from the history database */ - devices = fwupd_client_get_history(priv->client, NULL, error); + devices = fwupd_client_get_history(priv->client, priv->cancellable, error); if (devices == NULL) return FALSE; @@ -1422,7 +1396,7 @@ /* try to lookup releases from client */ rels = fwupd_client_get_releases(priv->client, fwupd_device_get_id(dev), - NULL, + priv->cancellable, &error_local); if (rels == NULL) { g_debug("failed to get releases for %s: %s", @@ -1462,7 +1436,8 @@ { if (fwupd_guid_is_valid(id)) { g_autoptr(GPtrArray) devices = NULL; - devices = fwupd_client_get_devices_by_guid(priv->client, id, NULL, error); + devices = + fwupd_client_get_devices_by_guid(priv->client, id, priv->cancellable, error); if (devices == NULL) return NULL; return fu_util_prompt_for_device(priv, devices, error); @@ -1477,7 +1452,7 @@ return NULL; } } - return fwupd_client_get_device_by_id(priv->client, id, NULL, error); + return fwupd_client_get_device_by_id(priv->client, id, priv->cancellable, error); } static FwupdDevice * @@ -1495,7 +1470,7 @@ } /* get all devices from daemon */ - devices = fwupd_client_get_devices(priv->client, NULL, error); + devices = fwupd_client_get_devices(priv->client, priv->cancellable, error); if (devices == NULL) return NULL; return fu_util_prompt_for_device(priv, devices, error); @@ -1510,14 +1485,10 @@ if (dev == NULL) return FALSE; - return fwupd_client_clear_results(priv->client, fwupd_device_get_id(dev), NULL, error); -} - -static gboolean -fu_util_clear_offline(FuUtilPrivate *priv, gchar **values, GError **error) -{ - g_autoptr(FuHistory) history = fu_history_new(); - return fu_history_remove_all_with_state(history, FWUPD_UPDATE_STATE_PENDING, error); + return fwupd_client_clear_results(priv->client, + fwupd_device_get_id(dev), + priv->cancellable, + error); } static gboolean @@ -1530,7 +1501,10 @@ if (dev == NULL) return FALSE; - if (!fwupd_client_verify_update(priv->client, fwupd_device_get_id(dev), NULL, error)) { + if (!fwupd_client_verify_update(priv->client, + fwupd_device_get_id(dev), + priv->cancellable, + error)) { g_prefix_error(error, "failed to verify update %s: ", fu_device_get_name(dev)); return FALSE; } @@ -1546,7 +1520,7 @@ g_autoptr(FwupdRemote) remote = NULL; /* is the LVFS available but disabled? */ - remote = fwupd_client_get_remote_by_id(priv->client, "lvfs", NULL, error); + remote = fwupd_client_get_remote_by_id(priv->client, "lvfs", priv->cancellable, error); if (remote == NULL) return TRUE; g_print("%s\n%s\n%s [Y|n]: ", @@ -1579,7 +1553,7 @@ gboolean checked = FALSE; /* get the age of the oldest enabled remotes */ - remotes = fwupd_client_get_remotes(priv->client, NULL, error); + remotes = fwupd_client_get_remotes(priv->client, priv->cancellable, error); if (remotes == NULL) return FALSE; for (guint i = 0; i < remotes->len; i++) { @@ -1634,7 +1608,7 @@ } } - remotes = fwupd_client_get_remotes(priv->client, NULL, error); + remotes = fwupd_client_get_remotes(priv->client, priv->cancellable, error); if (remotes == NULL) return FALSE; for (guint i = 0; i < remotes->len; i++) { @@ -1662,7 +1636,7 @@ } /* get devices from daemon */ - devs = fwupd_client_get_devices(priv->client, NULL, error); + devs = fwupd_client_get_devices(priv->client, priv->cancellable, error); if (devs == NULL) return FALSE; @@ -1705,7 +1679,7 @@ values[2], values[0], values[1], - NULL, + priv->cancellable, error)) return FALSE; @@ -1735,7 +1709,10 @@ if (dev == NULL) return FALSE; - rel = fwupd_client_get_results(priv->client, fwupd_device_get_id(dev), NULL, error); + rel = fwupd_client_get_results(priv->client, + fwupd_device_get_id(dev), + priv->cancellable, + error); if (rel == NULL) return FALSE; if (priv->as_json) @@ -1757,7 +1734,10 @@ return FALSE; /* get the releases for this device */ - rels = fwupd_client_get_releases(priv->client, fwupd_device_get_id(dev), NULL, error); + rels = fwupd_client_get_releases(priv->client, + fwupd_device_get_id(dev), + priv->cancellable, + error); if (rels == NULL) return FALSE; @@ -1840,7 +1820,10 @@ if (dev == NULL) return FALSE; - if (!fwupd_client_verify(priv->client, fwupd_device_get_id(dev), NULL, error)) { + if (!fwupd_client_verify(priv->client, + fwupd_device_get_id(dev), + priv->cancellable, + error)) { g_prefix_error(error, "failed to verify %s: ", fu_device_get_name(dev)); return FALSE; } @@ -1865,7 +1848,7 @@ if (fwupd_device_has_flag(dev, FWUPD_DEVICE_FLAG_NEEDS_REBOOT)) priv->completion_flags |= FWUPD_DEVICE_FLAG_NEEDS_REBOOT; - if (!fwupd_client_unlock(priv->client, fwupd_device_get_id(dev), NULL, error)) + if (!fwupd_client_unlock(priv->client, fwupd_device_get_id(dev), priv->cancellable, error)) return FALSE; return fu_util_prompt_complete(priv->completion_flags, TRUE, error); @@ -1932,7 +1915,7 @@ /* get the releases for this device and filter for validity */ rels = fwupd_client_get_upgrades(priv->client, fwupd_device_get_id(dev), - NULL, + priv->cancellable, &error_local); if (rels == NULL) { g_debug("no upgrades: %s", error_local->message); @@ -1969,7 +1952,7 @@ /* handle both forms */ if (g_strv_length(values) == 0) { - devices = fwupd_client_get_devices(priv->client, NULL, error); + devices = fwupd_client_get_devices(priv->client, priv->cancellable, error); if (devices == NULL) return FALSE; } else if (g_strv_length(values) == 1) { @@ -2018,7 +2001,7 @@ /* get the releases for this device and filter for validity */ rels = fwupd_client_get_upgrades(priv->client, fwupd_device_get_id(dev), - NULL, + priv->cancellable, &error_local); if (rels == NULL) { if (!latest_header) { @@ -2095,7 +2078,7 @@ g_autoptr(GPtrArray) remotes = NULL; g_autofree gchar *title = fu_util_get_tree_title(priv); - remotes = fwupd_client_get_remotes(priv->client, NULL, error); + remotes = fwupd_client_get_remotes(priv->client, priv->cancellable, error); if (remotes == NULL) return FALSE; if (priv->as_json) @@ -2222,7 +2205,7 @@ } /* find other devices matching the composite ID and the release checksum */ - devices = fwupd_client_get_devices(priv->client, NULL, error); + devices = fwupd_client_get_devices(priv->client, priv->cancellable, error); if (devices == NULL) return FALSE; for (guint i = 0; i < devices->len; i++) { @@ -2244,7 +2227,7 @@ continue; rels = fwupd_client_get_releases(priv->client, fwupd_device_get_id(dev_tmp), - NULL, + priv->cancellable, &error_local); if (rels == NULL) { g_debug("ignoring: %s", error_local->message); @@ -2302,7 +2285,7 @@ g_debug("not sending reports, no remote"); return TRUE; } - remote = fwupd_client_get_remote_by_id(priv->client, remote_id, NULL, error); + remote = fwupd_client_get_remote_by_id(priv->client, remote_id, priv->cancellable, error); if (remote == NULL) return FALSE; if (fwupd_remote_get_automatic_reports(remote)) { @@ -2315,15 +2298,43 @@ } static gboolean -fu_util_update_all(FuUtilPrivate *priv, GError **error) +fu_util_update(FuUtilPrivate *priv, gchar **values, GError **error) { g_autoptr(GPtrArray) devices = NULL; gboolean supported = FALSE; gboolean no_updates_header = FALSE; gboolean latest_header = FALSE; + if (priv->flags & FWUPD_INSTALL_FLAG_ALLOW_OLDER) { + g_set_error_literal(error, + FWUPD_ERROR, + FWUPD_ERROR_INVALID_ARGS, + "--allow-older is not supported for this command"); + return FALSE; + } + + if (priv->flags & FWUPD_INSTALL_FLAG_ALLOW_REINSTALL) { + g_set_error_literal(error, + FWUPD_ERROR, + FWUPD_ERROR_INVALID_ARGS, + "--allow-reinstall is not supported for this command"); + return FALSE; + } + + /* DEVICE-ID and GUID are acceptable args to update */ + for (guint idx = 0; idx < g_strv_length(values); idx++) { + if (!fwupd_guid_is_valid(values[idx]) && !fwupd_device_id_is_valid(values[idx])) { + g_set_error(error, + FWUPD_ERROR, + FWUPD_ERROR_INVALID_ARGS, + "'%s' is not a valid GUID nor DEVICE-ID", + values[idx]); + return FALSE; + } + } + /* get devices from daemon */ - devices = fwupd_client_get_devices(priv->client, NULL, error); + devices = fwupd_client_get_devices(priv->client, priv->cancellable, error); if (devices == NULL) return FALSE; priv->current_operation = FU_UTIL_OPERATION_UPDATE; @@ -2339,9 +2350,11 @@ for (guint i = 0; i < devices->len; i++) { FwupdDevice *dev = g_ptr_array_index(devices, i); FwupdRelease *rel; + const gchar *device_id = fu_device_get_id(dev); const gchar *remote_id; g_autoptr(GPtrArray) rels = NULL; g_autoptr(GError) error_local = NULL; + gboolean dev_skip_byid = TRUE; /* not going to have results, so save a D-Bus round-trip */ if (!fwupd_device_has_flag(dev, FWUPD_DEVICE_FLAG_UPDATABLE)) @@ -2357,6 +2370,17 @@ g_printerr(" • %s\n", fwupd_device_get_name(dev)); continue; } + + /* only process particular DEVICE-ID or GUID if specified */ + for (guint idx = 0; idx < g_strv_length(values); idx++) { + const gchar *tmpid = values[idx]; + if (fwupd_device_has_guid(dev, tmpid) || g_strcmp0(device_id, tmpid) == 0) { + dev_skip_byid = FALSE; + break; + } + } + if (g_strv_length(values) > 0 && dev_skip_byid) + continue; if (!fu_util_filter_device(priv, dev)) continue; supported = TRUE; @@ -2364,7 +2388,7 @@ /* get the releases for this device and filter for validity */ rels = fwupd_client_get_upgrades(priv->client, fwupd_device_get_id(dev), - NULL, + priv->cancellable, &error_local); if (rels == NULL) { if (!latest_header) { @@ -2411,81 +2435,6 @@ } static gboolean -fu_util_update_by_id(FuUtilPrivate *priv, const gchar *device_id, GError **error) -{ - FwupdRelease *rel; - const gchar *remote_id; - g_autoptr(FwupdDevice) dev = NULL; - g_autoptr(GPtrArray) rels = NULL; - - /* do not allow a partial device-id */ - dev = fu_util_get_device_by_id(priv, device_id, error); - if (dev == NULL) - return FALSE; - - /* get devices from daemon */ - priv->current_operation = FU_UTIL_OPERATION_UPDATE; - g_signal_connect(FWUPD_CLIENT(priv->client), - "device-changed", - G_CALLBACK(fu_util_update_device_changed_cb), - priv); - g_signal_connect(FWUPD_CLIENT(priv->client), - "device-request", - G_CALLBACK(fu_util_update_device_request_cb), - priv); - - /* get the releases for this device and filter for validity */ - rels = fwupd_client_get_upgrades(priv->client, fwupd_device_get_id(dev), NULL, error); - if (rels == NULL) - return FALSE; - rel = g_ptr_array_index(rels, 0); - if (!fu_util_update_device_with_release(priv, dev, rel, error)) - return FALSE; - fu_util_display_current_message(priv); - - /* send report if we're supposed to */ - remote_id = fwupd_release_get_remote_id(rel); - if (!fu_util_maybe_send_reports(priv, remote_id, error)) - return FALSE; - - /* we don't want to ask anything */ - if (priv->no_reboot_check) { - g_debug("skipping reboot check"); - return TRUE; - } - - /* the update needs the user to restart the computer */ - return fu_util_prompt_complete(priv->completion_flags, TRUE, error); -} - -static gboolean -fu_util_update(FuUtilPrivate *priv, gchar **values, GError **error) -{ - if (priv->flags & FWUPD_INSTALL_FLAG_ALLOW_OLDER) { - g_set_error_literal(error, - FWUPD_ERROR, - FWUPD_ERROR_INVALID_ARGS, - "--allow-older is not supported for this command"); - return FALSE; - } - - if (priv->flags & FWUPD_INSTALL_FLAG_ALLOW_REINSTALL) { - g_set_error_literal(error, - FWUPD_ERROR, - FWUPD_ERROR_INVALID_ARGS, - "--allow-reinstall is not supported for this command"); - return FALSE; - } - - if (g_strv_length(values) == 0) - return fu_util_update_all(priv, error); - if (g_strv_length(values) == 1) - return fu_util_update_by_id(priv, values[0], error); - g_set_error_literal(error, FWUPD_ERROR, FWUPD_ERROR_INVALID_ARGS, "Invalid arguments"); - return FALSE; -} - -static gboolean fu_util_remote_modify(FuUtilPrivate *priv, gchar **values, GError **error) { g_autoptr(FwupdRemote) remote = NULL; @@ -2616,7 +2565,10 @@ return FALSE; /* get the releases for this device and filter for validity */ - rels = fwupd_client_get_downgrades(priv->client, fwupd_device_get_id(dev), NULL, error); + rels = fwupd_client_get_downgrades(priv->client, + fwupd_device_get_id(dev), + priv->cancellable, + error); if (rels == NULL) { g_autofree gchar *downgrade_str = /* TRANSLATORS: message letting the user know no device downgrade available @@ -2675,7 +2627,10 @@ return FALSE; /* try to lookup/match release from client */ - rels = fwupd_client_get_releases(priv->client, fwupd_device_get_id(dev), NULL, error); + rels = fwupd_client_get_releases(priv->client, + fwupd_device_get_id(dev), + priv->cancellable, + error); if (rels == NULL) return FALSE; for (guint j = 0; j < rels->len; j++) { @@ -2750,7 +2705,10 @@ return FALSE; /* get all releases, including the alternate branch versions */ - rels = fwupd_client_get_releases(priv->client, fwupd_device_get_id(dev), NULL, error); + rels = fwupd_client_get_releases(priv->client, + fwupd_device_get_id(dev), + priv->cancellable, + error); if (rels == NULL) return FALSE; @@ -2864,7 +2822,7 @@ /* handle both forms */ if (g_strv_length(values) == 0) { /* activate anything with _NEEDS_ACTIVATION */ - devices = fwupd_client_get_devices(priv->client, NULL, error); + devices = fwupd_client_get_devices(priv->client, priv->cancellable, error); if (devices == NULL) return FALSE; for (guint i = 0; i < devices->len; i++) { @@ -2912,7 +2870,10 @@ /* TRANSLATORS: shown when shutting down to switch to the new version */ _("Activating firmware update for"), fwupd_device_get_name(device)); - if (!fwupd_client_activate(priv->client, NULL, fwupd_device_get_id(device), error)) + if (!fwupd_client_activate(priv->client, + priv->cancellable, + fwupd_device_get_id(device), + error)) return FALSE; } @@ -3042,7 +3003,7 @@ g_autoptr(GPtrArray) remotes = NULL; /* get all remotes */ - remotes = fwupd_client_get_remotes(priv->client, NULL, error); + remotes = fwupd_client_get_remotes(priv->client, priv->cancellable, error); if (remotes == NULL) return NULL; @@ -3102,7 +3063,7 @@ fwupd_remote_get_id(remote), "SecurityReportURI", "", - NULL, + priv->cancellable, error)) return FALSE; } @@ -3213,7 +3174,7 @@ fwupd_remote_get_id(remote), "AutomaticSecurityReports", "true", - NULL, + priv->cancellable, error)) return FALSE; } @@ -3515,7 +3476,7 @@ g_autoptr(FwupdRelease) release = NULL; g_autoptr(GPtrArray) devices = NULL; - devices = fwupd_client_get_history(priv->client, NULL, error); + devices = fwupd_client_get_history(priv->client, priv->cancellable, error); if (devices == NULL) return NULL; device = fu_util_prompt_for_device(priv, devices, error); @@ -3670,7 +3631,7 @@ g_autoptr(GPtrArray) plugins = NULL; /* get plugins from daemon, ignoring if the daemon is too old */ - plugins = fwupd_client_get_plugins(priv->client, NULL, NULL); + plugins = fwupd_client_get_plugins(priv->client, priv->cancellable, NULL); if (plugins == NULL) return; @@ -3715,6 +3676,25 @@ } } +static gboolean +fu_util_version(FuUtilPrivate *priv, GError **error) +{ + g_autoptr(GHashTable) metadata = NULL; + g_autofree gchar *str = NULL; + + /* get metadata */ + metadata = fwupd_client_get_report_metadata(priv->client, priv->cancellable, error); + if (metadata == NULL) + return FALSE; + + /* dump to the screen in the most appropriate format */ + if (priv->as_json) + return fu_util_project_versions_as_json(metadata, error); + str = fu_util_project_versions_to_string(metadata); + g_print("%s", str); + return TRUE; +} + int main(int argc, char *argv[]) { @@ -3943,12 +3923,6 @@ _("Show history of firmware updates"), fu_util_get_history); fu_util_cmd_array_add(cmd_array, - "clear-history", - NULL, - /* TRANSLATORS: command description */ - _("Erase all firmware update history"), - fu_util_clear_history); - fu_util_cmd_array_add(cmd_array, "report-history", NULL, /* TRANSLATORS: command description */ @@ -3980,7 +3954,8 @@ /* TRANSLATORS: command argument: uppercase, spaces->dashes */ _("[DEVICE-ID|GUID]"), /* TRANSLATORS: command description */ - _("Updates all firmware to latest versions available"), + _("Updates all specified devices to latest firmware version, or all " + "devices if unspecified"), fu_util_update); fu_util_cmd_array_add(cmd_array, "verify", @@ -4004,12 +3979,6 @@ _("Clears the results from the last update"), fu_util_clear_results); fu_util_cmd_array_add(cmd_array, - "clear-offline", - NULL, - /* TRANSLATORS: command description */ - _("Clears any updates scheduled to be updated offline"), - fu_util_clear_offline); - fu_util_cmd_array_add(cmd_array, "get-results", /* TRANSLATORS: command argument: uppercase, spaces->dashes */ _("DEVICE-ID|GUID"), @@ -4295,22 +4264,6 @@ G_CALLBACK(fu_util_client_notify_cb), priv); - /* just show versions and exit */ - if (version) { - g_autofree gchar *version_str = fu_util_get_versions(); - g_print("%s\n", version_str); - if (!fwupd_client_connect(priv->client, priv->cancellable, &error)) { - g_printerr("Failed to connect to daemon: %s\n", error->message); - return EXIT_FAILURE; - } - g_print("daemon version:\t%s\n", fwupd_client_get_daemon_version(priv->client)); - if (fwupd_client_get_host_bkc(priv->client) != NULL) { - g_print("host best-known-configuration:\t%s\n", - fwupd_client_get_host_bkc(priv->client)); - } - return EXIT_SUCCESS; - } - /* show a warning if the daemon is tainted */ if (!fwupd_client_connect(priv->client, priv->cancellable, &error)) { g_printerr("Failed to connect to daemon: %s\n", error->message); @@ -4327,6 +4280,15 @@ "is no longer supported by the upstream developers!")); } + /* just show versions and exit */ + if (version) { + if (!fu_util_version(priv, &error)) { + g_printerr("%s\n", error->message); + return EXIT_FAILURE; + } + return EXIT_SUCCESS; + } + /* show user-visible warnings from the plugins */ fu_util_show_plugin_warnings(priv); @@ -4365,7 +4327,8 @@ priv->client, FWUPD_FEATURE_FLAG_CAN_REPORT | FWUPD_FEATURE_FLAG_SWITCH_BRANCH | FWUPD_FEATURE_FLAG_REQUESTS | FWUPD_FEATURE_FLAG_UPDATE_ACTION | - FWUPD_FEATURE_FLAG_FDE_WARNING | FWUPD_FEATURE_FLAG_DETACH_ACTION, + FWUPD_FEATURE_FLAG_FDE_WARNING | FWUPD_FEATURE_FLAG_DETACH_ACTION | + FWUPD_FEATURE_FLAG_COMMUNITY_TEXT, priv->cancellable, &error)) { g_printerr("Failed to set front-end features: %s\n", error->message); diff -Nru fwupd-1.7.4/src/fu-util-common.c fwupd-1.7.5/src/fu-util-common.c --- fwupd-1.7.4/src/fu-util-common.c 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/src/fu-util-common.c 2022-02-07 16:24:38.000000000 +0000 @@ -284,26 +284,6 @@ return g_build_filename(root, "fwupd", basename, NULL); } -gchar * -fu_util_get_versions(void) -{ - GString *string = g_string_new(""); - - g_string_append_printf(string, "client version:\t%s\n", SOURCE_VERSION); - g_string_append_printf(string, "compile-time dependency versions\n"); -#ifdef HAVE_GUSB - g_string_append_printf(string, - "\tgusb:\t%d.%d.%d\n", - G_USB_MAJOR_VERSION, - G_USB_MINOR_VERSION, - G_USB_MICRO_VERSION); -#endif -#ifdef EFIVAR_LIBRARY_VERSION - g_string_append_printf(string, "\tefivar:\t%s", EFIVAR_LIBRARY_VERSION); -#endif - return g_string_free(string, FALSE); -} - static gboolean fu_util_update_shutdown(GError **error) { @@ -394,6 +374,41 @@ return val != NULL; } +static gchar * +fu_util_get_release_description_with_fallback(FwupdRelease *rel) +{ + g_autoptr(GString) str = g_string_new(NULL); + + /* add what we've got from the vendor */ + if (fwupd_release_get_description(rel) != NULL) + g_string_append(str, fwupd_release_get_description(rel)); + + /* add this client side to get the translations */ + if (!fwupd_release_has_flag(rel, FWUPD_RELEASE_FLAG_IS_COMMUNITY)) { + g_string_append_printf( + str, + "

%s

", + /* TRANSLATORS: the vendor did not upload this */ + _("This firmware is provided by LVFS community members and is not " + "provided (or supported) by the original hardware vendor.")); + g_string_append_printf( + str, + "

%s

", + /* TRANSLATORS: if it breaks, you get to keep both pieces */ + _("Installing this update may also void any device warranty.")); + } + + /* this can't be from the LVFS, but the user could be installing a local file */ + if (str->len == 0) { + g_string_append_printf(str, + "

%s

", + /* TRANSLATORS: naughty vendor */ + _("The vendor did not supply any release notes.")); + } + + return g_string_free(g_steal_pointer(&str), FALSE); +} + gboolean fu_util_prompt_warning(FwupdDevice *device, FwupdRelease *release, @@ -401,8 +416,8 @@ GError **error) { FwupdDeviceFlags flags; - const gchar *desc_tmp; gint vercmp; + g_autofree gchar *desc_fb = NULL; g_autoptr(GString) title = g_string_new(NULL); g_autoptr(GString) str = g_string_new(NULL); @@ -439,9 +454,9 @@ } /* description is optional */ - desc_tmp = fwupd_release_get_description(release); - if (desc_tmp != NULL) { - g_autofree gchar *desc = fu_util_convert_description(desc_tmp, NULL); + desc_fb = fu_util_get_release_description_with_fallback(release); + if (desc_fb != NULL) { + g_autofree gchar *desc = fu_util_convert_description(desc_fb, NULL); if (desc != NULL) g_string_append_printf(str, "\n%s", desc); } @@ -1223,6 +1238,10 @@ /* TRANSLATORS: we might ask the user the recovery key when next booting Windows */ return _("Full disk encryption secrets may be invalidated when updating"); } + if (device_flag == FWUPD_DEVICE_FLAG_END_OF_LIFE) { + /* TRANSLATORS: the vendor is no longer supporting the device */ + return _("End of life"); + } if (device_flag == FWUPD_DEVICE_FLAG_SKIPS_RESTART) { /* skip */ return NULL; @@ -1490,8 +1509,10 @@ return NULL; if (plugin_flag == FWUPD_PLUGIN_FLAG_USER_WARNING) return NULL; - if (plugin_flag == FWUPD_PLUGIN_FLAG_REQUIRE_HWID) - return NULL; + if (plugin_flag == FWUPD_PLUGIN_FLAG_REQUIRE_HWID) { + /* TRANSLATORS: Plugin is active only if hardware is found */ + return _("Enabled if hardware matches"); + } if (plugin_flag == FWUPD_PLUGIN_FLAG_NONE) { /* TRANSLATORS: Plugin is active and in use */ return _("Enabled"); @@ -1548,9 +1569,9 @@ case FWUPD_PLUGIN_FLAG_UNKNOWN: case FWUPD_PLUGIN_FLAG_CLEAR_UPDATABLE: case FWUPD_PLUGIN_FLAG_USER_WARNING: - case FWUPD_PLUGIN_FLAG_REQUIRE_HWID: return NULL; case FWUPD_PLUGIN_FLAG_NONE: + case FWUPD_PLUGIN_FLAG_REQUIRE_HWID: return fu_util_term_format(fu_util_plugin_flag_to_string(plugin_flag), FU_UTIL_TERM_COLOR_GREEN); case FWUPD_PLUGIN_FLAG_DISABLED: @@ -1645,14 +1666,58 @@ return _("Unknown"); } +static const gchar * +fu_util_release_flag_to_string(FwupdReleaseFlags release_flag) +{ + if (release_flag == FWUPD_RELEASE_FLAG_NONE) + return NULL; + if (release_flag == FWUPD_RELEASE_FLAG_TRUSTED_PAYLOAD) { + /* TRANSLATORS: We verified the payload against the server */ + return _("Trusted payload"); + } + if (release_flag == FWUPD_RELEASE_FLAG_TRUSTED_METADATA) { + /* TRANSLATORS: We verified the meatdata against the server */ + return _("Trusted metadata"); + } + if (release_flag == FWUPD_RELEASE_FLAG_IS_UPGRADE) { + /* TRANSLATORS: version is newer */ + return _("Is upgrade"); + } + if (release_flag == FWUPD_RELEASE_FLAG_IS_DOWNGRADE) { + /* TRANSLATORS: version is older */ + return _("Is downgrade"); + } + if (release_flag == FWUPD_RELEASE_FLAG_BLOCKED_VERSION) { + /* TRANSLATORS: version cannot be installed due to policy */ + return _("Blocked version"); + } + if (release_flag == FWUPD_RELEASE_FLAG_BLOCKED_APPROVAL) { + /* TRANSLATORS: version cannot be installed due to policy */ + return _("Not approved"); + } + if (release_flag == FWUPD_RELEASE_FLAG_IS_ALTERNATE_BRANCH) { + /* TRANSLATORS: is not the main firmware stream */ + return _("Alternate branch"); + } + if (release_flag == FWUPD_RELEASE_FLAG_IS_COMMUNITY) { + /* TRANSLATORS: is not supported by the vendor */ + return _("Community supported"); + } + + /* fall back for unknown types */ + return fwupd_release_flag_to_string(release_flag); +} + gchar * fu_util_release_to_string(FwupdRelease *rel, guint idt) { + const gchar *title; + const gchar *tmp2; GPtrArray *issues = fwupd_release_get_issues(rel); GPtrArray *tags = fwupd_release_get_tags(rel); GString *str = g_string_new(NULL); guint64 flags = fwupd_release_get_flags(rel); - g_autoptr(GString) flags_str = g_string_new(NULL); + g_autofree gchar *desc_fb = NULL; g_return_val_if_fail(FWUPD_IS_RELEASE(rel), NULL); @@ -1759,21 +1824,24 @@ fwupd_release_get_update_message(rel)); } + /* TRANSLATORS: release attributes */ + title = _("Release Flags"); for (guint i = 0; i < 64; i++) { + g_autofree gchar *bullet = NULL; if ((flags & ((guint64)1 << i)) == 0) continue; - g_string_append_printf(flags_str, - "%s|", - fwupd_release_flag_to_string((guint64)1 << i)); - } - if (flags_str->len > 0) { - g_string_truncate(flags_str, flags_str->len - 1); - /* TRANSLATORS: release properties */ - fu_common_string_append_kv(str, idt + 1, _("Flags"), flags_str->str); + tmp2 = fu_util_release_flag_to_string((guint64)1 << i); + if (tmp2 == NULL) + continue; + bullet = g_strdup_printf("• %s", tmp2); + fu_common_string_append_kv(str, idt + 1, title, bullet); + title = ""; } - if (fwupd_release_get_description(rel) != NULL) { + + desc_fb = fu_util_get_release_description_with_fallback(rel); + if (desc_fb != NULL) { g_autofree gchar *desc = NULL; - desc = fu_util_convert_description(fwupd_release_get_description(rel), NULL); + desc = fu_util_convert_description(desc_fb, NULL); if (desc == NULL) desc = g_strdup(fwupd_release_get_description(rel)); /* TRANSLATORS: multiline description of device */ @@ -2014,6 +2082,17 @@ FWUPD_SECURITY_ATTR_RESULT_NOT_ENABLED, NULL}, /* ------------------------------------------*/ + {"org.fwupd.hsi.Kernel.Tainted", + FWUPD_SECURITY_ATTR_RESULT_TAINTED, + FWUPD_SECURITY_ATTR_RESULT_NOT_TAINTED, + /* TRANSLATORS: HSI event title */ + _("Kernel is tainted")}, + {"org.fwupd.hsi.Kernel.Tainted", + FWUPD_SECURITY_ATTR_RESULT_NOT_TAINTED, + FWUPD_SECURITY_ATTR_RESULT_TAINTED, + /* TRANSLATORS: HSI event title */ + _("Kernel is no longer tainted")}, + /* ------------------------------------------*/ {"org.fwupd.hsi.Kernel.Lockdown", FWUPD_SECURITY_ATTR_RESULT_ENABLED, FWUPD_SECURITY_ATTR_RESULT_NOT_ENABLED, @@ -2025,6 +2104,17 @@ /* TRANSLATORS: HSI event title */ _("Kernel lockdown enabled")}, /* ------------------------------------------*/ + {"org.fwupd.hsi.AcpiDmar", + FWUPD_SECURITY_ATTR_RESULT_ENABLED, + FWUPD_SECURITY_ATTR_RESULT_NOT_ENABLED, + /* TRANSLATORS: HSI event title */ + _("Pre-boot DMA protection is disabled")}, + {"org.fwupd.hsi.AcpiDmar", + FWUPD_SECURITY_ATTR_RESULT_NOT_ENABLED, + FWUPD_SECURITY_ATTR_RESULT_ENABLED, + /* TRANSLATORS: HSI event title */ + _("Pre-boot DMA protection is enabled")}, + /* ------------------------------------------*/ {"org.fwupd.hsi.Uefi.SecureBoot", FWUPD_SECURITY_ATTR_RESULT_ENABLED, FWUPD_SECURITY_ATTR_RESULT_NOT_ENABLED, @@ -2051,6 +2141,12 @@ FWUPD_SECURITY_ATTR_RESULT_VALID, /* TRANSLATORS: HSI event title */ _("A TPM PCR is now an invalid value")}, + /* ------------------------------------------*/ + {"org.fwupd.hsi.Tpm.ReconstructionPcr0", + FWUPD_SECURITY_ATTR_RESULT_NOT_FOUND, + FWUPD_SECURITY_ATTR_RESULT_NOT_VALID, + /* TRANSLATORS: HSI event title */ + _("TPM PCR0 reconstruction is invalid")}, {NULL, 0, 0, NULL}}; /* sanity check */ @@ -2553,3 +2649,139 @@ /* success */ return TRUE; } + +gboolean +fu_util_print_builder(JsonBuilder *builder, GError **error) +{ + g_autofree gchar *data = NULL; + g_autoptr(JsonGenerator) json_generator = NULL; + g_autoptr(JsonNode) json_root = NULL; + + /* export as a string */ + json_root = json_builder_get_root(builder); + json_generator = json_generator_new(); + json_generator_set_pretty(json_generator, TRUE); + json_generator_set_root(json_generator, json_root); + data = json_generator_to_data(json_generator, NULL); + if (data == NULL) { + g_set_error_literal(error, + FWUPD_ERROR, + FWUPD_ERROR_INTERNAL, + "Failed to convert to JSON string"); + return FALSE; + } + + /* just print */ + g_print("%s\n", data); + return TRUE; +} + +typedef enum { + FU_UTIL_DEPENDENCY_KIND_UNKNOWN, + FU_UTIL_DEPENDENCY_KIND_RUNTIME, + FU_UTIL_DEPENDENCY_KIND_COMPILE, +} FuUtilDependencyKind; + +static const gchar * +fu_util_dependency_kind_to_string(FuUtilDependencyKind dependency_kind) +{ + if (dependency_kind == FU_UTIL_DEPENDENCY_KIND_RUNTIME) + return "runtime"; + if (dependency_kind == FU_UTIL_DEPENDENCY_KIND_COMPILE) + return "compile"; + return NULL; +} + +static gchar * +fu_util_parse_project_dependency(const gchar *str, FuUtilDependencyKind *dependency_kind) +{ + g_return_val_if_fail(str != NULL, NULL); + if (g_str_has_prefix(str, "RuntimeVersion(")) { + gsize strsz = strlen(str); + if (dependency_kind != NULL) + *dependency_kind = FU_UTIL_DEPENDENCY_KIND_RUNTIME; + return g_strndup(str + 15, strsz - 16); + } + if (g_str_has_prefix(str, "CompileVersion(")) { + gsize strsz = strlen(str); + if (dependency_kind != NULL) + *dependency_kind = FU_UTIL_DEPENDENCY_KIND_COMPILE; + return g_strndup(str + 15, strsz - 16); + } + return g_strdup(str); +} + +static gboolean +fu_util_print_version_key_valid(const gchar *key) +{ + g_return_val_if_fail(key != NULL, FALSE); + if (g_str_has_prefix(key, "RuntimeVersion")) + return TRUE; + if (g_str_has_prefix(key, "CompileVersion")) + return TRUE; + return FALSE; +} + +gboolean +fu_util_project_versions_as_json(GHashTable *metadata, GError **error) +{ + GHashTableIter iter; + const gchar *key; + const gchar *value; + g_autoptr(JsonBuilder) builder = json_builder_new(); + + json_builder_begin_object(builder); + json_builder_set_member_name(builder, "Versions"); + json_builder_begin_array(builder); + g_hash_table_iter_init(&iter, metadata); + while (g_hash_table_iter_next(&iter, (gpointer *)&key, (gpointer *)&value)) { + FuUtilDependencyKind dependency_kind = FU_UTIL_DEPENDENCY_KIND_UNKNOWN; + g_autofree gchar *project = NULL; + + /* add version keys */ + if (!fu_util_print_version_key_valid(key)) + continue; + project = fu_util_parse_project_dependency(key, &dependency_kind); + json_builder_begin_object(builder); + if (dependency_kind != FU_UTIL_DEPENDENCY_KIND_UNKNOWN) { + json_builder_set_member_name(builder, "Type"); + json_builder_add_string_value( + builder, + fu_util_dependency_kind_to_string(dependency_kind)); + } + json_builder_set_member_name(builder, "AppstreamId"); + json_builder_add_string_value(builder, project); + json_builder_set_member_name(builder, "Version"); + json_builder_add_string_value(builder, value); + json_builder_end_object(builder); + } + json_builder_end_array(builder); + json_builder_end_object(builder); + return fu_util_print_builder(builder, error); +} + +gchar * +fu_util_project_versions_to_string(GHashTable *metadata) +{ + GHashTableIter iter; + const gchar *key; + const gchar *value; + g_autoptr(GString) str = g_string_new(NULL); + + g_hash_table_iter_init(&iter, metadata); + while (g_hash_table_iter_next(&iter, (gpointer *)&key, (gpointer *)&value)) { + FuUtilDependencyKind dependency_kind = FU_UTIL_DEPENDENCY_KIND_UNKNOWN; + g_autofree gchar *project = NULL; + + /* print version keys */ + if (!fu_util_print_version_key_valid(key)) + continue; + project = fu_util_parse_project_dependency(key, &dependency_kind); + g_string_append_printf(str, + "%-10s%-30s%s\n", + fu_util_dependency_kind_to_string(dependency_kind), + project, + value); + } + return g_string_free(g_steal_pointer(&str), FALSE); +} diff -Nru fwupd-1.7.4/src/fu-util-common.h fwupd-1.7.5/src/fu-util-common.h --- fwupd-1.7.4/src/fu-util-common.h 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/src/fu-util-common.h 2022-02-07 16:24:38.000000000 +0000 @@ -8,6 +8,7 @@ #include #include +#include #include "fwupd-security-attr-private.h" @@ -57,8 +58,6 @@ fu_util_is_interesting_device(FwupdDevice *dev); gchar * fu_util_get_user_cache_path(const gchar *fn); -gchar * -fu_util_get_versions(void); void fu_util_warning_box(const gchar *title, const gchar *body, guint width); @@ -149,3 +148,9 @@ fu_util_is_url(const gchar *perhaps_url); gboolean fu_util_setup_interactive_console(GError **error); +gboolean +fu_util_print_builder(JsonBuilder *builder, GError **error); +gchar * +fu_util_project_versions_to_string(GHashTable *metadata); +gboolean +fu_util_project_versions_as_json(GHashTable *metadata, GError **error); diff -Nru fwupd-1.7.4/src/meson.build fwupd-1.7.5/src/meson.build --- fwupd-1.7.4/src/meson.build 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/src/meson.build 2022-02-07 16:24:38.000000000 +0000 @@ -74,6 +74,7 @@ if build_daemon fwupdmgr = executable( 'fwupdmgr', + fu_hash, sources : [ 'fu-util.c', 'fu-history.c', @@ -114,6 +115,7 @@ if get_option('systemd') and get_option('offline') fwupdoffline = executable( 'fwupdoffline', + fu_hash, sources : [ 'fu-history.c', 'fu-offline.c', diff -Nru fwupd-1.7.4/src/org.freedesktop.fwupd.xml fwupd-1.7.5/src/org.freedesktop.fwupd.xml --- fwupd-1.7.4/src/org.freedesktop.fwupd.xml 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/src/org.freedesktop.fwupd.xml 2022-02-07 16:24:38.000000000 +0000 @@ -822,6 +822,17 @@ + + + + + Ask the daemon to quit. This can only be called by the root user. + + + + + + diff -Nru fwupd-1.7.4/subprojects/fwupd-efi.wrap fwupd-1.7.5/subprojects/fwupd-efi.wrap --- fwupd-1.7.4/subprojects/fwupd-efi.wrap 2022-01-13 13:09:02.000000000 +0000 +++ fwupd-1.7.5/subprojects/fwupd-efi.wrap 2022-02-07 16:24:38.000000000 +0000 @@ -1,4 +1,4 @@ [wrap-git] directory = fwupd-efi url = https://github.com/fwupd/fwupd-efi -revision = 1.1 +revision = 1.2