As I was wrapping up my work on the upgrade to 7.1.2 on the S4, I ran into this error, which prevented the compiler from building the userdata.img file. Here’s the output:

[CODE]
get/product/jfltetmo/userdata.img
File “./build/tools/releasetools/build_image.py”, line 157
print cmd
^
SyntaxError: invalid syntax
[/CODE]

The fix was actually quite easy. I needed to encapsulate the cmd in parenthesis, like this:

./build/tools/releasetools/build_image.py

[CODE]
cmd = “fec -e -p %d %s %s %s” % (padding_size, sparse_image_path,
verity_path, verity_fec_path)
print (cmd) # WJH
status, output = commands.getstatusoutput(cmd)
[/CODE]

The proof is in the pudding, but what help was how the cmd is defined, then notice that the “status, output” line also puts cmd in parenthesis. So, I did the same for the print cmd line, and it worked!

Linux – keep it simple.

Leave a Reply

Your email address will not be published. Required fields are marked *