[pisa-src] r1748 - in trunk/openwrt: package/pisa/Makefile package/pisa/files/pisaautoconf.init router-configurations/auto-asus/etc/rc.local router-configurations/auto-asus/etc/rc.local.default

  • From: Jahn Bertsch <jahn.bertsch@xxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Mon, 23 Nov 2009 18:18:53 +0100

Author: bertsch
Date: Mon Nov 23 18:18:53 2009
New Revision: 1748

Log:
It's simpler to use /etc/rc.local for the autconf script instead of a OpenWRT
package.

When using a package, this package is also included in firmware images which do
not want to use the autoconfiguration at all.

Now on first boot /etc/rc.local is called and does the configuration, then
rc.local is overwritten with rc.local.default and then the router is rebooted
to apply the configuration changes.

The autoconf script in /etc/rc.local is stored in
pisa/openwrt/router-configurations/auto-asus and thus only included when using
this directory with configure_router.sh

Added:
   trunk/openwrt/router-configurations/auto-asus/etc/rc.local   (contents, 
props changed)
      - copied, changed from r1747, 
trunk/openwrt/package/pisa/files/pisaautoconf.init
   trunk/openwrt/router-configurations/auto-asus/etc/rc.local.default   
(contents, props changed)
Deleted:
   trunk/openwrt/package/pisa/files/pisaautoconf.init
Modified:
   trunk/openwrt/package/pisa/Makefile

Modified: trunk/openwrt/package/pisa/Makefile
==============================================================================
--- trunk/openwrt/package/pisa/Makefile Mon Nov 23 17:35:16 2009        (r1747)
+++ trunk/openwrt/package/pisa/Makefile Mon Nov 23 18:18:53 2009        (r1748)
@@ -125,20 +125,6 @@
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/pisasd $(1)/usr/sbin/
 endef
 
-define Package/pisa-autoconf
-$(call Package/pisa/Default)
-  TITLE:=PISA autoconf script
-endef
-
-define Package/pisa-autoconf/description
- This package contains a script which automatically configures a router for 
use with pisa
- on first boot. Configuration is read from a webserver.
-endef
-
-define Package/pisa-autoconf/install
-       $(INSTALL_BIN) ./files/pisa-autoconf.init $(1)/etc/init.pisa-autoconf
-endef
-
 $(eval $(call BuildPackage,pisa))
 $(eval $(call BuildPackage,libpisa))
 $(eval $(call BuildPackage,pisa-beacon))

Copied and modified: trunk/openwrt/router-configurations/auto-asus/etc/rc.local 
(from r1747, trunk/openwrt/package/pisa/files/pisaautoconf.init)
==============================================================================
--- trunk/openwrt/package/pisa/files/pisaautoconf.init  Mon Nov 23 17:35:16 
2009        (r1747, copy source)
+++ trunk/openwrt/router-configurations/auto-asus/etc/rc.local  Mon Nov 23 
18:18:53 2009        (r1748)
@@ -1,4 +1,4 @@
-#!/bin/sh /etc/rc.common
+#!/bin/sh
 #
 # PISA Autoconf
 # This script configures a router on first boot for use within the PISA
@@ -14,14 +14,10 @@
 #
 # Relies on the '-i' GNU extension for sed.
 
-START=100
-STOP=100
-
 replace () {
     sed -i "s/$2/$3/g" $1
 }
 
-start() {
 echo "PISA autoconf"
 
 ### get mac ###
@@ -59,9 +55,7 @@
 
 
 ### self destruct ###
-rm $0
-}
+mv /etc/rc.local.default /etc/rc.local
 
-stop {
-
-}
+### apply changes ###
+reboot

Added: trunk/openwrt/router-configurations/auto-asus/etc/rc.local.default
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ trunk/openwrt/router-configurations/auto-asus/etc/rc.local.default  Mon Nov 
23 18:18:53 2009        (r1748)
@@ -0,0 +1,4 @@
+# Put your custom commands here that should be executed once
+# the system init finished. By default this file does nothing.
+
+exit 0

Other related posts:

  • » [pisa-src] r1748 - in trunk/openwrt: package/pisa/Makefile package/pisa/files/pisaautoconf.init router-configurations/auto-asus/etc/rc.local router-configurations/auto-asus/etc/rc.local.default - Jahn Bertsch