All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2] meta: handle IMAGE_ROOTFS/IMGDEPLOYDIR by task varflags
@ 2019-01-06 16:30 liu.ming50
  2019-01-07 15:33 ` Richard Purdie
  2019-01-09 11:14 ` Peter Kjellerstedt
  0 siblings, 2 replies; 4+ messages in thread
From: liu.ming50 @ 2019-01-06 16:30 UTC (permalink / raw)
  To: openembedded-core; +Cc: Ming Liu

From: Ming Liu <liu.ming50@gmail.com>

I found a issue that sometimes there are leftovers in IMAGE_ROOTFS
that are generated by the previous builds. I think this is caused by
IMAGE_ROOTFS is not in do_rootfs[cleandirs], so add it in provided that
INC_RPM_IMAGE_GEN is not set.

IMGDEPLOYDIR could be added to do_rootfs[dirs] as well, hence some code
in rootfs.py to generate the IMAGE_ROOTFS/IMGDEPLOYDIR directories
could be removed.

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
---
 meta/classes/image.bbclass | 4 ++--
 meta/lib/oe/rootfs.py      | 5 -----
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 11927f3..b6bf97a 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -251,8 +251,8 @@ fakeroot python do_rootfs () {
 
     progress_reporter.finish()
 }
-do_rootfs[dirs] = "${TOPDIR}"
-do_rootfs[cleandirs] += "${S} ${IMGDEPLOYDIR}"
+do_rootfs[dirs] = "${IMAGE_ROOTFS} ${IMGDEPLOYDIR} ${TOPDIR}"
+do_rootfs[cleandirs] += "${S} ${IMGDEPLOYDIR} ${@["${IMAGE_ROOTFS}", ""][(d.getVar('INC_RPM_IMAGE_GEN') == '1')]}"
 do_rootfs[umask] = "022"
 do_rootfs[file-checksums] += "${POSTINST_INTERCEPT_CHECKSUMS}"
 addtask rootfs after do_prepare_recipe_sysroot
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 4273891..945c769 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -19,7 +19,6 @@ class Rootfs(object, metaclass=ABCMeta):
         self.d = d
         self.pm = None
         self.image_rootfs = self.d.getVar('IMAGE_ROOTFS')
-        self.deploydir = self.d.getVar('IMGDEPLOYDIR')
         self.progress_reporter = progress_reporter
         self.logcatcher = logcatcher
 
@@ -188,10 +187,6 @@ class Rootfs(object, metaclass=ABCMeta):
         post_process_cmds = self.d.getVar("ROOTFS_POSTPROCESS_COMMAND")
         rootfs_post_install_cmds = self.d.getVar('ROOTFS_POSTINSTALL_COMMAND')
 
-        bb.utils.mkdirhier(self.image_rootfs)
-
-        bb.utils.mkdirhier(self.deploydir)
-
         execute_pre_post_process(self.d, pre_process_cmds)
 
         if self.progress_reporter:
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH V2] meta: handle IMAGE_ROOTFS/IMGDEPLOYDIR by task varflags
  2019-01-06 16:30 [PATCH V2] meta: handle IMAGE_ROOTFS/IMGDEPLOYDIR by task varflags liu.ming50
