[elbe-devel] [PATCH v3 3/5] hdimg: Add losetup wrapper for grub installers
Olivier Dion
dion at linutronix.de
Sat Apr 4 19:27:53 CEST 2020
Signed-off-by: Olivier Dion <dion at linutronix.de>
---
elbepack/hdimg.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/elbepack/hdimg.py b/elbepack/hdimg.py
index a9d2666c..a1c77ce7 100644
--- a/elbepack/hdimg.py
+++ b/elbepack/hdimg.py
@@ -16,7 +16,7 @@ import _ped
from elbepack.fstab import fstabentry, mountpoint_dict
from elbepack.filesystem import Filesystem, size_to_int
-from elbepack.shellhelper import do, CommandError, chroot
+from elbepack.shellhelper import do, CommandError, chroot, get_command_out
def mkfs_mtd(mtd, fslabel, target):
@@ -155,6 +155,10 @@ class grubinstaller_base(object):
def install(self, target):
pass
+ def losetup(self, f):
+ loopdev = get_command_out('losetup --find --show "%s"' % f)
+ return loopdev.rstrip('\n')
+
class grubinstaller202(grubinstaller_base):
--
2.26.0
More information about the elbe-devel
mailing list