Yilin Yang has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/45460 )
Change subject: util/exynos: Port *_cksum.py to python3 ......................................................................
util/exynos: Port *_cksum.py to python3
BUG=chromium:1023662 TEST=1. Create a tiny file `in.txt` as input 2. Run `fixed_cksum.py in.txt out.txt 20` with py2 and py3 version, the output is the same 3. Run `variable_cksum.py in.txt out.txt` with py2 and py3 version, the output is the same
Signed-off-by: Yilin Yang kerker@google.com Change-Id: I9428269dfb826a3a95fffef9ea3f7c1a7107ef84 --- M util/exynos/fixed_cksum.py M util/exynos/variable_cksum.py 2 files changed, 4 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/60/45460/1
diff --git a/util/exynos/fixed_cksum.py b/util/exynos/fixed_cksum.py index c6a9ddae..0ae7e4f 100755 --- a/util/exynos/fixed_cksum.py +++ b/util/exynos/fixed_cksum.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # # SPDX-License-Identifier: BSD-3-Clause
@@ -28,7 +28,7 @@ checksum_size = struct.calcsize(checksum_format) data_size = size - checksum_size assert len(data) <= data_size - checksum = struct.pack(checksum_format, sum(map(ord, data))) + checksum = struct.pack(checksum_format, sum(data)) out_file.write(data + bytearray(data_size - len(data)) + checksum)
diff --git a/util/exynos/variable_cksum.py b/util/exynos/variable_cksum.py index 62a76cc..4321f8e 100755 --- a/util/exynos/variable_cksum.py +++ b/util/exynos/variable_cksum.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # # SPDX-License-Identifier: BSD-3-Clause
@@ -27,7 +27,7 @@ data = in_file.read() header = struct.pack(header_format, struct.calcsize(header_format) + len(data), - sum(map(ord, data)), + sum(data), 0, 0) out_file.write(header + data)
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45460 )
Change subject: util/exynos: Port *_cksum.py to python3 ......................................................................
Patch Set 1: Code-Review+2
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45460 )
Change subject: util/exynos: Port *_cksum.py to python3 ......................................................................
Patch Set 1:
please also update util/README.md and exynos/description.md
Hello Hung-Te Lin, build bot (Jenkins), Yu-Ping Wu,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45460
to look at the new patch set (#2).
Change subject: util/exynos: Port *_cksum.py to python3 ......................................................................
util/exynos: Port *_cksum.py to python3
BUG=chromium:1023662 TEST=1. Create a tiny file `in.txt` as input 2. Run `fixed_cksum.py in.txt out.txt 20` with py2 and py3 version, the output is the same 3. Run `variable_cksum.py in.txt out.txt` with py2 and py3 version, the output is the same
Signed-off-by: Yilin Yang kerker@google.com Change-Id: I9428269dfb826a3a95fffef9ea3f7c1a7107ef84 --- M util/README.md M util/exynos/description.md M util/exynos/fixed_cksum.py M util/exynos/variable_cksum.py 4 files changed, 6 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/60/45460/2
Yilin Yang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45460 )
Change subject: util/exynos: Port *_cksum.py to python3 ......................................................................
Patch Set 2:
Patch Set 1:
please also update util/README.md and exynos/description.md
Done~
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45460 )
Change subject: util/exynos: Port *_cksum.py to python3 ......................................................................
Patch Set 2: Code-Review+2
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45460 )
Change subject: util/exynos: Port *_cksum.py to python3 ......................................................................
Patch Set 2: Code-Review+2
Hung-Te Lin has submitted this change. ( https://review.coreboot.org/c/coreboot/+/45460 )
Change subject: util/exynos: Port *_cksum.py to python3 ......................................................................
util/exynos: Port *_cksum.py to python3
BUG=chromium:1023662 TEST=1. Create a tiny file `in.txt` as input 2. Run `fixed_cksum.py in.txt out.txt 20` with py2 and py3 version, the output is the same 3. Run `variable_cksum.py in.txt out.txt` with py2 and py3 version, the output is the same
Signed-off-by: Yilin Yang kerker@google.com Change-Id: I9428269dfb826a3a95fffef9ea3f7c1a7107ef84 Reviewed-on: https://review.coreboot.org/c/coreboot/+/45460 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Hung-Te Lin hungte@chromium.org Reviewed-by: Yu-Ping Wu yupingso@google.com --- M util/README.md M util/exynos/description.md M util/exynos/fixed_cksum.py M util/exynos/variable_cksum.py 4 files changed, 6 insertions(+), 6 deletions(-)
Approvals: build bot (Jenkins): Verified Hung-Te Lin: Looks good to me, approved Yu-Ping Wu: Looks good to me, approved
diff --git a/util/README.md b/util/README.md index 5ed4e75..4b2fe38 100644 --- a/util/README.md +++ b/util/README.md @@ -32,7 +32,7 @@ * __ectool__ - Dumps the RAM of a laptop's Embedded/Environmental Controller (EC). `C` * __exynos__ - Computes and fills Exynos ROM checksum (for BL1 or BL2). -`Python2` +`Python3` * __find_usbdebug__ - Help find USB debug ports * __futility__ - Firmware utility for signing ChromeOS images `Make` * __fuzz-tests__ - Create test cases that crash the jpeg code. `C` diff --git a/util/exynos/description.md b/util/exynos/description.md index 26cd20d..c039c91 100644 --- a/util/exynos/description.md +++ b/util/exynos/description.md @@ -1 +1 @@ -Computes and fills Exynos ROM checksum (for BL1 or BL2). `Python2` +Computes and fills Exynos ROM checksum (for BL1 or BL2). `Python3` diff --git a/util/exynos/fixed_cksum.py b/util/exynos/fixed_cksum.py index c6a9ddae..0ae7e4f 100755 --- a/util/exynos/fixed_cksum.py +++ b/util/exynos/fixed_cksum.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # # SPDX-License-Identifier: BSD-3-Clause
@@ -28,7 +28,7 @@ checksum_size = struct.calcsize(checksum_format) data_size = size - checksum_size assert len(data) <= data_size - checksum = struct.pack(checksum_format, sum(map(ord, data))) + checksum = struct.pack(checksum_format, sum(data)) out_file.write(data + bytearray(data_size - len(data)) + checksum)
diff --git a/util/exynos/variable_cksum.py b/util/exynos/variable_cksum.py index 62a76cc..4321f8e 100755 --- a/util/exynos/variable_cksum.py +++ b/util/exynos/variable_cksum.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # # SPDX-License-Identifier: BSD-3-Clause
@@ -27,7 +27,7 @@ data = in_file.read() header = struct.pack(header_format, struct.calcsize(header_format) + len(data), - sum(map(ord, data)), + sum(data), 0, 0) out_file.write(header + data)