aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2023-04-10 19:01:35 +0200
committerDaniel Golle <daniel@makrotopia.org>2023-04-11 13:42:47 +0100
commitc798adad6b439e5144a67884c67f9f56acc5cf4c (patch)
tree73583047a486093a2bc8232e5dc193181b76ab14 /package/base-files
parentff91a12c8db4e09105d06448a8114bd52ae17425 (diff)
downloadupstream-c798adad6b439e5144a67884c67f9f56acc5cf4c.tar.gz
upstream-c798adad6b439e5144a67884c67f9f56acc5cf4c.tar.bz2
upstream-c798adad6b439e5144a67884c67f9f56acc5cf4c.zip
base-files: fix nand_upgrade_ubinized()
When using "ubiformat" with stdin it requires passing image size using the -S argument. Provide it just like we do for "ubiupdatevol". This fixes: ubiformat: error!: must use '-S' with non-zero value when reading from stdin This change fixes sysupgrade for bcm53xx and bcm4908 NAND devices possibly some other targets too. Cc: Rodrigo Balerdi <lanchon@gmail.com> Cc: Daniel Golle <daniel@makrotopia.org> Fixes: 971071212052 ("base-files: accept gzipped nand sysupgrade images") Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Acked-by: Daniel Golle <daniel@makrotopia.org> Tested-by: Koen Vandeputte <koen.vandeputte@citymesh.com>
Diffstat (limited to 'package/base-files')
-rw-r--r--package/base-files/files/lib/upgrade/nand.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh
index 907945b349..fa29d575a8 100644
--- a/package/base-files/files/lib/upgrade/nand.sh
+++ b/package/base-files/files/lib/upgrade/nand.sh
@@ -261,10 +261,12 @@ nand_upgrade_ubinized() {
local ubi_file="$1"
local gz="$2"
+ local ubi_length=$( (${gz}cat "$ubi_file" | wc -c) 2> /dev/null)
+
nand_detach_ubi "$CI_UBIPART" || return 1
local mtdnum="$( find_mtd_index "$CI_UBIPART" )"
- ${gz}cat "$ubi_file" | ubiformat "/dev/mtd$mtdnum" -y -f - && ubiattach -m "$mtdnum"
+ ${gz}cat "$ubi_file" | ubiformat "/dev/mtd$mtdnum" -S "$ubi_length" -y -f - && ubiattach -m "$mtdnum"
}
# Write the UBIFS image to UBI rootfs volume