Every attempt to update a device with NOR flash
and RouterBOOT v6 resulted in the error:
“RouterBOOT 6 and earlier requires ELF-in-YAFFS image.”
The cause was that xargs did not fully remove whitespace,
so the condition "$bootentry" != "kernel" always evaluated to true.
Signed-off-by: Marcin Maj <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/21034
Signed-off-by: Robert Marko <[email protected]>
platform_check_image_mikrotik_nor() {
local bootfwver bootfwmajor
- local bootentry="$(dd bs=10 skip=1 count=1 if="$1" 2>/dev/null | xargs -0)"
+ local bootentry="$(dd bs=10 skip=1 count=1 if="$1" 2>/dev/null | xargs)"
read -r bootfwver < /sys/firmware/mikrotik/hard_config/booter_version
bootfwmajor="${bootfwver%%.*}"