From 1e92ab575695cfea39221fe4ab378cb928fdea26 Mon Sep 17 00:00:00 2001 From: Marcel Ziswiler Date: Thu, 29 Oct 2015 11:13:14 +0100 Subject: update.sh: clean-up and unify update scripts Further clean-up and unify our update scripts: - Universally mention Ethernet aka TFTP, SD card and USB flash drive as possible update media. - Universally mention detailed recovery/update procedures being available on our developer website. - Universally split usage and flashing instructions (-f). - Make sure we don't exceed the 80 characters line length limit. - Fix various spelling issues. --- recipes/images/files/colibri-vf/update.sh | 70 ++++++++++++++-------------- recipes/images/files/library/imx6/update.sh | 44 +++++++++-------- recipes/images/files/library/tegra/update.sh | 47 +++++++++---------- 3 files changed, 81 insertions(+), 80 deletions(-) (limited to 'recipes') diff --git a/recipes/images/files/colibri-vf/update.sh b/recipes/images/files/colibri-vf/update.sh index 5ac77fb..02c2791 100755 --- a/recipes/images/files/colibri-vf/update.sh +++ b/recipes/images/files/colibri-vf/update.sh @@ -1,6 +1,6 @@ #! /bin/sh -# Prepare files needed for flashing a Colibri VFxx module -# and copy them into a convenient location for use from a running U-Boot +# Prepare files needed for flashing a Colibri VF50/VF61 module and +# copy them to a convenient location for using from a running U-Boot set -e @@ -9,64 +9,64 @@ ECHO=`which echo` Flash() { - echo "To flash the Colibri VFxx module a running U-Boot is required. Boot the" + echo "To flash the Colibri VF50/VF61 module a running U-Boot is required. Boot the" echo "module to the U-Boot prompt and" echo "" - echo "insert the USB flash drive or SD card and enter:" - echo "# run setupdate" + echo "insert the SD card, USB flash drive or when using TFTP connect Ethernet only" + echo "and enter:" + echo "'run setupdate'" echo "" - echo "to update all components enter:" - echo "# run update" + echo "then to update all components enter:" + echo "'run update'" echo "" echo "to update a single component enter one of:" - echo "# run update_uboot" - echo "# run update_rootfs" + echo "'run update_uboot'" + echo "'run update_rootfs'" echo "" echo "" - echo "If you don't have a working U-Boot any more, connect your PC to the module's" - echo "UART, bring the module in the serial download mode and start the update.sh" + echo "If you don't have a working U-Boot anymore, connect your PC to the module's" + echo "UART, bring the module into the serial download mode and start the update.sh" echo "script with the -d option. This will copy U-Boot into the module's RAM and" - echo "and execute it. Also bridge RTS/CTS when using the evaluation boards USB to" - echo "UART converter." - echo "Then use the following commands to get a working U-Boot." + echo "execute it. Don't forget to also bridge RTS/CTS if using an USB-to-serial" + echo "converter without handshake signals." echo "" - echo "\"./update.sh -n -d /dev/ttyUSB0\"" + echo "Then use the following command to get U-Boot running:" + echo "'./update.sh -n -d /dev/ttyUSB0'" echo "" - echo "Next, recreate the Boot Configuration Block and the Toradex Config Block" - echo "" - echo "# run setupdate" - echo "# run update_uboot" - echo "# run create_bcb" - echo "# cfgblock create" + echo "Next, recreate the Boot Configuration Block and the Toradex Config Block:" + echo "'run setupdate'" + echo "'run update_uboot'" + echo "'run create_bcb'" + echo "'cfgblock create'" } Usage() { echo "" - echo "Prepares and copies files for flashing the internal NAND of a Colibri VFxx" + echo "Prepares and copies files for flashing internal NAND of Colibri VF50/VF61" echo "" echo "The recommended way is to copy the files on a SD card or USB flash drive." echo "The script format_sd.sh may be used to format the SD card." echo "" echo "The flash step requires a running U-Boot on the target. Either one already" - echo "flashed on the NAND or download using serial downloader (argument -d)." + echo "flashed on the NAND or downloaded using serial downloader (argument -d)." echo "" - echo "-d uart_dev : use UART connection to copy and execute U-Boot from module's RAM" + echo "-d uart_dev : use UART connection to copy/execute U-Boot to/from module's RAM" echo "-f : flash instructions" - echo "-h : Prints this message" - echo "-n : Disable hardware flow control (bridge RTS/CTS!)" + echo "-h : prints this message" + echo "-n : disable hardware flow control (bridge RTS/CTS!)" echo "-o directory : output directory" echo "-s : optimise file system for 128MB NAND, increases usable space" echo " on VF50 module a little, but on VF61 uses also only 128MB" echo "" - echo "Examples:" - echo "\"./update.sh -o /media/KERNEL/\" copies the required files to SD card" + echo "Example \"./update.sh -o /media/KERNEL/\" copies the required files to SD card" echo "" - echo "*** For detailed recovery/update procedures, refer to the Release Notes ***" + echo "*** For detailed recovery/update procedures, refer to the following website: ***" + echo "http://developer.toradex.com/knowledge-base/flashing-linux-on-vybrid-modules" echo "" } -#initialise options +# initialise options UBOOT_RECOVERY=0 NORTSCTS=0 OUT_DIR="" @@ -75,22 +75,22 @@ PAGE=2KiB BLOCK=124KiB MAXLEB=8112 -while getopts "d:fnho:s" Option ; do +while getopts "d:fhno:s" Option ; do case $Option in d) UBOOT_RECOVERY=1 UARTDEV=$OPTARG ;; - n) NORTSCTS=1 + f) Flash + exit 0 ;; h) Usage # Exit if only usage (-h) was specified. - if [ $# -eq 1 ] ; then + if [ "$#" -eq 1 ] ; then exit 10 fi exit 0 ;; - f) Flash - exit 0 + n) NORTSCTS=1 ;; o) OUT_DIR=$OPTARG ;; diff --git a/recipes/images/files/library/imx6/update.sh b/recipes/images/files/library/imx6/update.sh index 5a75191..76e8f6d 100755 --- a/recipes/images/files/library/imx6/update.sh +++ b/recipes/images/files/library/imx6/update.sh @@ -19,47 +19,48 @@ fi Flash() { + echo "To flash the Apalis/Colibri iMX6 module a running U-Boot is required. Boot the" + echo "module to the U-Boot prompt and" echo "" - echo "To flash the Apalis/Colibri iMX6 module, boot the module to the U-Boot prompt and" - echo "" - echo "when using a SD-card, insert the SD-card and enter:" + echo "insert the SD card, USB flash drive or when using TFTP connect Ethernet only" + echo "and enter:" echo "'run setupdate'" echo "" - echo "when using tftp, connect Ethernet and enter:" - echo "'tftp \$loadaddr flash_eth.img ; source \$loadaddr'" - echo "" - echo "then enter to update all:" + echo "then to update all components enter:" echo "'run update' or 'run update_it'" echo "" echo "to update a single component enter one of:" echo "'run update_uboot' or 'run update_uboot_it'" echo "'run update_kernel'" + echo "'run update_rootfs'" echo "" echo "Use the version with '_it' if you have an IT module, e.g. 'Apalis iMX6Q 2GB IT'" echo "" - echo "If you don't have a working U-Boot anymore, connect your PC to the module's" - echo "USB client port, bring the module in the serial download mode and start" - echo "the update.sh script with the -d option. This will copy U-Boot into the" - echo "modules RAM and execute it." + echo "If you don't have a working U-Boot anymore, connect your PC to the module's USB" + echo "client port, bring the module in the serial download mode and start the" + echo "update.sh script with the -d option. This will copy U-Boot into the modules RAM" + echo "and execute it." } Usage() { echo "" - echo "Prepares and copies files for flashing the internal eMMC of a Apalis/Colibri iMX6" + echo "Prepares and copies files for flashing internal eMMC of Apalis/Colibri iMX6" echo "" - 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 "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 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 "-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" echo "-o directory : output directory" echo "" echo "Example \"./update.sh -o /srv/tftp/\" copies the required files to /srv/tftp/" echo "" + echo "*** For detailed recovery/update procedures, refer to the following website: ***" + echo "http://developer.toradex.com/knowledge-base/flashing-linux-on-imx6-modules" echo "" - Flash } # initialise options @@ -72,14 +73,17 @@ UBOOT_RECOVERY=0 KERNEL_DEVICETREE="" KERNEL_IMAGETYPE="uImage" -while getopts "cdho:" Option ; do +while getopts "cdfho:" Option ; do case $Option in c) SPLIT=1 ;; d) UBOOT_RECOVERY=1 ;; - h) Usage - # Exit if only usage (-h) was specfied. + f) Flash + exit 0 + ;; + h) Usage + # Exit if only usage (-h) was specified. if [ "$#" -eq 1 ] ; then exit 10 fi diff --git a/recipes/images/files/library/tegra/update.sh b/recipes/images/files/library/tegra/update.sh index c8cd865..a23f415 100755 --- a/recipes/images/files/library/tegra/update.sh +++ b/recipes/images/files/library/tegra/update.sh @@ -18,22 +18,20 @@ fi Flash() { + echo "To flash the Apalis/Colibri T20/T30 module a running U-Boot is required. Boot" + echo "the module to the U-Boot prompt and" echo "" - echo "To flash the Apalis/Colibri T20/T30 module, boot the module to the U-Boot prompt" - echo "and" + echo "insert the SD card, USB flash drive or when using TFTP connect Ethernet only" + echo "and enter:" + echo "'run setupdate'" echo "" - echo "when using a SD card, insert the SD card and enter:" - echo "run setupdate" - echo "" - echo "when using tftp, connect Ethernet and enter:" - echo "tftp \$loadaddr flash_eth.img ; source \$loadaddr" - echo "" - echo "then enter to update all:" - echo "run update" + echo "then to update all components enter:" + echo "'run update'" echo "" echo "to update a single component enter one of:" - echo "run update_uboot" - echo "run update_kernel" + echo "'run update_uboot'" + echo "'run update_kernel' (T30 only)" + echo "'run update_rootfs'" echo "" echo "" echo "If you don't have a working U-Boot anymore, connect your PC to the module's USB" @@ -45,29 +43,28 @@ Flash() Usage() { echo "" - echo "Prepares and copies files for flashing the internal eMMC/NAND of an Apalis/" + echo "Prepares and copies files for flashing internal eMMC/NAND of Apalis T30 and" echo "Colibri T20/T30" echo "" - echo "Will require a running U-Boot on the target. Either one already flashed" - echo "on the eMMC/NAND or one copied over USB into the module's RAM" + echo "Will require a running U-Boot on the target. Either one already flashed on the" + 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 the resulting rootfs into chunks usable for tftp transmission" - echo "-d : use USB recovery mode to copy/execute U-Boot to the module's RAM" + 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" - echo "-o directory : output directory, if this is on a SD card, it should be the first" - echo " partition formated with VFAT" + echo "-o directory : output directory" echo "-r : T20 recovery mode: select RAM size (256 | 512)" - echo "-s : optimise file system for V1.1 or 256MB V1.2 modules, increases" - echo " usable space a little, but limits 512MB V1.2 modules to 512MB" - echo " usable NAND space" + echo "-s : T20: optimise file system for V1.1 or 256MB V1.2 modules," + echo " increases usable space a little, but limits 512MB V1.2 modules" + echo " to 512MB usable NAND space" echo "-v : T20 recovery mode: select Colibri version (V1_1 | V1_2)" echo "" - echo "Example \"./update.sh -o /run/media/user/label\" copies files to SD card" - echo "Example \"./update.sh -o /srv/tftp/\" copies the requiered files to /srv/tftp/" + echo "Example \"./update.sh -o /srv/tftp/\" copies the required files to /srv/tftp/" echo "" - echo "*** For detailed recovery/update procedures, refer to the Release Notes ***" + echo "*** For detailed recovery/update procedures, refer to the following website: ***" + echo "http://developer.toradex.com/knowledge-base/flashing-linux-on-tegra-modules" echo "" } -- cgit v1.2.3