base-files: move uci_apply_defaults() to /etc/init.d/boot
authorFelix Fietkau <nbd@openwrt.org>
Mon, 7 Apr 2014 10:01:54 +0000 (10:01 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 7 Apr 2014 10:01:54 +0000 (10:01 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 40408

package/base-files/files/etc/init.d/boot
package/base-files/files/lib/functions.sh

index 45cb4a2596812adf81173ecea9a0d70e79148cae..b44c1a69fe15fee71e3cdb2871e9efa4dab53241 100755 (executable)
@@ -4,6 +4,17 @@
 START=10
 STOP=98
 
+uci_apply_defaults() {
+       cd /etc/uci-defaults || return 0
+       files="$(ls)"
+       [ -z "$files" ] && return 0
+       mkdir -p /tmp/.uci
+       for file in $files; do
+               ( . "./$(basename $file)" ) && rm -f "$file"
+       done
+       uci commit
+}
+
 boot() {
        [ -f /proc/mounts ] || /sbin/mount_root
        [ -f /proc/jffs2_bbc ] && echo "S" > /proc/jffs2_bbc
@@ -33,7 +44,7 @@ boot() {
        }
        rm -f /tmp/wireless.tmp
 
-       sh -c '. /lib/functions.sh; include /lib/config; uci_apply_defaults'
+       uci_apply_defaults
        
        # temporary hack until configd exists
        /sbin/reload_config
index fa4c2d670c333102df41268605abc194344433bc..cec78c506229ea11bcab37c5b0fd81c02bcb83e5 100755 (executable)
@@ -368,17 +368,6 @@ jffs2_mark_erase() {
        echo -e "\xde\xad\xc0\xde" | mtd -qq write - "$1"
 }
 
-uci_apply_defaults() {
-       cd /etc/uci-defaults || return 0
-       files="$(ls)"
-       [ -z "$files" ] && return 0
-       mkdir -p /tmp/.uci
-       for file in $files; do
-               ( . "./$(basename $file)" ) && rm -f "$file"
-       done
-       uci commit
-}
-
 group_add() {
        local name="$1"
        local gid="$2"