All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RFC: rootfs.py: expose prepared_index and ipk_repo_workdir for OpkgPM
@ 2021-02-05  8:51 Michael Ho
  2021-02-05  8:51 ` [PATCH] " Michael Ho
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Ho @ 2021-02-05  8:51 UTC (permalink / raw)
  To: openembedded-core; +Cc: Michael Ho

From: Michael Ho <Michael.Ho@bmw.de>

Hi,

The OpkgPM class has two arguments for advanced control over the ipk
repository creation/use that I would like to make use of from outside of
OpkgRootfs (which wraps OpkgPM). This is for purposes beyond just standard
image generation so it's more of an advanced interface that is not intended
for normal use. In this commit, I've added the variables IPKGREPO_TARGET and
IPKGREPO_TARGET_PREPARED as interfaces to forward on to as ipk_repo_workdir
and prepare_index when calling the OpkgPM constructor.

Is this something that could be suitable for upstreaming or not likely? And
if so, should I send a patch to document these variables or leave them
undocumented like other IPKG variables (eg. IPKGCONF_TARGET).

Thanks!

Michael Ho (1):
  rootfs.py: expose prepared_index and ipk_repo_workdir for OpkgPM

 meta/lib/oe/package_manager/ipk/rootfs.py | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

-- 
2.7.4


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

* [PATCH] rootfs.py: expose prepared_index and ipk_repo_workdir for OpkgPM
  2021-02-05  8:51 [PATCH] RFC: rootfs.py: expose prepared_index and ipk_repo_workdir for OpkgPM Michael Ho
@ 2021-02-05  8:51 ` Michael Ho
  2021-02-05 12:33   ` [OE-core] " Richard Purdie
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Ho @ 2021-02-05  8:51 UTC (permalink / raw)
  To: openembedded-core; +Cc: Michael Ho

From: Michael Ho <Michael.Ho@bmw.de>

The OpkgPM class has several constructor options that allows for skipping
the ipk repository set up and controlling the ipk repository directory. This
commit exposes these option via the OpkgRootfs class so others can make use
of them if they wish to.

Adds the bitbake variables "IPKGREPO_TARGET_PREPARED" and "IPKGREPO_TARGET"
to act as the interfaces.

Signed-off-by: Michael Ho <Michael.Ho@bmw.de>
---
 meta/lib/oe/package_manager/ipk/rootfs.py | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oe/package_manager/ipk/rootfs.py b/meta/lib/oe/package_manager/ipk/rootfs.py
index 26dbee6..6313b72 100644
--- a/meta/lib/oe/package_manager/ipk/rootfs.py
+++ b/meta/lib/oe/package_manager/ipk/rootfs.py
@@ -129,6 +129,14 @@ class PkgRootfs(DpkgOpkgRootfs):
         self.manifest = PkgManifest(d, manifest_dir)
         self.opkg_conf = self.d.getVar("IPKGCONF_TARGET")
         self.pkg_archs = self.d.getVar("ALL_MULTILIB_PACKAGE_ARCHS")
+        self.opkg_repo = self.d.getVar("IPKGREPO_TARGET")
+        self.opkg_repo_prepared = self.d.getVar("IPKGREPO_TARGET_PREPARED")
+
+        kwargs = {}
+        if self.opkg_repo:
+            kwargs["ipk_repo_workdir"] = self.opkg_repo
+        if self.opkg_repo_prepared:
+            kwargs["prepare_index"] = False
 
         self.inc_opkg_image_gen = self.d.getVar('INC_IPK_IMAGE_GEN') or ""
         if self._remove_old_rootfs():
@@ -136,12 +144,14 @@ class PkgRootfs(DpkgOpkgRootfs):
             self.pm = OpkgPM(d,
                              self.image_rootfs,
                              self.opkg_conf,
-                             self.pkg_archs)
+                             self.pkg_archs,
+                             **kwargs)
         else:
             self.pm = OpkgPM(d,
                              self.image_rootfs,
                              self.opkg_conf,
-                             self.pkg_archs)
+                             self.pkg_archs,
+                             **kwargs)
             self.pm.recover_packaging_data()
 
         bb.utils.remove(self.d.getVar('MULTILIB_TEMP_ROOTFS'), True)
-- 
2.7.4


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

* Re: [OE-core] [PATCH] rootfs.py: expose prepared_index and ipk_repo_workdir for OpkgPM
  2021-02-05  8:51 ` [PATCH] " Michael Ho
@ 2021-02-05 12:33   ` Richard Purdie
  2021-02-05 14:21     ` Michael Ho
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2021-02-05 12:33 UTC (permalink / raw)
  To: Michael Ho, openembedded-core

On Fri, 2021-02-05 at 09:51 +0100, Michael Ho wrote:
> From: Michael Ho <Michael.Ho@bmw.de>
> 
> The OpkgPM class has several constructor options that allows for skipping
> the ipk repository set up and controlling the ipk repository directory. This
> commit exposes these option via the OpkgRootfs class so others can make use
> of them if they wish to.
> 
> Adds the bitbake variables "IPKGREPO_TARGET_PREPARED" and "IPKGREPO_TARGET"
> to act as the interfaces.
> 
> Signed-off-by: Michael Ho <Michael.Ho@bmw.de>
> ---
>  meta/lib/oe/package_manager/ipk/rootfs.py | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/lib/oe/package_manager/ipk/rootfs.py b/meta/lib/oe/package_manager/ipk/rootfs.py
> index 26dbee6..6313b72 100644
> --- a/meta/lib/oe/package_manager/ipk/rootfs.py
> +++ b/meta/lib/oe/package_manager/ipk/rootfs.py
> @@ -129,6 +129,14 @@ class PkgRootfs(DpkgOpkgRootfs):
>          self.manifest = PkgManifest(d, manifest_dir)
>          self.opkg_conf = self.d.getVar("IPKGCONF_TARGET")
>          self.pkg_archs = self.d.getVar("ALL_MULTILIB_PACKAGE_ARCHS")
> +        self.opkg_repo = self.d.getVar("IPKGREPO_TARGET")
> +        self.opkg_repo_prepared = self.d.getVar("IPKGREPO_TARGET_PREPARED")
> +
> +        kwargs = {}
> +        if self.opkg_repo:
> +            kwargs["ipk_repo_workdir"] = self.opkg_repo
> +        if self.opkg_repo_prepared:
> +            kwargs["prepare_index"] = False
>  
> 

