Re: [OpenWrt-Devel] Clean way of adding custom scripts and firstrun
@ Ithamar Thank you. That is well understood. However, when you write a script to automate a router configuration that should be working cross platform, then you cannot preconfigure the wireless configuration with a static file. First you cannot make assumptions about the hardware present, it could be anything, so you have to allow the system to go through the process of discovery it goes through, when first writing the /etc/config/wireless file. You would also loose router specific configuration, as for the nanostation, or for the various profiles for the ar71xx chipset. You actually want to take up what was preconfigured there, and add, but not remove as you would loose the benefit of the device specific configuration. Consequently a process running after /etc/config/network boot is what is required. @ Jo-Philip The process triggered in /etc/init.d/boot is a great pointer. Thank You. I am toying with the thought of adding a boot command in one of my own start-up scripts, like /etc/init.d/xyz boot Could I just confirm when the init scripts triggered by boot are running: Does the system first run through all boot commands and then through all start commands or does the system run through all scripts in the order given in /etc/rc.d running the boot command first and then the start command for each init script in turn? Please advise. Thank You -Original Message- From: openwrt-devel-boun...@lists.openwrt.org [mailto:openwrt-devel-boun...@lists.openwrt.org] On Behalf Of Ithamar R. Adema Sent: Saturday, 29 January 2011 1:47 a.m. To: OpenWrt Development List Subject: Re: [OpenWrt-Devel] Clean way of adding custom scripts and firstrun On Fri, 2011-01-28 at 11:28 +1300, Hanno Schupp wrote: I am asking as some configuration like network and wireless may be set by the system on boot, so if one would like to add to the /etc/config/wireless configuration (i.e. by setting the power to max possible or, setting diversity etc.) then this is not possible, as the /etc/config/wireless file does not exist before /etc/init.d scripts are fired. So this means one would be looking for a first-boot-script facility that is triggered after /etc/init.d is all completed. Does this facility exist? For the example of the wireless configuration file, it will not be generated if it already exists. So if you need to preconfigure it, you could write it out in the uci-defaults script and have the network init.d script pick the generated configuration up and use it. HTH, 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
[OpenWrt-Devel] Clean way of adding custom scripts and firstrun
I have some noob questions. What's the clean way of: 1) adding custom configuration (running custom scripts) on first boot. 2) adding custom files to the openwrt tree on compile. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Clean way of adding custom scripts and firstrun
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi. What's the clean way of: 1) adding custom configuration (running custom scripts) on first boot. /etc/uci-defaults/foo.sh, a script which can contain arbritary commands, its deleted by the system after it was invoked once. 2) adding custom files to the openwrt tree on compile. in the toplevel dir: files/, e.g. files/etc/passwd ~ Jow -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk1BsoEACgkQdputYINPTPNq3gCfcuU1GR2EhgvzqcLjJX2tjD2Q 0F0AnjW8BKUmwDb7LhmoJpKrCzEBH6Ai =yAdv -END PGP SIGNATURE- ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Clean way of adding custom scripts and firstrun
Re the /etc/uci-defaults/ scripts: That is a very interesting feature. Two follow up[ questions: 1) do these scripts require the same /etc/rc.common format as the files in /etc/init.d folder or are they just straight shell scripts? 2) when are they called exactly? before or after the init.d scripts, or can this be configured? I am asking as some configuration like network and wireless may be set by the system on boot, so if one would like to add to the /etc/config/wireless configuration (i.e. by setting the power to max possible or, setting diversity etc.) then this is not possible, as the /etc/config/wireless file does not exist before /etc/init.d scripts are fired. So this means one would be looking for a first-boot-script facility that is triggered after /etc/init.d is all completed. Does this facility exist? Thank You. On 28 January 2011 06:59, Jo-Philipp Wich x...@subsignal.org wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi. What's the clean way of: 1) adding custom configuration (running custom scripts) on first boot. /etc/uci-defaults/foo.sh, a script which can contain arbritary commands, its deleted by the system after it was invoked once. 2) adding custom files to the openwrt tree on compile. in the toplevel dir: files/, e.g. files/etc/passwd ~ Jow -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk1BsoEACgkQdputYINPTPNq3gCfcuU1GR2EhgvzqcLjJX2tjD2Q 0F0AnjW8BKUmwDb7LhmoJpKrCzEBH6Ai =yAdv -END PGP SIGNATURE- ___ 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
Re: [OpenWrt-Devel] Clean way of adding custom scripts and firstrun
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi. 1) do these scripts require the same /etc/rc.common format as the files in /etc/init.d folder or are they just straight shell scripts? Plain shell scripts, no dependencies. 2) when are they called exactly? before or after the init.d scripts, or can this be configured? They're called in /etc/init.d/boot, after the rootfs has been mounted but before modules and hotplug are loaded. I am asking as some configuration like network and wireless may be set by the system on boot, so if one would like to add to the /etc/config/wireless configuration (i.e. by setting the power to max possible or, setting diversity etc.) then this is not possible, as the /etc/config/wireless file does not exist before /etc/init.d scripts are fired. So this means one would be looking for a first-boot-script facility that is triggered after /etc/init.d is all completed. Does this facility exist? Nope. ~ Jow -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk1B8iIACgkQdputYINPTPPyuwCfWOdG5G5YWXzwGfm88h+2IAv5 a5cAnjK9OGlCUuWhTIK6r6D93RoB9VU3 =XkbY -END PGP SIGNATURE- ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel