bcm4908: fix calculation of new cferam index
[openwrt/staging/hauke.git] / target / linux / bcm4908 / base-files / lib / upgrade / platform.sh
index 8aca7119e480cb8d5b2b057e7db24e637a0cd43e..ee43e3a713eb835ae85d9ee1dfea69a0d953cdbe 100644 (file)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
 
-RAMFS_COPY_BIN="bcm4908img"
+RAMFS_COPY_BIN="bcm4908img expr"
 
 PART_NAME=firmware
 
@@ -129,7 +129,7 @@ platform_calc_new_cferam() {
        umount $dir
        rm -fr $dir
 
-       idx=$(((idx + inc) % 1000))
+       idx=$(($(expr $idx + $inc) % 1000))
 
        echo $(printf "cferam.%03d" $idx)
 }