diff --git a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh index 1686462cde..40b2ef67be 100644 --- a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh @@ -1,4 +1,4 @@ -RAMFS_COPY_BIN='osafeloader oseama otrx' +RAMFS_COPY_BIN='osafeloader oseama otrx truncate' PART_NAME=firmware @@ -281,7 +281,7 @@ platform_do_upgrade_nand_trx() { while [ "$(dd if=$dir/root skip=$ubi_length bs=1 count=4 2>/dev/null)" = "UBI#" ]; do ubi_length=$(($ubi_length + 131072)) done - dd if=$dir/root of=/tmp/root.ubi bs=131072 count=$((ubi_length / 131072)) 2>/dev/null + truncate -s $ubi_length $dir/root [ $? -ne 0 ] && { echo "Failed to prepare new UBI image." return @@ -289,7 +289,7 @@ platform_do_upgrade_nand_trx() { # Flash mtd write /tmp/kernel.trx firmware || exit 1 - nand_do_upgrade /tmp/root.ubi + nand_do_upgrade $dir/root } platform_do_upgrade_nand_seama() {