On Wed, Oct 23, 2013 at 06:39:01PM -0400, Sam Burnett wrote:
> 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?
> 


Another option is to update the opkg.conf in
bismark-openwrt-overlay/files to contain the new signature lines. Then
only let the postinstall hook do anything if it's installed as a package
(i.e., when IPKG_INSTROOT is null.)

The idea here is that lancre can provide the correct opkg.conf file by
default, but we still need bismark-opkg-keys to update opkg.conf when we
deploy it to quirm routers.


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