On Wed, Oct 23, 2013 at 03:23:48PM -0700, ggmartins wrote:
> > @@ -3649,6 +3649,7 @@ CONFIG_PACKAGE_bismark-extras=m
> >  CONFIG_PACKAGE_bismark-health=y
> >  CONFIG_PACKAGE_bismark-mgmt=y
> >  CONFIG_PACKAGE_bismark-netexp=y
> > +CONFIG_PACKAGE_bismark-opkg-keys=m
> 
> I'm running some tests and It seems that the dependency ( DEPENDS:=+opkg-bismark +opkg ) order respects the compilation but not the running order of post install scripts
> cat  $${IPKG_INSTROOT}/etc/opkg.conf >>/tmp/log.txt
> this file wasn't there and returned a post-install script error when running make.
> According to http://wiki.openwrt.org/doc/devel/packages#dependency.types it should.
> Any insights on this one?


Typically I solve problems like this by moving functionality from the
post-install hook into a script which will get run on first boot. See
the postinstall hook for bismark-updater and the associated uci-defaults
script:

https://github.com/projectbismark/bismark-packages/blob/master/utils/bismark-updater/Makefile#L44
https://github.com/projectbismark/bismark-packages/blob/master/utils/bismark-updater/files/etc/uci-defaults/bismark-updater

As you can see, if the package is built into the image then
IPKG_INSTROOT will not be null, so the postinstall hook will not do
anything but the script in uci-default will run on the first boot of the
router. On the other hand, if the package is installed later (as an ipk)
then IPKG_INSTROOT will be null and it will run (and then remove) the
uci-defaults script manually during the post-install hook.

Make sense?


> 
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/projectbismark/bismark-openwrt-overlay/pull/10/files#r7173992