summaryrefslogtreecommitdiff
path: root/recipes/images/files/library/imx6/update.sh
diff options
context:
space:
mode:
authorMax Krummenacher <max.oss.09@gmail.com>2015-10-19 17:14:29 +0200
committerMax Krummenacher <max.oss.09@gmail.com>2015-10-28 09:31:27 +0100
commit4c49bd46708dd552d6471e24657ebcbf1c4f44bd (patch)
tree0da40493f0b5bfac226a0175b6721f816ec811d4 /recipes/images/files/library/imx6/update.sh
parent878f19253370e3d11f1e877bfb83f65db4315f5b (diff)
flash_eth: provide option to split output file
To flash a large rootfs over tftp the rootfs must be split into chunks of 64MB on the tftp server. Add the option '-c' to the update.sh script which does this automatically. Use 64MB chunks on all module types.
Diffstat (limited to 'recipes/images/files/library/imx6/update.sh')
-rwxr-xr-xrecipes/images/files/library/imx6/update.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/recipes/images/files/library/imx6/update.sh b/recipes/images/files/library/imx6/update.sh
index 9739457..f6b832d 100755
--- a/recipes/images/files/library/imx6/update.sh
+++ b/recipes/images/files/library/imx6/update.sh
@@ -51,6 +51,7 @@ Usage()
echo "Will require a running U-Boot on the target. Either one already flashed"
echo "on the eMMC or one copied over usb into the module's RAM"
echo ""
+ echo "-c : split the resulting rootfs into chunks usable for tftp transmission"
echo "-d : use USB connection to copy and execute U-Boot to the module's RAM"
echo "-h : prints this message"
echo "-o directory : output directory"
@@ -65,13 +66,16 @@ Usage()
MIN_PARTITION_FREE_SIZE=100
OUT_DIR=""
ROOTFSPATH=rootfs
+SPLIT=0
UBOOT_RECOVERY=0
# No devicetree by default
KERNEL_DEVICETREE=""
KERNEL_IMAGETYPE="uImage"
-while getopts "dho:" Option ; do
+while getopts "cdho:" Option ; do
case $Option in
+ c) SPLIT=1
+ ;;
d) UBOOT_RECOVERY=1
;;
h) Usage
@@ -267,6 +271,9 @@ sudo $LOCPATH/genext3fs.sh -d rootfs -b ${EXT_SIZE} ${BINARIES}/${IMAGEFILE} ||
#copy to $OUT_DIR
sudo cp ${BINARIES}/${U_BOOT_BINARY} ${BINARIES}/${U_BOOT_BINARY_IT} ${BINARIES}/uImage ${BINARIES}/mbr.bin ${BINARIES}/boot.vfat \
${BINARIES}/${IMAGEFILE} ${BINARIES}/flash*.img ${BINARIES}/versions.txt "$OUT_DIR"
+if [ "$SPLIT" -ge 1 ] ; then
+sudo split -a 2 -b `expr 64 \* 1024 \* 1024` --numeric-suffixes=10 "$OUT_DIR/root.ext3" "$OUT_DIR/root.ext3-"
+fi
sync
Flash