[Armadeus-commitlog] armadeus branch, master, updated. armadeus-5.3-532-geec9ddb
Brought to you by:
sszy
|
From: Julien B a. A. <ar...@us...> - 2014-12-24 13:38:29
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via eec9ddb124b46f9bd6e795ab1c353b5c6737f003 (commit)
from a03c2795a572b873dc3b3c155cc3e00857f1987b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit eec9ddb124b46f9bd6e795ab1c353b5c6737f003
Author: Julien Boibessot <jul...@ar...>
Date: Wed Dec 24 14:35:52 2014 +0100
[TOOLS] apf6_recover: improve user experience with colors and better description :-)
-----------------------------------------------------------------------
Summary of changes:
software/uboot_recover/apf6_recovery.py | 40 +++++++++++++++++--------------
software/uboot_recover/helpers.py | 9 +++++++
2 files changed, 31 insertions(+), 18 deletions(-)
create mode 100644 software/uboot_recover/helpers.py
diff --git a/software/uboot_recover/apf6_recovery.py b/software/uboot_recover/apf6_recovery.py
index 606e82f..4db47fc 100644
--- a/software/uboot_recover/apf6_recovery.py
+++ b/software/uboot_recover/apf6_recovery.py
@@ -28,6 +28,8 @@ import subprocess
import sys
import time
+from helpers import color
+
class UBoot:
def __init__(self, serial):
@@ -85,39 +87,41 @@ if __name__ == "__main__":
U_BOOT_IMG = "apf6-u-boot.img"
SPEED = 115200
- print "\n--- APF6 Bootstrap Tool ---\n"
+ print color.BOLD + "\n--- APF6 Bootstrap Tool ---\n"
print "Procedure to follow:"
- print "1] Power off your board, close all serial terminal sessions, remove all USB cables"
- print "2] Take jumper off BOOT0 pin and put it on BOOT1 pin."
- print "3] Power on your board"
- print "4] Connect a USB cable from your PC to the APF6Dev OTG miniUSB connector"
- print "5] Connect a USB cable from your PC to the APF6Dev console miniUSB connector"
- print "6] Be sure to have built the APF6 BSP: make apf6_defconfig; make"
- print "7] Have launched this script as root (sudo)"
- print "8] Have sb installed (On Ubuntu: sudo apt-get install lrzsz)\n"
- port = raw_input('--- Enter serial port number or device name to use for console (/dev/ttyUSB0 under Linux (default) or COMx under Window$): ')
+ print "1] Be sure to:"
+ print " * have built the APF6 BSP (make apf6_defconfig; make),"
+ print " * have \"sb\" tool installed (On Ubuntu: sudo apt-get install lrzsz),"
+ print " * have launched this script as root (sudo)."
+ print "2] Power off your board, close all serial terminal sessions, remove all USB cables"
+ print "3] Take jumper off BOOT0 pin and put it on BOOT1 pin."
+ print "4] Power on your board"
+ print "5] Connect a USB cable from your PC to the APF6Dev OTG miniUSB connector"
+ print "6] Connect a USB cable from your PC to the APF6Dev console miniUSB connector"
+ print ""
+ port = raw_input('--- Then, enter serial port number or device name to use for console (/dev/ttyUSB0 under Linux (default) or COMx under Window$): ' + color.END)
if port == '':
port = '/dev/ttyUSB0'
if not os.path.exists(USB_DOWNLOAD_APP):
- print "Error: imx_usb is not present. Please compile Armadeus BSP first: make apf6_defconfig; make"
+ print color.RED + "Error: imx_usb is not present. Please compile Armadeus BSP first: make apf6_defconfig; make" + color.END
sys.exit(1)
if not os.path.exists(U_BOOT_SPL) or not os.path.exists(U_BOOT_IMG):
- print "Error: U-Boot binaries don't exist !"
+ print color.RED + "Error: U-Boot binaries don't exist !" + color.END
sys.exit(1)
try:
subprocess.call([SERIAL_DOWNLOAD_APP, "--version"])
except OSError:
- print "Error: " + SERIAL_DOWNLOAD_APP + " not found. Did you install lrzsz package on your system ?"
+ print color.RED + "Error: " + SERIAL_DOWNLOAD_APP + " not found. Did you install lrzsz package on your system ?" + color.END
sys.exit(1)
try:
subprocess.check_call([USB_DOWNLOAD_APP, "-c", BR_HOST_PATH + "/usr/share/imx_usb_loader/", U_BOOT_SPL])
subprocess.check_call(SERIAL_DOWNLOAD_APP + " -k " + U_BOOT_IMG + " > " + port + " < " + port, shell=True)
except subprocess.CalledProcessError:
- print "Error: Loading U-Boot binaries failed !"
+ print color.RED + "Error: Loading U-Boot binaries failed !" + color.END
sys.exit(1)
try:
@@ -141,7 +145,7 @@ if __name__ == "__main__":
uboot.waitForPrompt()
uboot.flash_img()
- eraseAll = raw_input('\n--- Would you like to erase the environment variables ? y/N: ')
+ eraseAll = raw_input(color.BOLD + '\n--- Would you like to erase the environment variables ? y/N: ' + color.END)
if eraseAll == 'y':
uboot.resetEnv()
except serial.SerialException:
@@ -152,9 +156,9 @@ if __name__ == "__main__":
ser.close()
sys.exit(1)
except subprocess.CalledProcessError:
- print "Error: Loading U-Boot binaries on serial port failed !"
+ print color.RED + "Error: Loading U-Boot binaries on serial port failed !" + color.END
ser.close()
sys.exit(1)
else:
- print "\n--- U-Boot successfully recovered !"
- print "--- Now you can remove miniUSB OTG cable and put the jumper back on BOOT0 pin. Your board is running..."
+ print color.GREEN + "\n--- U-Boot successfully recovered !" + color.END
+ print color.BOLD + "--- Now you can remove miniUSB OTG cable and put the jumper back on BOOT0 pin. Your board is running..." + color.END
diff --git a/software/uboot_recover/helpers.py b/software/uboot_recover/helpers.py
new file mode 100644
index 0000000..c26a40c
--- /dev/null
+++ b/software/uboot_recover/helpers.py
@@ -0,0 +1,9 @@
+
+class color:
+ BLUE = '\033[94m'
+ GREEN = '\033[92m'
+ YELLOW = '\033[93m'
+ RED = '\033[91m'
+ BOLD = '\033[1m'
+ UNDERLINE = '\033[4m'
+ END = '\033[0m'
hooks/post-receive
--
armadeus
|