summaryrefslogtreecommitdiff
path: root/recipes-images
diff options
context:
space:
mode:
authorSanchayan Maity <maitysanchayan@gmail.com>2016-12-01 12:15:33 +0530
committerStefan Agner <stefan.agner@toradex.com>2017-01-10 16:17:43 -0800
commit384d2cde13bd344dacfde6c8e771593de2b38d23 (patch)
tree089bc4594ca4f810b7b7d098e741c5753be38f45 /recipes-images
parent119ce7c0724fff64c331fe6b1c94403a0d885b62 (diff)
images: Remove rootfs size limitation of 4GB with update scripts
Our current update procedure requires the rootfs payload to fit in one file on a FAT filesystem. This limits its usable size to 4GB. Use the process of splitting up the files in 64MB chunks and then doing the update which is also what the Ethernet update scripts currently follow. However due to the workaround for u-boot counting in hex and split did in decimal, the number of chunks is limited to 89 resulting in a maximum size of 5.5GB. We will remove the limitation in a follow up patch. Signed-off-by: Sanchayan Maity <sanchayan.maity@toradex.com> Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Diffstat (limited to 'recipes-images')
-rw-r--r--recipes-images/images/files/apalis-t30/apalis-t30_bin/flash_blk.scr8
-rw-r--r--recipes-images/images/files/apalis-tk1/apalis-tk1_bin/flash_blk.scr8
-rw-r--r--recipes-images/images/files/colibri-t30/colibri-t30_bin/flash_blk.scr8
-rw-r--r--recipes-images/images/files/library/imx6/flash_blk.scr8
-rwxr-xr-xrecipes-images/images/files/library/imx6/update.sh7
-rwxr-xr-xrecipes-images/images/files/library/tegra/update.sh7
6 files changed, 24 insertions, 22 deletions
diff --git a/recipes-images/images/files/apalis-t30/apalis-t30_bin/flash_blk.scr b/recipes-images/images/files/apalis-t30/apalis-t30_bin/flash_blk.scr
index 44d98a2..d3ac2be 100644
--- a/recipes-images/images/files/apalis-t30/apalis-t30_bin/flash_blk.scr
+++ b/recipes-images/images/files/apalis-t30/apalis-t30_bin/flash_blk.scr
@@ -2,7 +2,9 @@ test -n ${interface} || setenv interface mmc
test -n ${drive} || setenv drive 1
setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200'
-setenv set_nextpos 'setexpr filepos ${filepos} + ${filesize}; setexpr blkstart ${blkstart} + ${blkcnt}'
+#workaround U-Boot counting in hex and split did in decimal
+setenv incr_decimal 'setexpr filenum ${filenum} + 1; setexpr filenrlow ${filenum} % 0x10; test ${filenrlow} -eq "a" && setexpr filenum ${filenum} + 0x6; true'
+setenv set_nextnum 'run incr_decimal; setexpr blkstart ${blkstart} + ${blkcnt}'
setenv check_1 'setenv conf_blk_offset 0x1fff; mmc read ${loadaddr} ${conf_blk_offset} 1'
setenv check_2 'setenv conf_blk_offset 0xfff; mmc read ${loadaddr} ${conf_blk_offset} 1'
@@ -17,7 +19,7 @@ setenv migrate_5 'mmc dev 0 0; mmc read ${loadaddr} 36000 1; setenv conf_blk_off
setenv migrate_6 'mmc dev 0 0; mmc read ${loadaddr} 37000 1; setenv conf_blk_offset 0x7ff; crc32 -v ${toradex_oui_addr} 3 94305232 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1'
setenv migrate_configblock 'setexpr toradex_oui_addr ${loadaddr} + 8; run migrate_1; run migrate_2; run migrate_3; run migrate_4; run migrate_5; run migrate_6'
-setenv cp_file_chunk 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/root.ext3 ${filesize} ${filepos}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}'
+setenv cp_file_chunk 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/root.ext3-${filenum} ${filesize} ${filepos}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}'
setenv update_uboot 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/${board_name}.img && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 0x0 ${blkcnt}'
@@ -30,7 +32,7 @@ setenv update_configblock 'run check_configblock; load ${interface} ${drive}:1 $
setenv update_1 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1'
setenv update_2 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/boot.vfat && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 0x2000 ${blkcnt}'
#do it in chunks of 64M to fit into DDR RAM of the smallest module
-setenv update_3 'setenv filesize 4000000; setenv filepos 0; setenv blkstart a000; while test ${filesize} -eq "4000000"; do run cp_file_chunk; run set_nextpos; done'
+setenv update_3 'setenv filesize 4000000; setenv filenum 10; setenv blkstart a000; while test ${filesize} -eq "4000000"; do run cp_file_chunk; run set_nextnum; done'
setenv echo_v2.3b2 echo "successfully updated U-Boot, power-cycle and enter \"run setupdate\; run migrate_v2.3b2\" to complete update"
setenv migrate_v2.3b2 'run migrate_configblock; run update_new'
diff --git a/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/flash_blk.scr b/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/flash_blk.scr
index 994e480..b95b0d3 100644
--- a/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/flash_blk.scr
+++ b/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/flash_blk.scr
@@ -2,14 +2,16 @@ test -n ${interface} || setenv interface mmc
test -n ${drive} || setenv drive 1
setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200'
-setenv set_nextpos 'setexpr filepos ${filepos} + ${filesize}; setexpr blkstart ${blkstart} + ${blkcnt}'
+#workaround U-Boot counting in hex and split did in decimal
+setenv incr_decimal 'setexpr filenum ${filenum} + 1; setexpr filenrlow ${filenum} % 0x10; test ${filenrlow} -eq "a" && setexpr filenum ${filenum} + 0x6; true'
+setenv set_nextnum 'run incr_decimal; setexpr blkstart ${blkstart} + ${blkcnt}'
setenv check_1 'setenv conf_blk_offset 0x1fff; mmc read ${loadaddr} ${conf_blk_offset} 1'
setenv check_2 'setenv conf_blk_offset 0xfff; mmc read ${loadaddr} ${conf_blk_offset} 1'
setenv check_3 'setenv conf_blk_offset 0x7ff; mmc read ${loadaddr} ${conf_blk_offset} 1'
setenv check_configblock 'setexpr toradex_oui_addr ${loadaddr} + 8; mmc dev 0 1; run check_1 || run check_2 || run check_3; crc32 -v ${toradex_oui_addr} 3 94305232'
-setenv cp_file_chunk 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/root.ext3 ${filesize} ${filepos}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}'
+setenv cp_file_chunk 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/root.ext3-${filenum} ${filesize} ${filepos}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}'
setenv update_uboot 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/${board_name}.img && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 0x0 ${blkcnt}'
@@ -22,7 +24,7 @@ setenv update_configblock 'run check_configblock; load ${interface} ${drive}:1 $
setenv update_1 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1'
setenv update_2 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/boot.vfat && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 0x2000 ${blkcnt}'
#do it in chunks of 64M to fit into DDR RAM of the smallest module
-setenv update_rootfs 'setenv filesize 4000000; setenv filepos 0; setenv blkstart a000; while test ${filesize} -eq "4000000"; do run cp_file_chunk; run set_nextpos; done'
+setenv update_rootfs 'setenv filesize 4000000; setenv filenum 10; setenv blkstart a000; while test ${filesize} -eq "4000000"; do run cp_file_chunk; run set_nextnum; done'
setenv update 'run update_uboot; run update_1; run update_2; run update_kernel; run update_fdt; run update_rootfs; reset'
diff --git a/recipes-images/images/files/colibri-t30/colibri-t30_bin/flash_blk.scr b/recipes-images/images/files/colibri-t30/colibri-t30_bin/flash_blk.scr
index 02a920a..17a1ea0 100644
--- a/recipes-images/images/files/colibri-t30/colibri-t30_bin/flash_blk.scr
+++ b/recipes-images/images/files/colibri-t30/colibri-t30_bin/flash_blk.scr
@@ -2,7 +2,9 @@ test -n ${interface} || setenv interface mmc
test -n ${drive} || setenv drive 1
setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200'
-setenv set_nextpos 'setexpr filepos ${filepos} + ${filesize}; setexpr blkstart ${blkstart} + ${blkcnt}'
+#workaround U-Boot counting in hex and split did in decimal
+setenv incr_decimal 'setexpr filenum ${filenum} + 1; setexpr filenrlow ${filenum} % 0x10; test ${filenrlow} -eq "a" && setexpr filenum ${filenum} + 0x6; true'
+setenv set_nextnum 'run incr_decimal; setexpr blkstart ${blkstart} + ${blkcnt}'
setenv check_1 'setenv conf_blk_offset 0x1fff; mmc read ${loadaddr} ${conf_blk_offset} 1'
setenv check_2 'setenv conf_blk_offset 0xfff; mmc read ${loadaddr} ${conf_blk_offset} 1'
@@ -17,7 +19,7 @@ setenv migrate_5 'mmc dev 0 0; mmc read ${loadaddr} 36000 1; setenv conf_blk_off
setenv migrate_6 'mmc dev 0 0; mmc read ${loadaddr} 37000 1; setenv conf_blk_offset 0x7ff; crc32 -v ${toradex_oui_addr} 3 94305232 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1'
setenv migrate_configblock 'setexpr toradex_oui_addr ${loadaddr} + 8; run migrate_1; run migrate_2; run migrate_3; run migrate_4; run migrate_5; run migrate_6'
-setenv cp_file_chunk 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/root.ext3 ${filesize} ${filepos}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}'
+setenv cp_file_chunk 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/root.ext3-${filenum} ${filesize} ${filepos}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}'
setenv update_uboot 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/${board_name}.img && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 0x0 ${blkcnt}'
@@ -30,7 +32,7 @@ setenv update_configblock 'run check_configblock; load ${interface} ${drive}:1 $
setenv update_1 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1'
setenv update_2 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/boot.vfat && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 0x2000 ${blkcnt}'
#do it in chunks of 64M to fit into DDR RAM of the smallest module
-setenv update_3 'setenv filesize 4000000; setenv filepos 0; setenv blkstart a000; while test ${filesize} -eq "4000000"; do run cp_file_chunk; run set_nextpos; done'
+setenv update_3 'setenv filesize 4000000; setenv filenum 10; setenv blkstart a000; while test ${filesize} -eq "4000000"; do run cp_file_chunk; run set_nextnum; done'
setenv echo_v2.3b1 echo "successfully updated U-Boot, power-cycle and enter \"run setupdate\; run migrate_v2.3b1\" to complete update"
setenv migrate_v2.3b1 'run migrate_configblock; run update_new'
diff --git a/recipes-images/images/files/library/imx6/flash_blk.scr b/recipes-images/images/files/library/imx6/flash_blk.scr
index c87a2cc..48a355f 100644
--- a/recipes-images/images/files/library/imx6/flash_blk.scr
+++ b/recipes-images/images/files/library/imx6/flash_blk.scr
@@ -3,7 +3,9 @@ test -n ${drive} || setenv drive 1
setenv uboot_hwpart 1
setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200'
-setenv set_nextpos 'setexpr filepos ${filepos} + ${filesize}; setexpr blkstart ${blkstart} + ${blkcnt}'
+#workaround U-Boot counting in hex and split did in decimal
+setenv incr_decimal 'setexpr filenum ${filenum} + 1; setexpr filenrlow ${filenum} % 0x10; test ${filenrlow} -eq "a" && setexpr filenum ${filenum} + 0x6; true'
+setenv set_nextnum 'run incr_decimal; setexpr blkstart ${blkstart} + ${blkcnt}'
setenv check_1 'setenv conf_blk_offset 0x1fff; mmc read ${loadaddr} ${conf_blk_offset} 1'
setenv check_2 'setenv conf_blk_offset 0xfff; mmc read ${loadaddr} ${conf_blk_offset} 1'
@@ -15,7 +17,7 @@ setenv migrate_configblock 'run check_configblock; mmc dev 0 0 && mmc read ${loa
setenv migrate_uboot_old 'setenv uboot_hwpart 0; run update_spl && run update_uboot_bin; setenv uboot_hwpart 1'
setenv migrate_uboot 'run update_spl && run update_uboot_bin && mmc bootbus 0 2 1 2 && mmc partconf 0 1 1 0'
-setenv cp_file_chunk 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/root.ext3 ${filesize} ${filepos}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}'
+setenv cp_file_chunk 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/root.ext3-${filenum} ${filesize} ${filepos}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}'
setenv update_spl 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/SPL && run set_blkcnt && mmc dev 0 ${uboot_hwpart} && mmc write ${loadaddr} 2 ${blkcnt}'
setenv update_uboot_bin 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/u-boot.imx-spl && run set_blkcnt && mmc dev 0 ${uboot_hwpart} && mmc write ${loadaddr} 8a ${blkcnt}'
@@ -30,7 +32,7 @@ setenv update_configblock 'run check_configblock; load ${interface} ${drive}:1 $
setenv update_1 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1'
setenv update_2 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/boot.vfat && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 0x2000 ${blkcnt}'
#do it in chunks of 64M to fit into DDR RAM of the smallest module
-setenv update_3 'setenv filesize 4000000; setenv filepos 0; setenv blkstart a000; while test ${filesize} -eq "4000000"; do run cp_file_chunk; run set_nextpos; done; true'
+setenv update_3 'setenv filesize 4000000; setenv filenum 10; setenv blkstart a000; while test ${filesize} -eq "4000000"; do run cp_file_chunk; run set_nextnum; done; true'
setenv echo_migrate echo "successfully updated U-Boot, power-cycle and enter \"run setupdate\; run migrate\" to complete update"
setenv migrate 'run migrate_configblock; run update_latest; reset'
diff --git a/recipes-images/images/files/library/imx6/update.sh b/recipes-images/images/files/library/imx6/update.sh
index a7f1a1b..6914438 100755
--- a/recipes-images/images/files/library/imx6/update.sh
+++ b/recipes-images/images/files/library/imx6/update.sh
@@ -40,7 +40,6 @@ Usage()
echo "Will require a running U-Boot on the target. Either one already flashed on the"
echo "eMMC or one copied over USB into the module's RAM"
echo ""
- echo "-c : split resulting rootfs into chunks usable for TFTP transmission"
echo "-d : use USB connection to copy/execute U-Boot to/from module's RAM"
echo "-f : flash instructions"
echo "-h : prints this message"
@@ -62,16 +61,14 @@ MIN_PARTITION_FREE_SIZE=100
MODTYPE_DETECT=0
OUT_DIR=""
ROOTFSPATH=rootfs
-SPLIT=0
+SPLIT=1
UBOOT_RECOVERY=0
U_BOOT_BINARY=u-boot.imx-spl
U_BOOT_RECOVER_BINARY=u-boot.imx
SPL_BINARY=SPL
-while getopts "cdfhm:o:" Option ; do
+while getopts "dfhm:o:" Option ; do
case $Option in
- c) SPLIT=1
- ;;
d) UBOOT_RECOVERY=1
;;
f) Flash
diff --git a/recipes-images/images/files/library/tegra/update.sh b/recipes-images/images/files/library/tegra/update.sh
index 5b4e1b8..a3ae741 100755
--- a/recipes-images/images/files/library/tegra/update.sh
+++ b/recipes-images/images/files/library/tegra/update.sh
@@ -43,7 +43,6 @@ Usage()
echo "eMMC/NAND or one copied over USB into the module's RAM"
echo ""
echo "-b : T20: selects boot device (hsmmc/nand) (default: nand)"
- echo "-c : split resulting rootfs into chunks usable for TFTP transmission"
echo "-d : use USB recovery mode to copy/execute U-Boot to/from module's RAM"
echo "-f : flash instructions"
echo "-h : prints this message"
@@ -82,19 +81,17 @@ PAGE="4KiB"
OUT_DIR=""
ROOTFSPATH=rootfs
-SPLIT=0
+SPLIT=1
UBOOT_RECOVERY=0
# don't provide working defaults which may lead to wrong HW/SW combination
MODVERSION=Add_Version_-v
RAM_SIZE=Add_RAMsize_-r
-while getopts "b:cdfhm:o:r:sv:" Option ; do
+while getopts "b:dfhm:o:r:sv:" Option ; do
case $Option in
b) BOOT_DEVICE=$OPTARG
;;
- c) SPLIT=1
- ;;
d) UBOOT_RECOVERY=1
;;
f) Flash