mirror of
https://github.com/raspberrypi/rpi-eeprom.git
synced 2026-01-21 06:13:33 +08:00
rpi-eeprom-update: Improve version selection for VL805
Deprecate the vl805.latest file and compare version numbers. This ensures that the rpi-eeprom-update will never downgrade the VL805.
This commit is contained in:
@@ -435,19 +435,17 @@ getVL805CurrentVersion()
|
|||||||
|
|
||||||
getVL805UpdateVersion()
|
getVL805UpdateVersion()
|
||||||
{
|
{
|
||||||
# The latest VL805 version is indicated by a file containing the version
|
# The VL805 version number is an eight character hex string. Select the
|
||||||
# number. If the version file exists then verify that the corresponding
|
# largest number for the newest version.
|
||||||
# VL805 binary exists before selecting it.
|
# The vl805.latest version is retained for backwards compatibility with
|
||||||
# There are no user modifiable sections in the VL805 firmware and there
|
# thirdparty scripts (are there any?) but it not used by this script and
|
||||||
# are unlikely to be many updates to it so just indicate the latest supported
|
# is deprecated.
|
||||||
# version. This also avoids making any assumptions about the VLI version numbers.
|
|
||||||
VL805_UPDATE_VERSION=""
|
VL805_UPDATE_VERSION=""
|
||||||
if [ -f "${FIRMWARE_IMAGE_DIR}/vl805.latest" ]; then
|
match='.*/vl805-.*.bin'
|
||||||
ver="$(cat "${FIRMWARE_IMAGE_DIR}/vl805.latest")"
|
ver=$(find "${FIRMWARE_IMAGE_DIR}" -maxdepth 1 -type f -regex "${match}" | sed 's/.*\/vl805-\([0-9a-f]*\)\.bin/\1/' | sort -r | head -n1)
|
||||||
if [ -f "${FIRMWARE_IMAGE_DIR}/vl805-${ver}.bin" ]; then
|
if [ -f "${FIRMWARE_IMAGE_DIR}/vl805-${ver}.bin" ]; then
|
||||||
VL805_UPDATE_VERSION="${ver}"
|
VL805_UPDATE_VERSION="${ver}"
|
||||||
VL805_UPDATE_IMAGE="${FIRMWARE_IMAGE_DIR}/vl805-${ver}.bin"
|
VL805_UPDATE_IMAGE="${FIRMWARE_IMAGE_DIR}/vl805-${ver}.bin"
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -468,7 +466,7 @@ lookupVersionInfo()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${VL805_CURRENT_VERSION}" ] && [ -n "${VL805_UPDATE_VERSION}" ]; then
|
if [ -n "${VL805_CURRENT_VERSION}" ] && [ -n "${VL805_UPDATE_VERSION}" ]; then
|
||||||
if [ "${VL805_CURRENT_VERSION}" != "${VL805_UPDATE_VERSION}" ]; then
|
if [ "${VL805_CURRENT_VERSION}" \< "${VL805_UPDATE_VERSION}" ]; then
|
||||||
ACTION_UPDATE_VL805=1
|
ACTION_UPDATE_VL805=1
|
||||||
else
|
else
|
||||||
VL805_UPDATE_IMAGE=""
|
VL805_UPDATE_IMAGE=""
|
||||||
|
|||||||
Reference in New Issue
Block a user