From: Michael Tremer Date: Tue, 27 Aug 2019 16:53:16 +0000 (+0000) Subject: PC Engines: Force flashing for APUs with very old firmware X-Git-Tag: 20200107~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f0b75171a6a440d55b8bf24fb1bf7853ca10e58c;p=people%2Fms%2Ffirmware-update.git PC Engines: Force flashing for APUs with very old firmware This is necessary to force flashrom to overwrite the firmware even when the BIOS identifies as "APU*" (uppercase), but we expect it to be "apu*" (lowercase). Fixes: #12143 Signed-off-by: Michael Tremer --- diff --git a/src/firmware-update.in b/src/firmware-update.in index 614c3ca..6c681b5 100644 --- a/src/firmware-update.in +++ b/src/firmware-update.in @@ -156,6 +156,17 @@ update_pcengines_apu() { local running_version="${2}" shift 2 + local programmer="internal" + + while [ $# -gt 0 ]; do + case "${1}" in + --allow-boardmismatch) + programmer="internal:boardmismatch=force" + ;; + esac + shift + done + # Find a new firmware file local firmware="$(find_firmware "pcengines/apu/${board}_*.rom")" if [ -z "${firmware}" ]; then @@ -178,7 +189,7 @@ update_pcengines_apu() { # Perform update if get_consent "${firmware}"; then - do_flashrom -p "internal" -w "${firmware}" + do_flashrom -p "${programmer}" -w "${firmware}" fi } @@ -196,8 +207,12 @@ do_update() { echo "Detected ${vendor} ${board} running BIOS version ${bios_version}" case "${vendor},${board}" in + "PC Engines",APU*) + update_pcengines_apu "${board,,}" "${bios_version}" --allow-boardmismatch + ;; + "PC Engines",apu*) - update_pcengines_apu "${board}" "${bios_version}" "$@" + update_pcengines_apu "${board}" "${bios_version}" ;; *)