[OpenWrt-Devel] Modifying configuration at package install

2015-01-07 Thread Eric Schultz
I'm trying to create an example package. In it, I want the package to modify the IP address of the LAN to 10.0.2.15. If I had access to a running OpenWrt console, I'd use uci set to change the ip address. I'd like to perform this change manually though at package installation time. Is there a way

Re: [OpenWrt-Devel] Modifying configuration at package install

2015-01-07 Thread Matthias Strubel
Hi Eric, yes, you can run scripts at specific points during (un)installation of a package. You can find more information here: http://wiki.openwrt.org/doc/devel/packages I think you want to use the Package/postinst part. Some quickly found examples:

Re: [OpenWrt-Devel] Modifying configuration at package install

2015-01-07 Thread Eric Schultz
Matthias, Thanks for the help. Will these scripts run even if it's the process of creating a new OpenWrt image? Or only if I installed the opkg from inside OpenWrt? I'm looking for a way to change the previously setting on image creation. For example, the setting is initially set to the default

Re: [OpenWrt-Devel] Modifying configuration at package install

2015-01-07 Thread Jo-Philipp Wich
Hi Eric, make your package ship an /etc/uci-defaults/99_custom_settings that executes the appropriate uci set commands. That script is automatically sourced on the first OpenWrt boot and deleted afterwards. Make sure it exits with code 0. You can not rely on postinstall hooks as the network