summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2017-09-05 14:54:36 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-09-11 17:30:28 +0100
commit798f696623508220fefef8d6bd1adf8cacac45d9 (patch)
treea811cd296847dcabfc07b081a343e27a32044f7c /scripts/lib
parent2ba1ff1e60f12d7f16ad61e7525bcd74f5530279 (diff)
downloadpoky-798f696623508220fefef8d6bd1adf8cacac45d9.tar.gz
wic: implement ext fs support for 'wic ls'
Implemented listing directory contents for ext file system using debugfs tool. (From OE-Core rev: b591ba6f4d684aef3d7666bbdc678954e3255df5) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/wic/engine.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/scripts/lib/wic/engine.py b/scripts/lib/wic/engine.py
index eafc6c783e..c6a63f2080 100644
--- a/scripts/lib/wic/engine.py
+++ b/scripts/lib/wic/engine.py
@@ -234,7 +234,7 @@ def wic_list(args, scripts_path):
234 234
235 235
236class Disk: 236class Disk:
237 def __init__(self, imagepath, native_sysroot, fstypes=('fat',)): 237 def __init__(self, imagepath, native_sysroot, fstypes=('fat', 'ext')):
238 self.imagepath = imagepath 238 self.imagepath = imagepath
239 self.native_sysroot = native_sysroot 239 self.native_sysroot = native_sysroot
240 self.fstypes = fstypes 240 self.fstypes = fstypes
@@ -280,7 +280,7 @@ class Disk:
280 def __getattr__(self, name): 280 def __getattr__(self, name):
281 """Get path to the executable in a lazy way.""" 281 """Get path to the executable in a lazy way."""
282 if name in ("mdir", "mcopy", "mdel", "mdeltree", "sfdisk", "e2fsck", 282 if name in ("mdir", "mcopy", "mdel", "mdeltree", "sfdisk", "e2fsck",
283 "resize2fs", "mkswap", "mkdosfs"): 283 "resize2fs", "mkswap", "mkdosfs", "debugfs"):
284 aname = "_%s" % name 284 aname = "_%s" % name
285 if aname not in self.__dict__: 285 if aname not in self.__dict__:
286 setattr(self, aname, find_executable(name, self.paths)) 286 setattr(self, aname, find_executable(name, self.paths))
@@ -314,9 +314,14 @@ class Disk:
314 seek=self.partitions[pnum].start) 314 seek=self.partitions[pnum].start)
315 315
316 def dir(self, pnum, path): 316 def dir(self, pnum, path):
317 return exec_cmd("{} -i {} ::{}".format(self.mdir, 317 if self.partitions[pnum].fstype.startswith('ext'):
318 self._get_part_image(pnum), 318 return exec_cmd("{} {} -R 'ls -l {}'".format(self.debugfs,
319 path)) 319 self._get_part_image(pnum),
320 path), as_shell=True)
321 else: # fat
322 return exec_cmd("{} -i {} ::{}".format(self.mdir,
323 self._get_part_image(pnum),
324 path))
320 325
321 def copy(self, src, pnum, path): 326 def copy(self, src, pnum, path):
322 """Copy partition image into wic image.""" 327 """Copy partition image into wic image."""