From 77ed38c1cd3dd33a79f57af5f299736a4abe9320 Mon Sep 17 00:00:00 2001 From: Pavithra Palanisamy Date: Wed, 21 Feb 2018 12:32:59 +0530 Subject: [PATCH] qca: Modify pack.py script Add print statements to display the failure reason for flashing. Change-Id: Ib355271bdef307f6a981b32738a1a4195dc979ec Signed-off-by: Pavithra Palanisamy --- tools/pack.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/pack.py b/tools/pack.py index 14b7e92e79..ba304deb3b 100755 --- a/tools/pack.py +++ b/tools/pack.py @@ -328,9 +328,21 @@ class FlashScript(object): """ if fatal: + """Check cmd strings to display reason for failure.""" + + if "imxtract" in cmd: + self.script.append("failreason='error: failed on image extraction'\n") + elif "erase" in cmd: + self.script.append("failreason='error: failed on partition erase'\n") + elif "write" in cmd: + self.script.append("failreason='error: failed on partition write'\n") + else: + pass + self.script.append(cmd + ' || setenv stdout serial' + ' && echo "$failedmsg"' + + ' && echo "$failreason"' + ' && exit 1\n') else: self.script.append(cmd + "\n")