* [RFC] rawcopy.py: Copy source file in image creation build folder
@ 2015-10-21 16:04 Noor, Ahsan
2015-10-22 10:14 ` Ahsan, Noor
2015-10-22 14:02 ` Leonardo Sandoval
0 siblings, 2 replies; 4+ messages in thread
From: Noor, Ahsan @ 2015-10-21 16:04 UTC (permalink / raw)
To: openembedded-core
From: Noor <noor_ahsan@mentor.com>
* When a file is given using --sourceparams then wic directly use that file
instead of copying them to build folder. At time of assmebling it os.rename
is called which rename all the files to name. In that process the original
file get renamed. When image recipe is rebuilt then wic complains about
missing file which renamed in previous build.
Signed-off-by: Noor Ahsan <noor_ahsan@mentor.com>
---
scripts/lib/wic/plugins/source/rawcopy.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/scripts/lib/wic/plugins/source/rawcopy.py b/scripts/lib/wic/plugins/source/rawcopy.py
index f0691ba..f17da27 100644
--- a/scripts/lib/wic/plugins/source/rawcopy.py
+++ b/scripts/lib/wic/plugins/source/rawcopy.py
@@ -74,6 +74,10 @@ class RawCopyPlugin(SourcePlugin):
dd_cmd = "dd if=%s of=%s ibs=%s skip=1 conv=notrunc" % \
(src, dst, source_params['skip'])
exec_cmd(dd_cmd)
+ else:
+ dst = os.path.join(cr_workdir, source_params['file'])
+ dd_cmd = "cp src dst"
+ exec_cmd(dd_cmd)
# get the size in the right units for kickstart (kB)
du_cmd = "du -Lbks %s" % dst
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [RFC] rawcopy.py: Copy source file in image creation build folder
2015-10-21 16:04 [RFC] rawcopy.py: Copy source file in image creation build folder Noor, Ahsan
@ 2015-10-22 10:14 ` Ahsan, Noor
2015-10-22 14:02 ` Leonardo Sandoval
1 sibling, 0 replies; 4+ messages in thread
From: Ahsan, Noor @ 2015-10-22 10:14 UTC (permalink / raw)
To: openembedded-core@lists.openembedded.org
-----Original Message-----
From: Ahsan, Noor
Sent: Wednesday, October 21, 2015 9:04 PM
To: openembedded-core@lists.openembedded.org
Cc: Ahsan, Noor
Subject: [RFC] rawcopy.py: Copy source file in image creation build folder
From: Noor <noor_ahsan@mentor.com>
* When a file is given using --sourceparams then wic directly use that file
instead of copying them to build folder. At time of assmebling it os.rename
is called which rename all the files to name. In that process the original
file get renamed. When image recipe is rebuilt then wic complains about
missing file which renamed in previous build.
Signed-off-by: Noor Ahsan <noor_ahsan@mentor.com>
---
scripts/lib/wic/plugins/source/rawcopy.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/scripts/lib/wic/plugins/source/rawcopy.py b/scripts/lib/wic/plugins/source/rawcopy.py
index f0691ba..f17da27 100644
--- a/scripts/lib/wic/plugins/source/rawcopy.py
+++ b/scripts/lib/wic/plugins/source/rawcopy.py
@@ -74,6 +74,10 @@ class RawCopyPlugin(SourcePlugin):
dd_cmd = "dd if=%s of=%s ibs=%s skip=1 conv=notrunc" % \
(src, dst, source_params['skip'])
exec_cmd(dd_cmd)
+ else:
+ dst = os.path.join(cr_workdir, source_params['file'])
+ dd_cmd = "cp src dst"
+ exec_cmd(dd_cmd)
dd_cmd will be replaced by cp_cmd but I need review of all impact of this so that I can send proper patch.
# get the size in the right units for kickstart (kB)
du_cmd = "du -Lbks %s" % dst
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [RFC] rawcopy.py: Copy source file in image creation build folder
2015-10-21 16:04 [RFC] rawcopy.py: Copy source file in image creation build folder Noor, Ahsan
2015-10-22 10:14 ` Ahsan, Noor
@ 2015-10-22 14:02 ` Leonardo Sandoval
2015-10-22 15:17 ` Ahsan, Noor
1 sibling, 1 reply; 4+ messages in thread
From: Leonardo Sandoval @ 2015-10-22 14:02 UTC (permalink / raw)
To: Noor, Ahsan, openembedded-core
> + else:
> + dst = os.path.join(cr_workdir, source_params['file'])
> + dd_cmd = "cp src dst"
> + exec_cmd(dd_cmd)
>
the constructed dst variable is not being included into the dd_cmd, is
it? I would expect something like
dd_cmd = "cp %s %s" % (src, dst)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC] rawcopy.py: Copy source file in image creation build folder
2015-10-22 14:02 ` Leonardo Sandoval
@ 2015-10-22 15:17 ` Ahsan, Noor
0 siblings, 0 replies; 4+ messages in thread
From: Ahsan, Noor @ 2015-10-22 15:17 UTC (permalink / raw)
To: Leonardo Sandoval, openembedded-core@lists.openembedded.org
-----Original Message-----
From: Leonardo Sandoval [mailto:leonardo.sandoval.gonzalez@linux.intel.com]
Sent: Thursday, October 22, 2015 7:02 PM
To: Ahsan, Noor; openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [RFC] rawcopy.py: Copy source file in image creation build folder
> + else:
> + dst = os.path.join(cr_workdir, source_params['file'])
> + dd_cmd = "cp src dst"
> + exec_cmd(dd_cmd)
>
the constructed dst variable is not being included into the dd_cmd, is it? I would expect something like
dd_cmd = "cp %s %s" % (src, dst)
yeah missed out. Will look into that but does this mechanism make sense?
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-10-22 15:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-21 16:04 [RFC] rawcopy.py: Copy source file in image creation build folder Noor, Ahsan
2015-10-22 10:14 ` Ahsan, Noor
2015-10-22 14:02 ` Leonardo Sandoval
2015-10-22 15:17 ` Ahsan, Noor
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.