All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Debugfs fixes with different than default OPKGLIBDIR
@ 2017-03-23 10:34 Martin Jansa
  2017-03-23 10:34 ` [PATCH 1/2] rootfs.py: Respect OPKGLIBDIR variable Martin Jansa
  2017-03-23 10:34 ` [PATCH 2/2] package_manager.py: respect OPKGLIBDIR Martin Jansa
  0 siblings, 2 replies; 5+ messages in thread
From: Martin Jansa @ 2017-03-23 10:34 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit d1d55041e38b12d40f896834b56475ea19a6047f:

  sstate: Ensure installation directory is empty before execution (2017-03-22 10:12:10 +0000)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib jansa/master-rootfs-fix
  http://cgit.openembedded.org/openembedded-core-contrib/log/?h=jansa/master-rootfs-fix

Martin Jansa (2):
  rootfs.py: Respect OPKGLIBDIR variable
  package_manager.py: respect OPKGLIBDIR

 meta/lib/oe/package_manager.py | 21 ++++++++++++++-------
 meta/lib/oe/rootfs.py          |  4 +++-
 2 files changed, 17 insertions(+), 8 deletions(-)

-- 
2.12.0



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

* [PATCH 1/2] rootfs.py: Respect OPKGLIBDIR variable
  2017-03-23 10:34 [PATCH 0/2] Debugfs fixes with different than default OPKGLIBDIR Martin Jansa
@ 2017-03-23 10:34 ` Martin Jansa
  2017-03-23 12:21   ` Martin Jansa
       [not found]   ` <cover.1490271643.git.Martin.Jansa@gmail.com>
  2017-03-23 10:34 ` [PATCH 2/2] package_manager.py: respect OPKGLIBDIR Martin Jansa
  1 sibling, 2 replies; 5+ messages in thread
From: Martin Jansa @ 2017-03-23 10:34 UTC (permalink / raw)
  To: openembedded-core

* when OPKGLIBDIR doesn't have the default /var/lib value it will
  silently fail to copy package database from normal rootfs to debugfs
  rootfs and then when trying to install *-dbg complimentary packages
  it won't install anything, because installed_pkgs.txt file generated
  from debugfs is empty

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta/lib/oe/rootfs.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 5e1c09762a..068b784c51 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -946,7 +946,9 @@ class OpkgRootfs(DpkgOpkgRootfs):
         if self.progress_reporter:
             self.progress_reporter.next_stage()
 
-        self._setup_dbg_rootfs(['/var/lib/opkg'])
+        opkg_lib_dir = self.d.getVar('OPKGLIBDIR', True)
+        opkg_dir = os.path.join(opkg_lib_dir, 'opkg')
+        self._setup_dbg_rootfs([opkg_dir])
 
         execute_pre_post_process(self.d, opkg_post_process_cmds)
 
-- 
2.12.0



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

* [PATCH 2/2] package_manager.py: respect OPKGLIBDIR
  2017-03-23 10:34 [PATCH 0/2] Debugfs fixes with different than default OPKGLIBDIR Martin Jansa
  2017-03-23 10:34 ` [PATCH 1/2] rootfs.py: Respect OPKGLIBDIR variable Martin Jansa
@ 2017-03-23 10:34 ` Martin Jansa
  1 sibling, 0 replies; 5+ messages in thread
From: Martin Jansa @ 2017-03-23 10:34 UTC (permalink / raw)
  To: openembedded-core

* respect it for incremental rootfs generation
* add lists_dir option to opkg.conf
* also fix setting info_dir and status_file when they use default value, the
  problem is that self.opkg_dir is already prefixed with rootfs directory,
  comparing it with /var/lib/opkg always returned false and the options were
  appended to config file unnecessary
* with opkg 0.3.4 we can use VARDIR prefix added in:
  commit d2a8e23dc669adc398f4bb8bcfcabfcf925708f7
  Author: Florin Gherendi <floring2502@gmail.com>
  Date:   Mon Dec 19 12:25:38 2016 +0200
  libopkg: make the /var and /etc directories configurable at compile time.

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta/lib/oe/package_manager.py | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 2a4df61998..389ba7ce05 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -944,13 +944,15 @@ class OpkgPM(OpkgDpkgPM):
                                         self.d.getVar('FEED_DEPLOYDIR_BASE_URI'),
                                         arch))
 
-                        if self.opkg_dir != '/var/lib/opkg':
+                        if self.d.getVar('OPKGLIBDIR') != '/var/lib':
                             # There is no command line option for this anymore, we need to add
                             # info_dir and status_file to config file, if OPKGLIBDIR doesn't have
                             # the default value of "/var/lib" as defined in opkg:
