raspberrypi-eeprom/rpi-eeprom-update-Use-tr-instead-of-strings.patch
Guillaume GARDET 719770a59e Accepting request 1060302 from home:tobijk:hardware:boot
- Packaging changes:
  * Compress archive to tar.xz to save space (~43M -> ~3.4M)
  * Refresh rpi-eeprom-update-Use-tr-instead-of-strings.patch
- 2023-01-11-vl805-000138c0:
- Interesting changes since the last release:-
  * Update VL805 to 138C0 - fix for handling of split transactions
    raspberrypi/linux#5262
  * Fix HID error handling with network install #458
- 2022-11-25-vl805-000138a1:
- Interesting changes since the last release:-
  * Add [tryboot] conditional statement to autoboot.txt + tryboot_a_b mode
  * Support custom OTP mac addresses
  * Increase TFTP_MAX_BLOCK_SIZE
  * Stop NVMe cleanly
  * Fixes for NETCONSOLE parsing and initialisation.
  * Long filename support for start_file / fixup_file.
  * Secure boot and display debug info on the diagnostics screen.
- 2022-04-26-vl805-000138a1:
- Interesting changes since the last default release:
  * Implement network install
  * Add support for BOOT_ORDER_HTTP
  * Enable the boot partition number to be specified as an EEPROM config
    property.

OBS-URL: https://build.opensuse.org/request/show/1060302
OBS-URL: https://build.opensuse.org/package/show/hardware:boot/raspberrypi-eeprom?expand=0&rev=21
2023-01-23 12:25:27 +00:00

47 lines
2.0 KiB
Diff

From b760758c5eee3ff26d6705491ed3630f3079fff6 Mon Sep 17 00:00:00 2001
From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Date: Thu, 18 Feb 2021 17:49:46 +0100
Subject: [PATCH] rpi-eeprom-update: Use 'tr' instead of 'strings'
The 'strings' utility is installed by binutils whereas 'tr' belongs with
coreutils. Minimal systems will only contain the latter, due to binutils'
size (20-50 MB). So, convert all uses of 'strings' to 'tr' so as to
avoid the package dependency.
The second 'tr' usage converts non-ASCII characters into newlines so as
to isolate the "BUILD_TIMESTAMP=1234567890" statement (similar to what
'strings' does). There is no need for this in the first one: non-ASCII
characters are simply discarded as DT aliases have a fixed one line
format.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
rpi-eeprom-update | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rpi-eeprom-update b/rpi-eeprom-update
index 332d39c..e4df232 100755
--- a/rpi-eeprom-update
+++ b/rpi-eeprom-update
@@ -113,7 +113,7 @@ getBootloaderConfig() {
local blconfig_nvmem_path=""
if [ -f "${blconfig_alias}" ]; then
- local blconfig_ofnode_path="/sys/firmware/devicetree/base"$(strings "${blconfig_alias}")""
+ local blconfig_ofnode_path="/sys/firmware/devicetree/base"$(tr -cd [:print:] < "${blconfig_alias}")""
local blconfig_ofnode_link=$(find -L /sys/bus/nvmem -maxdepth 3 -samefile "${blconfig_ofnode_path}" 2>/dev/null)
if [ -e "${blconfig_ofnode_link}" ]; then
@@ -288,7 +288,7 @@ getBootloaderUpdateVersion() {
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)"
if [ -f "${latest}" ]; then
- BOOTLOADER_UPDATE_VERSION=$(strings "${latest}" | grep BUILD_TIMESTAMP | sed 's/.*=//g')
+ BOOTLOADER_UPDATE_VERSION=$(tr -c [:print:] "\n" < "${latest}" | sed '/^BUILD_TIMESTAMP=/s/.*=//p;d')
BOOTLOADER_UPDATE_IMAGE="${latest}"
fi
}
--
2.30.1