[Replicant] [vendor_replicant-scripts] [PATCH 6/9] add_adb_root: Bootimage: cleanup temporary files after adding adb root

Denis 'GNUtoo' Carikli GNUtoo at cyberdimension.org
Fri Oct 1 17:47:56 UTC 2021


Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo at cyberdimension.org>
---
 images/add_adb_root/add_adb_root.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/images/add_adb_root/add_adb_root.py b/images/add_adb_root/add_adb_root.py
index 7fb41ce..02afaae 100755
--- a/images/add_adb_root/add_adb_root.py
+++ b/images/add_adb_root/add_adb_root.py
@@ -93,6 +93,11 @@ class Bootimage(object):
                      "--cmdline={}".format(self._metadata['cmdline']),
                      "-o", output_file_path)
 
+        # Don't fill up /tmp
+        for path in [self._config, self._kernel, self._ramdisk]:
+            os.unlink(path)
+        os.removedirs(self._tmpdir)
+
         return output_file_path
 
     def add_adb_root(self, output_file_path):
-- 
2.33.0



More information about the Replicant mailing list