From: Ed Bartosh <ed.bartosh@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 2/7] wic: implement ext fs support for 'wic cp'
Date: Tue, 5 Sep 2017 14:54:37 +0300 [thread overview]
Message-ID: <f01df5759f1d1783b6dee9e9954fadf3d93da78b.1504611134.git.ed.bartosh@linux.intel.com> (raw)
In-Reply-To: <cover.1504611134.git.ed.bartosh@linux.intel.com>
Implemented copying files to the ext partition
using debugfs tool.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
scripts/lib/wic/engine.py | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/scripts/lib/wic/engine.py b/scripts/lib/wic/engine.py
index c6a63f2080a..9ebd93ae278 100644
--- a/scripts/lib/wic/engine.py
+++ b/scripts/lib/wic/engine.py
@@ -325,10 +325,15 @@ class Disk:
def copy(self, src, pnum, path):
"""Copy partition image into wic image."""
- cmd = "{} -i {} -snop {} ::{}".format(self.mcopy,
- self._get_part_image(pnum),
- src, path)
- exec_cmd(cmd)
+ if self.partitions[pnum].fstype.startswith('ext'):
+ cmd = "echo -e 'cd {}\nwrite {} {}' | {} -w {}".\
+ format(path, src, os.path.basename(src),
+ self.debugfs, self._get_part_image(pnum))
+ else: # fat
+ cmd = "{} -i {} -snop {} ::{}".format(self.mcopy,
+ self._get_part_image(pnum),
+ src, path)
+ exec_cmd(cmd, as_shell=True)
self._put_part_image(pnum)
def remove(self, pnum, path):
--
2.13.5
next prev parent reply other threads:[~2017-09-05 11:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-05 11:54 [PATCH 0/7] implement wic ls/cp/rm for ext partitions Ed Bartosh
2017-09-05 11:54 ` [PATCH 1/7] wic: implement ext fs support for 'wic ls' Ed Bartosh
2017-09-05 11:54 ` Ed Bartosh [this message]
2017-09-05 11:54 ` [PATCH 3/7] wic: implement ext fs support for 'wic rm' Ed Bartosh
2017-09-05 11:54 ` [PATCH 4/7] wic: update help content Ed Bartosh
2017-09-05 11:54 ` [PATCH 5/7] wic: selftest: add test_wic_ls_ext test case Ed Bartosh
2017-09-05 11:54 ` [PATCH 6/7] wic: selftest: add test_wic_cp_ext " Ed Bartosh
2017-09-05 11:54 ` [PATCH 7/7] wic: selftest: add test_wic_rm_ext " Ed Bartosh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f01df5759f1d1783b6dee9e9954fadf3d93da78b.1504611134.git.ed.bartosh@linux.intel.com \
--to=ed.bartosh@linux.intel.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.