Skip to contentSkip to conversation

rootfs.py: fix PRE/POSTPROCESS_COMMANDS for rpm and deb

PATCH In review Robert Yang 3 participants 8 messages Sep 9, 2014 – Oct 20, 2014

lore
Share & tools
lore
#0 lore raw

cover rootfs.py: fix PRE/POSTPROCESS_COMMANDS for rpm and deb

Hello,

This patch fixes RPM_PREPROCESS_COMMANDS and RPM_POSTPROCESS_COMMANDS (the similar to deb).

Btw., there is another ROOTFS_POSTINSTALL_COMMAND, only the ipk's install runs it atm, what's the difference between ROOTFS_POSTINSTALL_COMMAND and ROOTFS_POSTPROCESS_COMMAND? Do we need rpm and deb run it, please ?

// Robert

The following changes since commit e72aac2ae9e5fce1715fa04b7e94034fd06892d9:

alsa-lib: libasound should runtime depends on alsa-conf (2014-09-03 11:30:11 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib rbt/post
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/post

Robert Yang (1):
rootfs.py: fix PRE/POSTPROCESS_COMMANDS for rpm and deb

 meta/lib/oe/rootfs.py |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 rootfs.py: fix PRE/POSTPROCESS_COMMANDS for rpm and deb

The rpm didn't run RPM_PREPROCESS_COMMANDS or RPM_POSTPROCESS_COMMANDS, the similar to deb, this patch fix the problem.

And fix a typo:
DEB_POSTPROCESS_COMMAND -> DEB_POSTPROCESS_COMMANDS

---
 meta/lib/oe/rootfs.py |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
meta/lib/oe/rootfs.py +13 -1
index 0424a01..ed2af80 100644
@@ -295,10 +295,14 @@ class RpmRootfs(Rootfs):
 
     def _create(self):
         pkgs_to_install = self.manifest.parse_initial_manifest()
+        rpm_pre_process_cmds = self.d.getVar('RPM_PREPROCESS_COMMANDS', True)
+        rpm_post_process_cmds = self.d.getVar('RPM_POSTPROCESS_COMMANDS', True)
 
         # update PM index files
         self.pm.write_index()
 
+        execute_pre_post_process(self.d, rpm_pre_process_cmds)
+
         self.pm.dump_all_available_pkgs()
 
         if self.inc_rpm_image_gen == "1":
@@ -320,6 +324,8 @@ class RpmRootfs(Rootfs):
 
         self.pm.install_complementary()
 
+        execute_pre_post_process(self.d, rpm_post_process_cmds)
+
         self._log_check()
 
         if self.inc_rpm_image_gen == "1":
@@ -401,6 +407,8 @@ class DpkgRootfs(Rootfs):
 
     def _create(self):
         pkgs_to_install = self.manifest.parse_initial_manifest()
+        deb_pre_process_cmds = self.d.getVar('DEB_PREPROCESS_COMMANDS', True)
+        deb_post_process_cmds = self.d.getVar('DEB_POSTPROCESS_COMMANDS', True)
 
         alt_dir = self.d.expand("${IMAGE_ROOTFS}/var/lib/dpkg/alternatives")
         bb.utils.mkdirhier(alt_dir)
@@ -408,6 +416,8 @@ class DpkgRootfs(Rootfs):
         # update PM index files
         self.pm.write_index()
 
+        execute_pre_post_process(self.d, deb_pre_process_cmds)
+
         self.pm.update()
 
         for pkg_type in self.install_order:
@@ -423,9 +433,11 @@ class DpkgRootfs(Rootfs):
 
         self.pm.run_pre_post_installs()
 
+        execute_pre_post_process(self.d, deb_post_process_cmds)
+
     @staticmethod
     def _depends_list():
-        return ['DEPLOY_DIR_DEB', 'DEB_SDK_ARCH', 'APTCONF_TARGET', 'APT_ARGS', 'DPKG_ARCH', 'DEB_PREPROCESS_COMMANDS', 'DEB_POSTPROCESS_COMMAND']
+        return ['DEPLOY_DIR_DEB', 'DEB_SDK_ARCH', 'APTCONF_TARGET', 'APT_ARGS', 'DPKG_ARCH', 'DEB_PREPROCESS_COMMANDS', 'DEB_POSTPROCESS_COMMANDS']
 
     def _get_delayed_postinsts(self):
         pkg_list = []
Signature · 1 line
1.7.9.5
#2 lore raw

Ping, I think that we need it since it is a function lost.

// Robert

Quoted 71 lines · Robert Yang

The rpm didn't run RPM_PREPROCESS_COMMANDS or RPM_POSTPROCESS_COMMANDS, the similar to deb, this patch fix the problem.

And fix a typo:
DEB_POSTPROCESS_COMMAND -> DEB_POSTPROCESS_COMMANDS

---
  meta/lib/oe/rootfs.py |   14 +++++++++++++-
  1 file changed, 13 insertions(+), 1 deletion(-)
meta/lib/oe/rootfs.py +13 -1
index 0424a01..ed2af80 100644
@@ -295,10 +295,14 @@ class RpmRootfs(Rootfs):
 
      def _create(self):
          pkgs_to_install = self.manifest.parse_initial_manifest()
+        rpm_pre_process_cmds = self.d.getVar('RPM_PREPROCESS_COMMANDS', True)
+        rpm_post_process_cmds = self.d.getVar('RPM_POSTPROCESS_COMMANDS', True)
 
          # update PM index files
          self.pm.write_index()
 
+        execute_pre_post_process(self.d, rpm_pre_process_cmds)
+
          self.pm.dump_all_available_pkgs()
 
          if self.inc_rpm_image_gen == "1":
@@ -320,6 +324,8 @@ class RpmRootfs(Rootfs):
 
          self.pm.install_complementary()
 
+        execute_pre_post_process(self.d, rpm_post_process_cmds)
+
          self._log_check()
 
          if self.inc_rpm_image_gen == "1":
@@ -401,6 +407,8 @@ class DpkgRootfs(Rootfs):
 
      def _create(self):
          pkgs_to_install = self.manifest.parse_initial_manifest()
+        deb_pre_process_cmds = self.d.getVar('DEB_PREPROCESS_COMMANDS', True)
+        deb_post_process_cmds = self.d.getVar('DEB_POSTPROCESS_COMMANDS', True)
 
          alt_dir = self.d.expand("${IMAGE_ROOTFS}/var/lib/dpkg/alternatives")
          bb.utils.mkdirhier(alt_dir)
@@ -408,6 +416,8 @@ class DpkgRootfs(Rootfs):
          # update PM index files
          self.pm.write_index()
 
+        execute_pre_post_process(self.d, deb_pre_process_cmds)
+
          self.pm.update()
 
          for pkg_type in self.install_order:
@@ -423,9 +433,11 @@ class DpkgRootfs(Rootfs):
 
          self.pm.run_pre_post_installs()
 
+        execute_pre_post_process(self.d, deb_post_process_cmds)
+
      @staticmethod
      def _depends_list():
-        return ['DEPLOY_DIR_DEB', 'DEB_SDK_ARCH', 'APTCONF_TARGET', 'APT_ARGS', 'DPKG_ARCH', 'DEB_PREPROCESS_COMMANDS', 'DEB_POSTPROCESS_COMMAND']
+        return ['DEPLOY_DIR_DEB', 'DEB_SDK_ARCH', 'APTCONF_TARGET', 'APT_ARGS', 'DPKG_ARCH', 'DEB_PREPROCESS_COMMANDS', 'DEB_POSTPROCESS_COMMANDS']
 
      def _get_delayed_postinsts(self):
          pkg_list = []
#3 lore raw
Quoted 1 line · Robert Yang

Ping, I think that we need it since it is a function lost.

If we're going to unify the behaviour - which is a good thing - then ROOTFS_POSTPROCESS_COMMAND needs to be unified too.

Ross

#4 lore raw
Quoted 5 lines · Ross
Quoted 1 line · Robert Yang

Ping, I think that we need it since it is a function lost.

If we're going to unify the behaviour - which is a good thing - then ROOTFS_POSTPROCESS_COMMAND needs to be unified too.

The ROOTFS_POSTPROCESS_COMMAND works well, there isn't anything wrong with it, did you mean the ROOTFS_POSTINSTALL_COMMAND ? I don't know the difference between ROOTFS_POSTINSTALL_COMMAND and ROOTFS_POSTPROCESS_COMMAND, maybe we need remove ROOTFS_POSTINSTALL_COMMAND ?

// Robert

Quoted 4 lines

Ross

#5 lore raw
Quoted 6 lines · Robert Yang
Quoted 3 lines · Ross
Quoted 1 line · Robert Yang

Ping, I think that we need it since it is a function lost.

Quoted 8 lines
Quoted 2 lines

If we're going to unify the behaviour - which is a good thing - then ROOTFS_POSTPROCESS_COMMAND needs to be unified too.

The ROOTFS_POSTPROCESS_COMMAND works well, there isn't anything wrong with it, did you mean the ROOTFS_POSTINSTALL_COMMAND ? I don't know the difference between ROOTFS_POSTINSTALL_COMMAND and ROOTFS_POSTPROCESS_COMMAND, maybe we need remove ROOTFS_POSTINSTALL_COMMAND ?

Hi Ross,

Any comments on this, please ?

// Robert

Quoted 6 lines

// Robert

Quoted 4 lines

Ross

#6 lore raw
In reply to Robert Yang
Quoted 2 lines · Robert Yang

The rpm didn't run RPM_PREPROCESS_COMMANDS or RPM_POSTPROCESS_COMMANDS, the similar to deb, this patch fix the problem.

I'm not sure I understand this... The pre/post process commands are run in the abstract class Rootfs create() method, which is inherited by all backends. The create_rootfs() function calls the create() method for each backend. So, these have to execute. Unless, there is something else going on, which has to be properly fixed.

Quoted 3 lines

And fix a typo:
DEB_POSTPROCESS_COMMAND -> DEB_POSTPROCESS_COMMANDS

this change is ok.

Quoted 73 lines
---
 meta/lib/oe/rootfs.py |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
meta/lib/oe/rootfs.py +13 -1
index 0424a01..ed2af80 100644
@@ -295,10 +295,14 @@ class RpmRootfs(Rootfs):
 
     def _create(self):
         pkgs_to_install = self.manifest.parse_initial_manifest()
+        rpm_pre_process_cmds = self.d.getVar('RPM_PREPROCESS_COMMANDS', True)
+        rpm_post_process_cmds = self.d.getVar('RPM_POSTPROCESS_COMMANDS', True)
 
         # update PM index files
         self.pm.write_index()
 
+        execute_pre_post_process(self.d, rpm_pre_process_cmds)
+
         self.pm.dump_all_available_pkgs()
 
         if self.inc_rpm_image_gen == "1":
@@ -320,6 +324,8 @@ class RpmRootfs(Rootfs):
 
         self.pm.install_complementary()
 
+        execute_pre_post_process(self.d, rpm_post_process_cmds)
+
         self._log_check()
 
         if self.inc_rpm_image_gen == "1":
@@ -401,6 +407,8 @@ class DpkgRootfs(Rootfs):
 
     def _create(self):
         pkgs_to_install = self.manifest.parse_initial_manifest()
+        deb_pre_process_cmds = self.d.getVar('DEB_PREPROCESS_COMMANDS', True)
+        deb_post_process_cmds = self.d.getVar('DEB_POSTPROCESS_COMMANDS', True)
 
         alt_dir = self.d.expand("${IMAGE_ROOTFS}/var/lib/dpkg/alternatives")
         bb.utils.mkdirhier(alt_dir)
@@ -408,6 +416,8 @@ class DpkgRootfs(Rootfs):
         # update PM index files
         self.pm.write_index()
 
+        execute_pre_post_process(self.d, deb_pre_process_cmds)
+
         self.pm.update()
 
         for pkg_type in self.install_order:
@@ -423,9 +433,11 @@ class DpkgRootfs(Rootfs):
 
         self.pm.run_pre_post_installs()
 
+        execute_pre_post_process(self.d, deb_post_process_cmds)
+
     @staticmethod
     def _depends_list():
-        return ['DEPLOY_DIR_DEB', 'DEB_SDK_ARCH', 'APTCONF_TARGET', 'APT_ARGS', 'DPKG_ARCH', 'DEB_PREPROCESS_COMMANDS', 'DEB_POSTPROCESS_COMMAND']
+        return ['DEPLOY_DIR_DEB', 'DEB_SDK_ARCH', 'APTCONF_TARGET', 'APT_ARGS', 'DPKG_ARCH', 'DEB_PREPROCESS_COMMANDS', 'DEB_POSTPROCESS_COMMANDS']
 
     def _get_delayed_postinsts(self):
         pkg_list = []
Signature · 7 lines
1.7.9.5

-- 
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
#7 lore raw

My bad... I saw it now... It's about backend specific pre/post commands.

Sorry for the noise.

laurentiu

Quoted 92 lines · Laurentiu Palcu
Quoted 2 lines · Robert Yang

The rpm didn't run RPM_PREPROCESS_COMMANDS or RPM_POSTPROCESS_COMMANDS, the similar to deb, this patch fix the problem.

I'm not sure I understand this... The pre/post process commands are run in the abstract class Rootfs create() method, which is inherited by all backends. The create_rootfs() function calls the create() method for each backend. So, these have to execute. Unless, there is something else going on, which has to be properly fixed.

Quoted 3 lines

And fix a typo:
DEB_POSTPROCESS_COMMAND -> DEB_POSTPROCESS_COMMANDS

this change is ok.

Quoted 73 lines
---
 meta/lib/oe/rootfs.py |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
meta/lib/oe/rootfs.py +13 -1
index 0424a01..ed2af80 100644
@@ -295,10 +295,14 @@ class RpmRootfs(Rootfs):
 
     def _create(self):
         pkgs_to_install = self.manifest.parse_initial_manifest()
+        rpm_pre_process_cmds = self.d.getVar('RPM_PREPROCESS_COMMANDS', True)
+        rpm_post_process_cmds = self.d.getVar('RPM_POSTPROCESS_COMMANDS', True)
 
         # update PM index files
         self.pm.write_index()
 
+        execute_pre_post_process(self.d, rpm_pre_process_cmds)
+
         self.pm.dump_all_available_pkgs()
 
         if self.inc_rpm_image_gen == "1":
@@ -320,6 +324,8 @@ class RpmRootfs(Rootfs):
 
         self.pm.install_complementary()
 
+        execute_pre_post_process(self.d, rpm_post_process_cmds)
+
         self._log_check()
 
         if self.inc_rpm_image_gen == "1":
@@ -401,6 +407,8 @@ class DpkgRootfs(Rootfs):
 
     def _create(self):
         pkgs_to_install = self.manifest.parse_initial_manifest()
+        deb_pre_process_cmds = self.d.getVar('DEB_PREPROCESS_COMMANDS', True)
+        deb_post_process_cmds = self.d.getVar('DEB_POSTPROCESS_COMMANDS', True)
 
         alt_dir = self.d.expand("${IMAGE_ROOTFS}/var/lib/dpkg/alternatives")
         bb.utils.mkdirhier(alt_dir)
@@ -408,6 +416,8 @@ class DpkgRootfs(Rootfs):
         # update PM index files
         self.pm.write_index()
 
+        execute_pre_post_process(self.d, deb_pre_process_cmds)
+
         self.pm.update()
 
         for pkg_type in self.install_order:
@@ -423,9 +433,11 @@ class DpkgRootfs(Rootfs):
 
         self.pm.run_pre_post_installs()
 
+        execute_pre_post_process(self.d, deb_post_process_cmds)
+
     @staticmethod
     def _depends_list():
-        return ['DEPLOY_DIR_DEB', 'DEB_SDK_ARCH', 'APTCONF_TARGET', 'APT_ARGS', 'DPKG_ARCH', 'DEB_PREPROCESS_COMMANDS', 'DEB_POSTPROCESS_COMMAND']
+        return ['DEPLOY_DIR_DEB', 'DEB_SDK_ARCH', 'APTCONF_TARGET', 'APT_ARGS', 'DPKG_ARCH', 'DEB_PREPROCESS_COMMANDS', 'DEB_POSTPROCESS_COMMANDS']
 
     def _get_delayed_postinsts(self):
         pkg_list = []
Signature · 7 lines
1.7.9.5

-- 
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Signature · 4 lines
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core