Просмотр исходного кода

base-files: introduce a ready-to-use /etc/rc.local to let users run custom commands on init without creating custom init scripts

SVN-Revision: 17571
Jo-Philipp Wich 16 лет назад
Родитель
Сommit
bdaeaafbef

+ 1 - 1
package/base-files/Makefile

@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 
 PKG_NAME:=base-files
 PKG_NAME:=base-files
-PKG_RELEASE:=28
+PKG_RELEASE:=29
 
 
 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
 
 

+ 5 - 0
package/base-files/files/etc/init.d/done

@@ -9,6 +9,11 @@ boot() {
 		lock -u /tmp/.switch2jffs
 		lock -u /tmp/.switch2jffs
 	}
 	}
 
 
+	# process user commands
+	[ -f /etc/rc.local ] && {
+		sh /etc/rc.local
+	}
+
 	# set leds to normal state
 	# set leds to normal state
 	. /etc/diag.sh
 	. /etc/diag.sh
 	set_state done
 	set_state done

+ 4 - 0
package/base-files/files/etc/rc.local

@@ -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