Hi Joachim,

thank you very much for your help, I will try to expand this discussion more, maybe it will be useful for other maintainers too.

First solution is probably easiest, but for modified images, not packages. You are right.

Second solution rely on third party default config. Analysing config files of Asterisk or other software is not so easy. And there can be many changes between revisions. We do not want this because we will overwrite most of them by our files "from scratch". I understand that script with analysing solution is probably "cleanest" but for small number of changes, not for copying new files from scratch.

Today, we are using third solution. It means, we have all config files in skel directory and it is copied during firstboot (yes, we did not test this and I am not sure if it will work or we have to use our "logic" to test if it was already copied). We will use ucidefaults for all things which are uci compatible, but for other configs, we will probably just copy defaults into place during firstboot.

When speaking about firstboot and postinst, I have another thread to discuss, but I will write another email to have one thing per thread.

Thank you,
Lukas

Dne 8.8.2011 18:22, Joachim Schlipper napsal(a):
Hi Lukas,

as far as I can see, you have three options of how to overwrite package
config files:

First, you can just create a "files" folder in your buildroot folder.
Every file you place there
will be copied over automatically right before building the image and
after all packages
have been built. This is a good way to replace files from packages with
your own files,
but doesn't help you when you just want to modify a few entries in a
config file.
Also, when you build your package as module and you want to install it
later onto the
router, that doesn't work either.

Second, you can build a script into your package and have that executed
the first time
the device boots (/etc/ucidefaults as Chris already wrote). There you
can use complex
scripts that don't just overwrite other files but may instead analyze
and modify them
(i.e. add custom firewall rules without deleting the previous ones).
This doesn't work
either when you want to install your package modular, because the device
already
did its first boot and your script won't get executed.

Third, if you want your package to modify files upon installation, you
can create a
post-install script, which will be executed when the package is
installed on the device
via opkg. But that won't work when you want to integrate your package
into the
firmware image.

So, the way of doing highly depends of how you want your package to be
installed.

Hope I could help
Joachim


On 08/06/2011 03:47 PM, Lukas Macura wrote:
Hi to all,

please I would want to open discussion about creating more complex
package which needs to overwrite configs of other packages. I want to
find "clean" way to do this.

I will try to explain. We are creating BESIP (Bright Embedded Solution
for IP Telephony). Entire project is based on OpenWrt and is open. We
will give all our work to OpenWrt community back. I will inform about
some "stable" packages later here. For example, we are working on
kamailio3, yuma(netconfd), libssh, libssh2, snortsam, ipqbdb.

Package besip consists of dependencies to other openwrt packages and
options. That's OK. But we need to overwrite some config files (like
asterisk18 configs).

Today we are using our config tree which is part of package but is
located under /etc/besip/etcdefault/ . During boot, we added firstboot
entry which will copy needed files in right place and overwrite other
configs. Because if we make package with same config files, it is not
possible to install due to overwriting configs of other packages.

Did somebody solved this before? Or is there some clean way to achieve this?

Thank you for any help!

With regards,
Lukas Macura

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to