diff options
-rwxr-xr-x | images/add_adb_root/add_adb_root.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/images/add_adb_root/add_adb_root.py b/images/add_adb_root/add_adb_root.py index 02afaae..3bfc185 100755 --- a/images/add_adb_root/add_adb_root.py +++ b/images/add_adb_root/add_adb_root.py @@ -18,9 +18,7 @@ import os import re import sh import sys - -# TODO: -# import tempfile +import tempfile import files_checksums @@ -38,9 +36,7 @@ class Bootimage(object): self._path = path self._metadata = self._get_metadata() - # TODO: - # tempfile.TemporaryDirectory().name - self._tmpdir = str(sh.mktemp("-d")).replace(os.linesep, "") + self._tmpdir = tempfile.mkdtemp() self._kernel = self._tmpdir + os.sep + "kernel.img" self._ramdisk = self._tmpdir + os.sep + "ramdisk.cpio.gz" @@ -165,7 +161,7 @@ def identify_image_type(path): return ImageType.bootimage def add_adb_to_zImage(input_file, output_file): - tmpdir = str(sh.mktemp("-d")).replace(os.linesep, "") + tmpdir = tempfile.mkdtemp() uncompressed_Image = None ramdisk = None |