rpi-eeprom-update: Add trailing / so find follows the FW symlink

This commit is contained in:
Tim Gover
2021-01-12 16:44:31 +00:00
parent 4b17575e83
commit 690872a3ca

View File

@@ -296,7 +296,7 @@ BOOTLOADER_UPDATE_VERSION=0
getBootloaderUpdateVersion() { getBootloaderUpdateVersion() {
BOOTLOADER_UPDATE_VERSION=0 BOOTLOADER_UPDATE_VERSION=0
match=".*/pieeprom-[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9].bin" match=".*/pieeprom-[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9].bin"
latest="$(find "${FIRMWARE_IMAGE_DIR}" -maxdepth 1 -type f -size "${EEPROM_SIZE}c" -regex "${match}" | sort -r | head -n1)" latest="$(find "${FIRMWARE_IMAGE_DIR}/" -maxdepth 1 -type f -size "${EEPROM_SIZE}c" -regex "${match}" | sort -r | head -n1)"
if [ -f "${latest}" ]; then if [ -f "${latest}" ]; then
BOOTLOADER_UPDATE_VERSION=$(strings "${latest}" | grep BUILD_TIMESTAMP | sed 's/.*=//g') BOOTLOADER_UPDATE_VERSION=$(strings "${latest}" | grep BUILD_TIMESTAMP | sed 's/.*=//g')
BOOTLOADER_UPDATE_IMAGE="${latest}" BOOTLOADER_UPDATE_IMAGE="${latest}"
@@ -345,13 +345,13 @@ checkDependencies() {
fi fi
fi fi
if [ ! -d "${FIRMWARE_IMAGE_DIR}" ]; then if [ ! -e "${FIRMWARE_IMAGE_DIR}" ]; then
die "EEPROM updates directory ${FIRMWARE_IMAGE_DIR} not found." die "EEPROM updates directory ${FIRMWARE_IMAGE_DIR} not found."
fi fi
# If a board revision specific firmware directory is defined then use that # If a board revision specific firmware directory is defined then use that
# in preference to the generic directory. # in preference to the generic directory.
if [ -d "${FIRMWARE_IMAGE_DIR}-${BOARD_INFO}" ]; then if [ -e "${FIRMWARE_IMAGE_DIR}-${BOARD_INFO}" ]; then
FIRMWARE_IMAGE_DIR="${FIRMWARE_IMAGE_DIR}-${BOARD_INFO}" FIRMWARE_IMAGE_DIR="${FIRMWARE_IMAGE_DIR}-${BOARD_INFO}"
fi fi