It seems reasonable to expose them, I'd just suggest that we don't put
them in self here but do something like:

+        if self.d.getVar("IPKGREPO_TARGET"):
+            kwargs["ipk_repo_workdir"] = self.opkg_repo
+        if self.d.getVar("IPKGREPO_TARGET_PREPARED"):
+            kwargs["prepare_index"] = False
 
and my only other concern is the naming. Somehow we need to get from
the mess we're currently in to some kind of more consistent and
understandable naming of variables.

OPKG_ROOTFS_FEED_WORKDIR
OPKG_ROOTFS_REBUILDINDEX

maybe?

I'd also yes, we should document them.

Cheers,

Richard


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

* Re: [OE-core] [PATCH] rootfs.py: expose prepared_index and ipk_repo_workdir for OpkgPM
  2021-02-05 12:33   ` [OE-core] " Richard Purdie
@ 2021-02-05 14:21     ` Michael Ho
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Ho @ 2021-02-05 14:21 UTC (permalink / raw)
  To: richard.purdie, openembedded-core

Hi RP,

Thanks for the comments. Sounds good to me. I'll send another patchset.

I'll see if I can also set up a renaming patch for the other IPKG variables for
review comments.

Kind regards,
Michael

-- 
BMW Car IT GmbH
Michael Ho
Spezialist Entwicklung – Build and Release Engineering
Lise-Meitner-Straße 14
89081 Ulm

Tel.: ­+49-731-37804-071
Mobil: +49-152-54980-471
Fax: +49-731-37804-001
Mail: michael.ho@bmw-carit.de 
Web: http://www.bmw-carit.de <http://www.bmw-carit.de/>
-------------------------------------------------------------------------
BMW Car IT GmbH
Geschäftsführer: Kai-Uwe Balszuweit und Michael Böttrich
Sitz und Registergericht: München HRB 134810
-------------------------------------------------------------------------
 

On 05.02.21, 13:33, "Richard Purdie" <richard.purdie@linuxfoundation.org> wrote:

    On Fri, 2021-02-05 at 09:51 +0100, Michael Ho wrote:
    > From: Michael Ho <Michael.Ho@bmw.de>
    > 
    > The OpkgPM class has several constructor options that allows for skipping
    > the ipk repository set up and controlling the ipk repository directory. This
    > commit exposes these option via the OpkgRootfs class so others can make use
    > of them if they wish to.
    > 
    > Adds the bitbake variables "IPKGREPO_TARGET_PREPARED" and "IPKGREPO_TARGET"
    > to act as the interfaces.
    > 
    > Signed-off-by: Michael Ho <Michael.Ho@bmw.de>
    > ---
    >  meta/lib/oe/package_manager/ipk/rootfs.py | 14 ++++++++++++--
    >  1 file changed, 12 insertions(+), 2 deletions(-)
    > 
    > diff --git a/meta/lib/oe/package_manager/ipk/rootfs.py b/meta/lib/oe/package_manager/ipk/rootfs.py
    > index 26dbee6..6313b72 100644
    > --- a/meta/lib/oe/package_manager/ipk/rootfs.py
    > +++ b/meta/lib/oe/package_manager/ipk/rootfs.py
    > @@ -129,6 +129,14 @@ class PkgRootfs(DpkgOpkgRootfs):
    >          self.manifest = PkgManifest(d, manifest_dir)
    >          self.opkg_conf = self.d.getVar("IPKGCONF_TARGET")
    >          self.pkg_archs = self.d.getVar("ALL_MULTILIB_PACKAGE_ARCHS")
    > +        self.opkg_repo = self.d.getVar("IPKGREPO_TARGET")
    > +        self.opkg_repo_prepared = self.d.getVar("IPKGREPO_TARGET_PREPARED")
    > +
    > +        kwargs = {}
    > +        if self.opkg_repo:
    > +            kwargs["ipk_repo_workdir"] = self.opkg_repo
    > +        if self.opkg_repo_prepared:
    > +            kwargs["prepare_index"] = False
    >  
    > 

    It seems reasonable to expose them, I'd just suggest that we don't put
    them in self here but do something like:

    +        if self.d.getVar("IPKGREPO_TARGET"):
    +            kwargs["ipk_repo_workdir"] = self.opkg_repo
    +        if self.d.getVar("IPKGREPO_TARGET_PREPARED"):
    +            kwargs["prepare_index"] = False

    and my only other concern is the naming. Somehow we need to get from
    the mess we're currently in to some kind of more consistent and
    understandable naming of variables.

    OPKG_ROOTFS_FEED_WORKDIR
    OPKG_ROOTFS_REBUILDINDEX

    maybe?

    I'd also yes, we should document them.

    Cheers,

    Richard


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

end of thread, other threads:[~2021-02-05 14:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-05  8:51 [PATCH] RFC: rootfs.py: expose prepared_index and ipk_repo_workdir for OpkgPM Michael Ho
2021-02-05  8:51 ` [PATCH] " Michael Ho
2021-02-05 12:33   ` [OE-core] " Richard Purdie
2021-02-05 14:21     ` Michael Ho

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.