[elbe-devel] [PATCH 1/3] elbepack: scan for partitions during losetup

Thomas Weißschuh thomas.weissschuh at linutronix.de
Mon Apr 15 15:37:42 CEST 2024


Instead of explicitly calling kpartx make use losetup --partscan.

Reported-by: Stephen Martin <stephen-martin at fmgl.com.au>
Link: https://github.com/Linutronix/elbe/pull/398
Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/hdimg.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/elbepack/hdimg.py b/elbepack/hdimg.py
index 0d4da26b2686..3e60df9f1593 100644
--- a/elbepack/hdimg.py
+++ b/elbepack/hdimg.py
@@ -138,9 +138,7 @@ class grubinstaller_base:
 
     @staticmethod
     def losetup(f):
-        loopdev = get_command_out(f'losetup --find --show "{f}"')
-        # old, removed loop devices' kernel structures might be reused, so update the mapping
-        do(f'kpartx -u "{f}"')
+        loopdev = get_command_out(f'losetup --find --show --partscan "{f}"')
         return loopdev.decode().rstrip('\n')
 
 

-- 
2.44.0



More information about the elbe-devel mailing list