Hi Ithamar,
no, our problem is not uci-defaults. I will try to give some real
examples, because 1 example is better than 1000 words ;)
- You want to install some sql server into image. And you want to
preinit its database by some default data. You cannot do this during
image creation. You need to do it later.
- You want to overwrite configs of asterisk18 package. But not
/etc/config/asterisk , which belongs to uci, but /etc/asterisk because
your config system will use another mappings to db. Yes, maybe it does
not look clean but believe me it can be needed if you are making bigger
package with another (higher) config possibility.
- You want to create sqlite database and put some defaults there. Again,
during image creation, you have some /var, but it is not /var of real
system. You need to postpone this creation and do it after real /var is
mounted. And I am not speaking about binary compatibility if you would
want to create it on host system..
So, I really do not want to SPAM on this conference, but my question is:
- Should OpenWrt take care of this scenarios? Or it is package specific
and every package which needs things like this should do it by itself?
There are four scenarios and we want to choose best one:
- implement it in application by its way
- implement some delayed postinst in opkg (sounds like bigger hack)
- implement using hook to firstboot() (but in that case, it will not
work as module)
- create some /lib/postinst.sh with functions like was_run() ,
var_mounted(), ... and postinst scripts can use this like this:
#!/bin/sh
[ -f /lib/postinst.sh ] {
. /lib/postinst.sh
if var_mounted; then
if ! was_run packagename; then
do_something_usefull
fi
fi
}
And init script whic
Thank you,
Lukas
Dne 9.8.2011 03:44, Ithamar R. Adema napsal(a):
On Mon, 2011-08-08 at 20:50 +0200, Lukas Macura wrote:
I know this is little bit more complicated, but maybe it could be used
by more packages to do something useful only one time and only in real
device (like copying some files in right place or analysing target
system to modify them). What are you thinking about this?
Sounds like /etc/uci-defaults to me ;-)
Ithamar.
_______________________________________________
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