Support tolino fw >=5.18 (#15759)
Kobo/Tolino firmware 5.18 uses a binary hwdetect. Also, we have to kill speech-dispatcher in order to restart nickel. Fixes #15747
This commit is contained in:
1 parent
607c47cf3c
commit
574fe9f6ef
4 files changed
+45
-4
No files matched your search
+1
-1
@@ -12,7 +12,7 @@ local function probeDevice()
|
||||
return require("device/kindle/device")
|
||||
end
|
||||
|
||||
local kobo_test_stat = lfs.attributes("/bin/kobo_config.sh") or lfs.attributes("/usr/bin/hwdetect.sh")
|
||||
local kobo_test_stat = lfs.attributes("/bin/kobo_config.sh") or lfs.attributes("/usr/bin/hwdetect.sh") or lfs.attributes("/usr/bin/hwdetect")
|
||||
if kobo_test_stat then
|
||||
return require("device/kobo/device")
|
||||
end
|
||||
|
||||
@@ -987,7 +987,7 @@ function Kobo:otaModel()
|
||||
local model = "kobo"
|
||||
-- Switch to the proper packages on FW 5.x
|
||||
-- NOTE: We don't distribute kobov4 binaries, the omission is on purpose.
|
||||
if util.fileExists("/usr/bin/hwdetect.sh") then
|
||||
if util.fileExists("/usr/bin/hwdetect.sh") or util.fileExists("/usr/bin/hwdetect") then
|
||||
model = "kobov5"
|
||||
end
|
||||
return model, "ota"
|
||||
@@ -1174,6 +1174,26 @@ local function getCodeName()
|
||||
std_out:close()
|
||||
end
|
||||
end
|
||||
-- If that fails, try binary hwdetect (since firmware 5.18)
|
||||
if not codename then
|
||||
local std_out_device = io.popen("/usr/bin/hwdetect device-name", "re")
|
||||
local std_out_branding = io.popen("/usr/bin/hwdetect branding", "re")
|
||||
local std_out_screen = io.popen("/usr/bin/hwdetect screen-variant", "re")
|
||||
if std_out_device and std_out_branding and std_out_screen then
|
||||
local device = std_out_device:read("*line")
|
||||
local branding = std_out_branding:read("*line")
|
||||
local screen = std_out_screen:read("*line")
|
||||
local branding_first = string.sub(branding, 1, 1)
|
||||
local branding_rest = string.sub(branding, 2)
|
||||
|
||||
branding = string.upper(branding_first) .. branding_rest
|
||||
codename = device .. branding .. screen
|
||||
|
||||
std_out_device:close()
|
||||
std_out_branding:close()
|
||||
std_out_screen:close()
|
||||
end
|
||||
end
|
||||
return codename
|
||||
end
|
||||
|
||||
|
||||
@@ -250,7 +250,16 @@ if [ -z "${PRODUCT}" ]; then
|
||||
fi
|
||||
|
||||
if [ -z "${PRODUCT}" ]; then
|
||||
PRODUCT="$(/usr/bin/hwdetect.sh 2>/dev/null)"
|
||||
# FW >= 5.18 uses a binary hwdetect instead of the hwdetect.sh script. If hwdetect is available, we can use
|
||||
# utils.sh for convenience.
|
||||
if [ -e "/usr/bin/hwdetect" ]; then
|
||||
# shellcheck disable=SC1091
|
||||
. /usr/libexec/platform/utils.sh
|
||||
PRODUCT="$(get_product_name)"
|
||||
else
|
||||
PRODUCT="$(/usr/bin/hwdetect.sh 2>/dev/null)"
|
||||
fi
|
||||
|
||||
export PRODUCT
|
||||
fi
|
||||
|
||||
|
||||
+13
-1
@@ -20,7 +20,16 @@ unset FBINK_FORCE_ROTA
|
||||
|
||||
# kobo v5 animation is originally done in display-init, we copy the neccessary parts here.
|
||||
if [ -e "/etc/init.d/display-init.sh" ]; then
|
||||
PRODUCT=$(hwdetect.sh)
|
||||
# FW >= 5.18 uses a binary hwdetect instead of the hwdetect.sh script. If hwdetect is available, we can use
|
||||
# utils.sh for convenience.
|
||||
if [ -e "/usr/bin/hwdetect" ]; then
|
||||
# shellcheck disable=SC1091
|
||||
. /usr/libexec/platform/utils.sh
|
||||
PRODUCT="$(get_product_name)"
|
||||
else
|
||||
PRODUCT=$(hwdetect.sh)
|
||||
fi
|
||||
|
||||
export PRODUCT
|
||||
echo "Starting boot animation..."
|
||||
animator.sh /etc/images/"${PRODUCT}"-on-*.raw.gz &
|
||||
@@ -145,6 +154,9 @@ if [ -e "/etc/init.d/z-nickel-hardware-status" ]; then
|
||||
if grep "pulseaudio" "/etc/rc.local"; then
|
||||
killall pulseaudio
|
||||
fi
|
||||
if grep "speech-dispatcher" "/etc/rc.local"; then
|
||||
killall speech-dispatcher
|
||||
fi
|
||||
/etc/init.d/z-nickel-hardware-status
|
||||
sync
|
||||
/etc/rc.local
|
||||
|
||||
Reference in new issue
Block a user