summaryrefslogtreecommitdiff
path: root/ext4_utils
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2021-11-23 06:33:46 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2021-11-23 06:33:46 +0000
commitb336ca970938dab499bd881013a015f16053274c (patch)
tree04a84368b475bfacfa2f24bc4e544bab144f566f /ext4_utils
parentdf009909c2b45144d9d7705ff2b1343b23a221ee (diff)
parent64c6fd95f67520dae5286423c24d682f7a2eb1ba (diff)
downloadextras-b336ca970938dab499bd881013a015f16053274c.tar.gz
Merge "Convert mkuserimg_mke2fs to python3"
Diffstat (limited to 'ext4_utils')
-rw-r--r--ext4_utils/Android.bp6
-rw-r--r--ext4_utils/mkuserimg_mke2fs.py6
2 files changed, 4 insertions, 8 deletions
diff --git a/ext4_utils/Android.bp b/ext4_utils/Android.bp
index b156780f..ba2c8ac0 100644
--- a/ext4_utils/Android.bp
+++ b/ext4_utils/Android.bp
@@ -72,14 +72,10 @@ python_binary_host {
],
version: {
- py2: {
+ py3: {
enabled: true,
embedded_launcher: true,
},
- py3: {
- enabled: false,
- embedded_launcher: false,
- },
},
required: [
diff --git a/ext4_utils/mkuserimg_mke2fs.py b/ext4_utils/mkuserimg_mke2fs.py
index d4a14f87..599e40ee 100644
--- a/ext4_utils/mkuserimg_mke2fs.py
+++ b/ext4_utils/mkuserimg_mke2fs.py
@@ -41,7 +41,7 @@ def RunCommand(cmd, env):
logging.info("Running: " + " ".join(cmd))
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
- env=env_copy)
+ env=env_copy, text=True)
output, _ = p.communicate()
return output, p.returncode
@@ -169,7 +169,7 @@ def ConstructE2fsCommands(args):
if args.flash_logical_block_size:
# stride should be the max of 8kb and the logical block size
stride = max(int(args.flash_logical_block_size), 8192)
- mke2fs_extended_opts.append("stride={}".format(stride / BLOCKSIZE))
+ mke2fs_extended_opts.append("stride={}".format(stride // BLOCKSIZE))
if args.mke2fs_hash_seed:
mke2fs_extended_opts.append("hash_seed=" + args.mke2fs_hash_seed)
@@ -194,7 +194,7 @@ def ConstructE2fsCommands(args):
mke2fs_opts += ["-E", ','.join(mke2fs_extended_opts)]
# Round down the filesystem length to be a multiple of the block size
- blocks = int(args.fs_size) / BLOCKSIZE
+ blocks = int(args.fs_size) // BLOCKSIZE
mke2fs_cmd = (["mke2fs"] + mke2fs_opts +
["-t", args.ext_variant, "-b", str(BLOCKSIZE), args.output_file,
str(blocks)])