From 1bf397f29f37c527e60419dc335e99805814cfbc Mon Sep 17 00:00:00 2001 From: InsanePrawn Date: Tue, 16 Aug 2022 17:54:45 +0200 Subject: [PATCH] flash.py: use losetup_destroy() before copying shrunk image --- flash.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flash.py b/flash.py index 8e0b1f8..72a9ea2 100644 --- a/flash.py +++ b/flash.py @@ -6,7 +6,7 @@ from constants import FLASH_PARTS, LOCATIONS from exec.cmd import run_root_cmd from exec.file import get_temp_dir from fastboot import fastboot_flash -from image import dd_image, partprobe, shrink_fs, losetup_rootfs_image, dump_aboot, dump_lk2nd, dump_qhypstub, get_device_and_flavour, get_image_name, get_image_path +from image import dd_image, partprobe, shrink_fs, losetup_rootfs_image, losetup_destroy, dump_aboot, dump_lk2nd, dump_qhypstub, get_device_and_flavour, get_image_name, get_image_path from wrapper import enforce_wrap ABOOT = FLASH_PARTS['ABOOT'] @@ -65,6 +65,7 @@ def cmd_flash(what: str, location: str): loop_device = losetup_rootfs_image(minimal_image_path, sector_size) partprobe(loop_device) shrink_fs(loop_device, minimal_image_path, sector_size) + losetup_destroy(loop_device) result = dd_image(input=minimal_image_path, output=path)