Skip to content

Commit d642c79

Browse files
authored
Merge pull request #298 from vianpl/no-binutils
rpi-eeprom-update: Use 'tr' instead of 'strings'
2 parents 0294cde + b760758 commit d642c79

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rpi-eeprom-update

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ getBootloaderConfig() {
113113
local blconfig_nvmem_path=""
114114

115115
if [ -f "${blconfig_alias}" ]; then
116-
local blconfig_ofnode_path="/sys/firmware/devicetree/base"$(strings "${blconfig_alias}")""
116+
local blconfig_ofnode_path="/sys/firmware/devicetree/base"$(tr -cd [:print:] < "${blconfig_alias}")""
117117
local blconfig_ofnode_link=$(find -L /sys/bus/nvmem -samefile "${blconfig_ofnode_path}" 2>/dev/null)
118118

119119
if [ -e "${blconfig_ofnode_link}" ]; then
@@ -288,7 +288,7 @@ getBootloaderUpdateVersion() {
288288
match=".*/pieeprom-[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9].bin"
289289
latest="$(find "${FIRMWARE_IMAGE_DIR}/" -maxdepth 1 -type f -size "${EEPROM_SIZE}c" -regex "${match}" | sort -r | head -n1)"
290290
if [ -f "${latest}" ]; then
291-
BOOTLOADER_UPDATE_VERSION=$(strings "${latest}" | grep BUILD_TIMESTAMP | sed 's/.*=//g')
291+
BOOTLOADER_UPDATE_VERSION=$(tr -c [:print:] "\n" < "${latest}" | sed '/^BUILD_TIMESTAMP=/s/.*=//p;d')
292292
BOOTLOADER_UPDATE_IMAGE="${latest}"
293293
fi
294294
}

0 commit comments

Comments
 (0)