@ 2019-01-07 15:33 ` Richard Purdie
  2019-01-09 11:53   ` Ming Liu
  2019-01-09 11:14 ` Peter Kjellerstedt
  1 sibling, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2019-01-07 15:33 UTC (permalink / raw)
  To: liu.ming50, openembedded-core

On Sun, 2019-01-06 at 17:30 +0100, liu.ming50@gmail.com wrote:
> From: Ming Liu <liu.ming50@gmail.com>
> 
> I found a issue that sometimes there are leftovers in IMAGE_ROOTFS
> that are generated by the previous builds. I think this is caused by
> IMAGE_ROOTFS is not in do_rootfs[cleandirs], so add it in provided
> that
> INC_RPM_IMAGE_GEN is not set.
> 
> IMGDEPLOYDIR could be added to do_rootfs[dirs] as well, hence some
> code
> in rootfs.py to generate the IMAGE_ROOTFS/IMGDEPLOYDIR directories
> could be removed.
> 
> Signed-off-by: Ming Liu <liu.ming50@gmail.com>
> ---
>  meta/classes/image.bbclass | 4 ++--
>  meta/lib/oe/rootfs.py      | 5 -----
>  2 files changed, 2 insertions(+), 7 deletions(-)

Firstly, lets split the patch into two, the cleanup and the "fix".

The cleanup is fine. The fix is more problematic as I don't want to
start encoding logic into the cleandirs var flag. You've missed
INC_IPK_IMAGE_GEN for example so the logic would need to become more
twisted. Looking at the code in lib/oe/rootfs.py, it does cleanup the
directory:

        self.inc_rpm_image_gen = self.d.getVar('INC_RPM_IMAGE_GEN')
        if self.inc_rpm_image_gen != "1":
            bb.utils.remove(self.image_rootfs, True)
        else:
            self.pm.recovery_packaging_data()

so I'm not sure this will fix the issue you're seeing anyway.

Cheers,

Richard



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH V2] meta: handle IMAGE_ROOTFS/IMGDEPLOYDIR by task varflags
  2019-01-06 16:30 [PATCH V2] meta: handle IMAGE_ROOTFS/IMGDEPLOYDIR by task varflags liu.ming50
  2019-01-07 15:33 ` Richard Purdie
@ 2019-01-09 11:14 ` Peter Kjellerstedt
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Kjellerstedt @ 2019-01-09 11:14 UTC (permalink / raw)
  To: liu.ming50, openembedded-core

> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org <openembedded-
> core-bounces@lists.openembedded.org> On Behalf Of liu.ming50@gmail.com
> Sent: den 6 januari 2019 17:31
> To: openembedded-core@lists.openembedded.org
> Cc: Ming Liu <liu.ming50@gmail.com>
> Subject: [OE-core] [PATCH V2] meta: handle IMAGE_ROOTFS/IMGDEPLOYDIR by
> task varflags
> 
> From: Ming Liu <liu.ming50@gmail.com>
> 
> I found a issue that sometimes there are leftovers in IMAGE_ROOTFS
> that are generated by the previous builds. I think this is caused by
> IMAGE_ROOTFS is not in do_rootfs[cleandirs], so add it in provided that
> INC_RPM_IMAGE_GEN is not set.
> 
> IMGDEPLOYDIR could be added to do_rootfs[dirs] as well, hence some code
> in rootfs.py to generate the IMAGE_ROOTFS/IMGDEPLOYDIR directories
> could be removed.
> 
> Signed-off-by: Ming Liu <liu.ming50@gmail.com>
> ---
>  meta/classes/image.bbclass | 4 ++--
>  meta/lib/oe/rootfs.py      | 5 -----
>  2 files changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index 11927f3..b6bf97a 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -251,8 +251,8 @@ fakeroot python do_rootfs () {
> 
>      progress_reporter.finish()
>  }
> -do_rootfs[dirs] = "${TOPDIR}"
> -do_rootfs[cleandirs] += "${S} ${IMGDEPLOYDIR}"
> +do_rootfs[dirs] = "${IMAGE_ROOTFS} ${IMGDEPLOYDIR} ${TOPDIR}"
> +do_rootfs[cleandirs] += "${S} ${IMGDEPLOYDIR} ${@["${IMAGE_ROOTFS}", ""][(d.getVar('INC_RPM_IMAGE_GEN') == '1')]}"

A bit more readable:

do_rootfs[cleandirs] += "${S} ${IMGDEPLOYDIR} ${@'${IMAGE_ROOTFS}' if d.getVar('INC_RPM_IMAGE_GEN') != '1' else ''}"

>  do_rootfs[umask] = "022"
>  do_rootfs[file-checksums] += "${POSTINST_INTERCEPT_CHECKSUMS}"
>  addtask rootfs after do_prepare_recipe_sysroot
> diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
> index 4273891..945c769 100644
> --- a/meta/lib/oe/rootfs.py
> +++ b/meta/lib/oe/rootfs.py
> @@ -19,7 +19,6 @@ class Rootfs(object, metaclass=ABCMeta):
>          self.d = d
>          self.pm = None
>          self.image_rootfs = self.d.getVar('IMAGE_ROOTFS')
> -        self.deploydir = self.d.getVar('IMGDEPLOYDIR')
>          self.progress_reporter = progress_reporter
>          self.logcatcher = logcatcher
> 
> @@ -188,10 +187,6 @@ class Rootfs(object, metaclass=ABCMeta):
>          post_process_cmds = self.d.getVar("ROOTFS_POSTPROCESS_COMMAND")
>          rootfs_post_install_cmds = self.d.getVar('ROOTFS_POSTINSTALL_COMMAND')
> 
> -        bb.utils.mkdirhier(self.image_rootfs)
> -
> -        bb.utils.mkdirhier(self.deploydir)
> -
>          execute_pre_post_process(self.d, pre_process_cmds)
> 
>          if self.progress_reporter:
> --
> 2.7.4

//Peter



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH V2] meta: handle IMAGE_ROOTFS/IMGDEPLOYDIR by task varflags
  2019-01-07 15:33 ` Richard Purdie
