dskvr / opkg

Automatically exported from code.google.com/p/opkg
0 stars 0 forks source link

In offline-root mode on target device update the /usr/lib/opkg/status from installed to unpacked so opkg configure will run postinst #82

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
We are updating a rootfs on our target system that is an alternate installation 
of our active rootfs.  We end up scanning the /usr/lib/info for changes files 
on the targeted rootfs (inactive) to run the opkg flags unpack.  When we boot 
to the inactive rootfs (install targeted rootfs), the S98configure will run the 
opkg configure, if we do not set the unpacked flag our postinst will not run.  
I would like this to be automatically done in opkg when doing an offline-root 
install.

Original issue reported on code.google.com by craig.ma...@gmail.com on 1 Oct 2011 at 1:34

GoogleCodeExporter commented 8 years ago
Does the below patch produce the behaviour you want?

diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c
index d742d7b..6160b79 100644
--- a/libopkg/opkg_cmd.c
+++ b/libopkg/opkg_cmd.c
@@ -412,6 +412,10 @@ opkg_configure_packages(char *pkg_name)
      opkg_intercept_t ic;
      int r, err = 0;

+     if (conf->offline_root && !conf->force_postinstall) {
+         opkg_msg(INFO, "Offline root mode: not configuring unpacked 
packages.\n");
+         return 0;
+     }
      opkg_msg(INFO, "Configuring unpacked packages.\n");

      all = pkg_vec_alloc();

Original comment by graham.g...@gmail.com on 11 Oct 2011 at 11:30

GoogleCodeExporter commented 8 years ago
This works great.  Thanks for the fix.

Original comment by craig.ma...@gmail.com on 12 Oct 2011 at 3:10

GoogleCodeExporter commented 8 years ago

Original comment by graham.g...@gmail.com on 13 Oct 2011 at 3:25