diff --git a/build_debian.sh b/build_debian.sh index db736d16946e..2bb284182db1 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -463,7 +463,8 @@ EOF sudo cp ./files/scripts/core_cleanup.py $FILESYSTEM_ROOT/usr/bin/core_cleanup.py ## Copy ASIC config checksum -python files/build_scripts/generate_asic_config_checksum.py +sudo chmod 755 files/build_scripts/generate_asic_config_checksum.py +./files/build_scripts/generate_asic_config_checksum.py if [[ ! -f './asic_config_checksum' ]]; then echo 'asic_config_checksum not found' exit 1 diff --git a/files/build_scripts/generate_asic_config_checksum.py b/files/build_scripts/generate_asic_config_checksum.py old mode 100644 new mode 100755 index 638259ce938a..41ef6f045e21 --- a/files/build_scripts/generate_asic_config_checksum.py +++ b/files/build_scripts/generate_asic_config_checksum.py @@ -1,8 +1,8 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 -import syslog -import os import hashlib +import os +import syslog SYSLOG_IDENTIFIER = 'asic_config_checksum' @@ -45,7 +45,7 @@ def generate_checksum(checksum_files): checksum = hashlib.sha1() for checksum_file in checksum_files: try: - with open(checksum_file, 'r') as f: + with open(checksum_file, 'rb') as f: for chunk in iter(lambda: f.read(CHUNK_SIZE), b""): checksum.update(chunk) except IOError as e: