From 2c94291af8f37f56029b59ca14f588038b982e0c Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sun, 16 Jan 2022 00:26:46 +0100 Subject: [PATCH] Kobo: Fix the upgrade progress bar on sunxi Merges are extremely broken outside of REAGL/REAGLD on recent kernels, while things appear to mostly behave with REAGL, so, use that... (AUTO was a bad call on sunxi anyway) --- platform/kobo/koreader.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/platform/kobo/koreader.sh b/platform/kobo/koreader.sh index 0d1ebd201..a9611f911 100755 --- a/platform/kobo/koreader.sh +++ b/platform/kobo/koreader.sh @@ -96,7 +96,15 @@ ko_update_check() { # Setup the FBInk daemon export FBINK_NAMED_PIPE="/tmp/koreader.fbink" rm -f "${FBINK_NAMED_PIPE}" - FBINK_PID="$(./fbink --daemon 1 %KOREADER% -q -y -6 -P 0)" + # We'll want to use REAGL on sunxi, because AUTO is slow, and fast merges are extremely broken outside of REAGL... + eval "$(fbink -e | tr ';' '\n' | grep -e isSunxi | tr '\n' ';')" + # shellcheck disable=SC2154 + if [ "${isSunxi}" = "1" ]; then + PBAR_WFM="REAGL" + else + PBAR_WFM="AUTO" + fi + FBINK_PID="$(./fbink --daemon 1 %KOREADER% -q -y -6 -P 0 -W ${PBAR_WFM})" # NOTE: See frontend/ui/otamanager.lua for a few more details on how we squeeze a percentage out of tar's checkpoint feature # NOTE: %B should always be 512 in our case, so let stat do part of the maths for us instead of using %s ;). FILESIZE="$(stat -c %b "${NEWUPDATE}")"