@ 2019-01-09 11:53   ` Ming Liu
  0 siblings, 0 replies; 4+ messages in thread
From: Ming Liu @ 2019-01-09 11:53 UTC (permalink / raw)
  To: Richard Purdie; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 1876 bytes --]

HI, Richard:

Will send a V2 to do the cleaning up firstly, after I double checked the
code, seems to me that you are correct, there are
"bb.utils.remove(self.image_rootfs, True)" for all package backend, so I am
wondering why I saw the leftovers, will investigate that.

//Ming Liu

Richard Purdie <richard.purdie@linuxfoundation.org> 於 2019年1月7日 週一 下午4:33寫道:

> On Sun, 2019-01-06 at 17:30 +0100, liu.ming50@gmail.com wrote:
> > From: Ming Liu <liu.ming50@gmail.com>
> >
> > I found a issue that sometimes there are leftovers in IMAGE_ROOTFS
> > that are generated by the previous builds. I think this is caused by
> > IMAGE_ROOTFS is not in do_rootfs[cleandirs], so add it in provided
> > that
> > INC_RPM_IMAGE_GEN is not set.
> >
> > IMGDEPLOYDIR could be added to do_rootfs[dirs] as well, hence some
> > code
> > in rootfs.py to generate the IMAGE_ROOTFS/IMGDEPLOYDIR directories
> > could be removed.
> >
> > Signed-off-by: Ming Liu <liu.ming50@gmail.com>
> > ---
> >  meta/classes/image.bbclass | 4 ++--
> >  meta/lib/oe/rootfs.py      | 5 -----
> >  2 files changed, 2 insertions(+), 7 deletions(-)
>
> Firstly, lets split the patch into two, the cleanup and the "fix".
>
> The cleanup is fine. The fix is more problematic as I don't want to
> start encoding logic into the cleandirs var flag. You've missed
> INC_IPK_IMAGE_GEN for example so the logic would need to become more
> twisted. Looking at the code in lib/oe/rootfs.py, it does cleanup the
> directory:
>
>         self.inc_rpm_image_gen = self.d.getVar('INC_RPM_IMAGE_GEN')
>         if self.inc_rpm_image_gen != "1":
>             bb.utils.remove(self.image_rootfs, True)
>         else:
>             self.pm.recovery_packaging_data()
>
> so I'm not sure this will fix the issue you're seeing anyway.
>
> Cheers,
>
> Richard
>
>

[-- Attachment #2: Type: text/html, Size: 2599 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-01-09 11:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-06 16:30 [PATCH V2] meta: handle IMAGE_ROOTFS/IMGDEPLOYDIR by task varflags liu.ming50
2019-01-07 15:33 ` Richard Purdie
2019-01-09 11:53   ` Ming Liu
2019-01-09 11:14 ` Peter Kjellerstedt

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.