-                            # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_INFO_DIR      "/var/lib/opkg/info"
-                            # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_STATUS_FILE   "/var/lib/opkg/status"
+                            # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_LISTS_DIR     VARDIR "/lib/opkg/lists"
+                            # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_INFO_DIR      VARDIR "/lib/opkg/info"
+                            # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_STATUS_FILE   VARDIR "/lib/opkg/status"
                             cfg_file.write("option info_dir     %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'info'))
+                            cfg_file.write("option lists_dir    %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'lists'))
                             cfg_file.write("option status_file  %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'status'))
 
 
@@ -969,13 +971,15 @@ class OpkgPM(OpkgDpkgPM):
                     config_file.write("src oe-%s file:%s\n" %
                                       (arch, pkgs_dir))
 
-            if self.opkg_dir != '/var/lib/opkg':
+            if self.d.getVar('OPKGLIBDIR') != '/var/lib':
                 # There is no command line option for this anymore, we need to add
                 # info_dir and status_file to config file, if OPKGLIBDIR doesn't have
                 # the default value of "/var/lib" as defined in opkg:
-                # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_INFO_DIR      "/var/lib/opkg/info"
-                # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_STATUS_FILE   "/var/lib/opkg/status"
+                # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_LISTS_DIR     VARDIR "/lib/opkg/lists"
+                # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_INFO_DIR      VARDIR "/lib/opkg/info"
+                # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_STATUS_FILE   VARDIR "/lib/opkg/status"
                 config_file.write("option info_dir     %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'info'))
+                config_file.write("option lists_dir    %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'lists'))
                 config_file.write("option status_file  %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'status'))
 
     def insert_feeds_uris(self, feed_uris, feed_base_paths, feed_archs):
@@ -1131,7 +1135,10 @@ class OpkgPM(OpkgDpkgPM):
 
         # Create an temp dir as opkg root for dummy installation
         temp_rootfs = self.d.expand('${T}/opkg')
-        temp_opkg_dir = os.path.join(temp_rootfs, 'var/lib/opkg')
+        opkg_lib_dir = self.d.getVar('OPKGLIBDIR', True)
+        if opkg_lib_dir[0] == "/":
+            opkg_lib_dir = opkg_lib_dir[1:]
+        temp_opkg_dir = os.path.join(temp_rootfs, opkg_lib_dir, 'opkg')
         bb.utils.mkdirhier(temp_opkg_dir)
 
         opkg_args = "-f %s -o %s " % (self.config_file, temp_rootfs)
-- 
2.12.0



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

* Re: [PATCH 1/2] rootfs.py: Respect OPKGLIBDIR variable
  2017-03-23 10:34 ` [PATCH 1/2] rootfs.py: Respect OPKGLIBDIR variable Martin Jansa
@ 2017-03-23 12:21   ` Martin Jansa
       [not found]   ` <cover.1490271643.git.Martin.Jansa@gmail.com>
  1 sibling, 0 replies; 5+ messages in thread
From: Martin Jansa @ 2017-03-23 12:21 UTC (permalink / raw)
  To: openembedded-core

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

On Thu, Mar 23, 2017 at 11:34:22AM +0100, Martin Jansa wrote:
> * when OPKGLIBDIR doesn't have the default /var/lib value it will
>   silently fail to copy package database from normal rootfs to debugfs
>   rootfs and then when trying to install *-dbg complimentary packages
>   it won't install anything, because installed_pkgs.txt file generated
>   from debugfs is empty
> 
> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> ---
>  meta/lib/oe/rootfs.py | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
> index 5e1c09762a..068b784c51 100644
> --- a/meta/lib/oe/rootfs.py
> +++ b/meta/lib/oe/rootfs.py
> @@ -946,7 +946,9 @@ class OpkgRootfs(DpkgOpkgRootfs):
>          if self.progress_reporter:
>              self.progress_reporter.next_stage()
>  
> -        self._setup_dbg_rootfs(['/var/lib/opkg'])
> +        opkg_lib_dir = self.d.getVar('OPKGLIBDIR', True)

I can drop True here, v2 coming.

> +        opkg_dir = os.path.join(opkg_lib_dir, 'opkg')
> +        self._setup_dbg_rootfs([opkg_dir])
>  
>          execute_pre_post_process(self.d, opkg_post_process_cmds)
>  
> -- 
> 2.12.0
> 

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 201 bytes --]

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

* [PATCHv2 1/2] rootfs.py: Respect OPKGLIBDIR variable
       [not found]   ` <cover.1490271643.git.Martin.Jansa@gmail.com>
@ 2017-03-23 12:21     ` Martin Jansa
  0 siblings, 0 replies; 5+ messages in thread
From: Martin Jansa @ 2017-03-23 12:21 UTC (permalink / raw)
  To: openembedded-core

* when OPKGLIBDIR doesn't have the default /var/lib value it will
  silently fail to copy package database from normal rootfs to debugfs
  rootfs and then when trying to install *-dbg complimentary packages
  it won't install anything, because installed_pkgs.txt file generated
  from debugfs is empty

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta/lib/oe/rootfs.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 5e1c09762a..96591f370e 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -946,7 +946,9 @@ class OpkgRootfs(DpkgOpkgRootfs):
         if self.progress_reporter:
             self.progress_reporter.next_stage()
 
-        self._setup_dbg_rootfs(['/var/lib/opkg'])
+        opkg_lib_dir = self.d.getVar('OPKGLIBDIR')
+        opkg_dir = os.path.join(opkg_lib_dir, 'opkg')
+        self._setup_dbg_rootfs([opkg_dir])
 
         execute_pre_post_process(self.d, opkg_post_process_cmds)
 
-- 
2.12.0



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

end of thread, other threads:[~2017-03-23 12:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-23 10:34 [PATCH 0/2] Debugfs fixes with different than default OPKGLIBDIR Martin Jansa
2017-03-23 10:34 ` [PATCH 1/2] rootfs.py: Respect OPKGLIBDIR variable Martin Jansa
2017-03-23 12:21   ` Martin Jansa
     [not found]   ` <cover.1490271643.git.Martin.Jansa@gmail.com>
2017-03-23 12:21     ` [PATCHv2 " Martin Jansa
2017-03-23 10:34 ` [PATCH 2/2] package_manager.py: respect OPKGLIBDIR Martin Jansa

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.