[OE-core] [PATCH V2] meta: handle IMAGE_ROOTFS/IMGDEPLOYDIR by task varflags
Peter Kjellerstedt
peter.kjellerstedt at axis.com
Wed Jan 9 11:14:29 UTC 2019
> -----Original Message-----
> From: openembedded-core-bounces at lists.openembedded.org <openembedded-
> core-bounces at lists.openembedded.org> On Behalf Of liu.ming50 at gmail.com
> Sent: den 6 januari 2019 17:31
> To: openembedded-core at lists.openembedded.org
> Cc: Ming Liu <liu.ming50 at gmail.com>
> Subject: [OE-core] [PATCH V2] meta: handle IMAGE_ROOTFS/IMGDEPLOYDIR by
> task varflags
>
> From: Ming Liu <liu.ming50 at 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 at 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
More information about the Openembedded-core
mailing list