diff --git a/package/6in4/files/6in4.hotplug b/package/6in4/files/6in4.hotplug
index 8d78555477239e5a40a9d086ed739bc5a7df435b..e94179828b25ce55fcfdf9746d38bdba4f4eb60b 100644
--- a/package/6in4/files/6in4.hotplug
+++ b/package/6in4/files/6in4.hotplug
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ "$ACTION" = ifup ]; then
-	. /etc/functions.sh
+	. /lib/functions.sh
 
 	INCLUDE_ONLY=1
 	. /lib/netifd/proto/6in4.sh
diff --git a/package/6in4/files/6in4.sh b/package/6in4/files/6in4.sh
index 6e433ba9ad8aa6e40eef5237543a48e3cfb35a77..dd438601fa62159542b944bd661ffb6402af7360 100755
--- a/package/6in4/files/6in4.sh
+++ b/package/6in4/files/6in4.sh
@@ -3,7 +3,7 @@
 # Copyright (c) 2010 OpenWrt.org
 
 [ -n "$INCLUDE_ONLY" ] || {
-	. /etc/functions.sh
+	. /lib/functions.sh
 	. ../netifd-proto.sh
 	init_proto "$@"
 }
diff --git a/package/6to4/files/6to4.hotplug b/package/6to4/files/6to4.hotplug
index 202a3c737cdc20e6fc0f0fd98f799a24c1cf9969..48ac9c1b81a5e843c365262fea8dcde9bd5b36e3 100644
--- a/package/6to4/files/6to4.hotplug
+++ b/package/6to4/files/6to4.hotplug
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ "$ACTION" = ifup ]; then
-	. /etc/functions.sh
+	. /lib/functions.sh
 
 	INCLUDE_ONLY=1
 	. /lib/netifd/proto/6to4.sh
diff --git a/package/6to4/files/6to4.sh b/package/6to4/files/6to4.sh
index c9f97bd778bcc09e861fd49643c463212521e4e1..c2e911a6effdcc49f1fd035fb8e4968f0c06e9cf 100755
--- a/package/6to4/files/6to4.sh
+++ b/package/6to4/files/6to4.sh
@@ -3,7 +3,7 @@
 # Copyright (c) 2010-2012 OpenWrt.org
 
 [ -n "$INCLUDE_ONLY" ] || {
-	. /etc/functions.sh
+	. /lib/functions.sh
 	. ../netifd-proto.sh
 	init_proto "$@"
 }
diff --git a/package/base-files/files/etc/init.d/boot b/package/base-files/files/etc/init.d/boot
index 250bfe040170d15ffe42b712f31aeffdc5a7603f..43837a80f294d5b202303c32917d09aa5a396e67 100755
--- a/package/base-files/files/etc/init.d/boot
+++ b/package/base-files/files/etc/init.d/boot
@@ -48,7 +48,7 @@ system_config() {
 }
 
 apply_uci_config() {
-	sh -c '. /etc/functions.sh; include /lib/config; uci_apply_defaults'
+	sh -c '. /lib/functions.sh; include /lib/config; uci_apply_defaults'
 }
 
 start() {
diff --git a/package/base-files/files/etc/init.d/rcS b/package/base-files/files/etc/init.d/rcS
index 3b804320963764f89ace55daebb337217e4f9b17..3ec9bfef6ebd58f1c249281ef8062a2bac833bbb 100755
--- a/package/base-files/files/etc/init.d/rcS
+++ b/package/base-files/files/etc/init.d/rcS
@@ -14,7 +14,7 @@ system_config() {
 LOGGER="cat"
 [ -x /usr/bin/logger ] && LOGGER="logger -s -p 6 -t sysinit"
 
-. /etc/functions.sh
+. /lib/functions.sh
 
 config_load system
 config_foreach system_config system
diff --git a/package/base-files/files/etc/preinit b/package/base-files/files/etc/preinit
index 6c6e3b1fe1a7884953efe836d82f6b62422e1fbc..0fdfa8cf886d24b4ae4f25ffd7317477522a0561 100755
--- a/package/base-files/files/etc/preinit
+++ b/package/base-files/files/etc/preinit
@@ -21,7 +21,7 @@ pi_init_suppress_stderr="y"
 pi_init_path="/bin:/sbin:/usr/bin:/usr/sbin"
 pi_init_cmd="/sbin/init"
 
-. /etc/functions.sh
+. /lib/functions.sh
 . /lib/functions/boot.sh
 
 boot_hook_init preinit_essential
diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh
index a705d972d9cd939ec0c7982c6b556b4d391f41af..0a92aadcfbd60dc23b9beb3deac9e80f72d113fd 100644
--- a/package/base-files/files/lib/upgrade/common.sh
+++ b/package/base-files/files/lib/upgrade/common.sh
@@ -58,7 +58,7 @@ run_ramfs() { # <command> [...]
 	for file in $RAMFS_COPY_BIN; do
 		install_bin $file
 	done
-	install_file /etc/resolv.conf /etc/functions.sh /lib/functions.sh /lib/upgrade/*.sh $RAMFS_COPY_DATA
+	install_file /etc/resolv.conf /lib/functions.sh /lib/functions.sh /lib/upgrade/*.sh $RAMFS_COPY_DATA
 
 	pivot $RAM_ROOT /mnt || {
 		echo "Failed to switch over to ramfs. Please reboot."
diff --git a/package/base-files/files/sbin/hotplug-call b/package/base-files/files/sbin/hotplug-call
index 0d96e80aaf086400ee13778588f2e885156cf79f..d627becc6973d66f1cea6925e160c70efb7e588e 100755
--- a/package/base-files/files/sbin/hotplug-call
+++ b/package/base-files/files/sbin/hotplug-call
@@ -3,7 +3,7 @@
 
 export HOTPLUG_TYPE="$1"
 
-. /etc/functions.sh
+. /lib/functions.sh
 
 PATH=/bin:/sbin:/usr/bin:/usr/sbin
 LOGNAME=root
diff --git a/package/base-files/files/sbin/led.sh b/package/base-files/files/sbin/led.sh
index 44629d9903de21ef52230be7d7d8b191533765c9..d67a0f51ccdfee75f52aa2e48ec05248eed056e1 100755
--- a/package/base-files/files/sbin/led.sh
+++ b/package/base-files/files/sbin/led.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 # (C) 2008 openwrt.org
 
-. /etc/functions.sh
+. /lib/functions.sh
 ACTION=$1
 NAME=$2
 do_led() {
diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade
index be11c5bf3ff827738e1b32a5de3fd350dce7a5ee..3868dc456e93e23eea04e6ed59113b79239b831c 100755
--- a/package/base-files/files/sbin/sysupgrade
+++ b/package/base-files/files/sbin/sysupgrade
@@ -1,5 +1,5 @@
 #!/bin/sh
-. /etc/functions.sh
+. /lib/functions.sh
 
 # initialize defaults
 RAMFS_COPY_BIN=""	# extra programs for temporary ramfs root
@@ -169,7 +169,7 @@ kill_remaining KILL
 
 if [ -n "$(rootfs_type)" ]; then
 	v "Switching to ramdisk..."
-	run_ramfs '. /etc/functions.sh; include /lib/upgrade; do_upgrade'
+	run_ramfs '. /lib/functions.sh; include /lib/upgrade; do_upgrade'
 else
 	do_upgrade
 fi
diff --git a/package/base-files/files/sbin/wifi b/package/base-files/files/sbin/wifi
index 5cbf50b5f5eae06ef95c3bfc0194d8fe41937bb2..8528efeed68521d1a1496cdcc0696614dce4b7cb 100755
--- a/package/base-files/files/sbin/wifi
+++ b/package/base-files/files/sbin/wifi
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Copyright (C) 2006 OpenWrt.org
 
-. /etc/functions.sh
+. /lib/functions.sh
 
 usage() {
 	cat <<EOF
diff --git a/package/block-mount/files/block.sh b/package/block-mount/files/block.sh
index ac8ca3bfb1dfa52ef2081e67415d0088358ccd11..2b679a8e83a8635ce6c090b86e0d6e138f7dd857 100644
--- a/package/block-mount/files/block.sh
+++ b/package/block-mount/files/block.sh
@@ -4,7 +4,7 @@
 # See /LICENSE for more information.
 #
 
-. /etc/functions.sh
+. /lib/functions.sh
 
 reset_block_cb() {
 	mount_cb() { 
diff --git a/package/comgt/files/3g.usb b/package/comgt/files/3g.usb
index d3859c257c1c9a3dbe757867fc626727f578f562..1dabc0c98fc5fd0e5a813635f15af99f9956e886 100644
--- a/package/comgt/files/3g.usb
+++ b/package/comgt/files/3g.usb
@@ -1,5 +1,5 @@
 #!/bin/sh
-. /etc/functions.sh
+. /lib/functions.sh
 . /lib/netifd/netifd-proto.sh
 
 find_3g_iface() {
diff --git a/package/firewall/files/bin/fw b/package/firewall/files/bin/fw
index 0f83b8eed84fb82b028ccd10d6a3fb0e934c3b17..5d20cc83ef89eab832c8bd6ff00cefee78363943 100644
--- a/package/firewall/files/bin/fw
+++ b/package/firewall/files/bin/fw
@@ -1,7 +1,7 @@
 #!/bin/sh
 FW_LIBDIR=/lib/firewall
 
-. /etc/functions.sh
+. /lib/functions.sh
 . ${FW_LIBDIR}/fw.sh
 
 case "$(type fw)" in
diff --git a/package/firewall/files/firewall.hotplug b/package/firewall/files/firewall.hotplug
index 720b34cc89155b32ddfe6820f3a1c67dfeb73d0c..52e7798485e0304d732b97639f789f1a7a959c05 100644
--- a/package/firewall/files/firewall.hotplug
+++ b/package/firewall/files/firewall.hotplug
@@ -6,7 +6,7 @@
 
 [ "$DEVICE" == "lo" ] && exit 0
 
-. /etc/functions.sh
+. /lib/functions.sh
 . /lib/firewall/core.sh
 
 fw_init
diff --git a/package/iproute2/files/30-teql b/package/iproute2/files/30-teql
index 231c09fa7b74c5b27c8567000ebbde054d13ad53..a0c0e503aa6e9bed8070a54ade8e2a39324b3eaf 100644
--- a/package/iproute2/files/30-teql
+++ b/package/iproute2/files/30-teql
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-. /etc/functions.sh
+. /lib/functions.sh
 
 if [ "$ACTION" != "ifup" ]; then
 	exit
diff --git a/package/ltq-dsl-app/files/dsl_notify.sh b/package/ltq-dsl-app/files/dsl_notify.sh
index f440450f0fd2bc3586a58b3f122203fb3b5cbbb2..5e9f3964e81e6716b81282458d4638ebc30f5160 100644
--- a/package/ltq-dsl-app/files/dsl_notify.sh
+++ b/package/ltq-dsl-app/files/dsl_notify.sh
@@ -9,7 +9,7 @@
 
 [ "$DSL_NOTIFICATION_TYPE" = "DSL_INTERFACE_STATUS" ] || exit 0
 
-. /etc/functions.sh
+. /lib/functions.sh
 
 include /lib/network
 scan_interfaces
diff --git a/package/netifd/files/lib/netifd/dhcp.script b/package/netifd/files/lib/netifd/dhcp.script
index d13ce7ec7481d2d274360069ee1e033d199ed146..0097a96f88613723abd4a00c561a367bede22157 100755
--- a/package/netifd/files/lib/netifd/dhcp.script
+++ b/package/netifd/files/lib/netifd/dhcp.script
@@ -1,7 +1,7 @@
 #!/bin/sh
 [ -z "$1" ] && echo "Error: should be run by udhcpc" && exit 1
 
-. /etc/functions.sh
+. /lib/functions.sh
 . /lib/netifd/netifd-proto.sh
 
 set_classless_routes() {
diff --git a/package/netifd/files/lib/netifd/proto/dhcp.sh b/package/netifd/files/lib/netifd/proto/dhcp.sh
index 4bdb3a7d06269b14c0e0e2c74a2d4ce9d76cbc1b..1080dbf5edd511611b86961f2b64a119d2341105 100755
--- a/package/netifd/files/lib/netifd/proto/dhcp.sh
+++ b/package/netifd/files/lib/netifd/proto/dhcp.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-. /etc/functions.sh
+. /lib/functions.sh
 . ../netifd-proto.sh
 init_proto "$@"
 
diff --git a/package/netifd/files/sbin/ifup b/package/netifd/files/sbin/ifup
index e17b67de5ca6a7ef16295f49cc5f0bd5c7b564f9..0d2a3ca10723bea4d351e9e767ac654916199954 100755
--- a/package/netifd/files/sbin/ifup
+++ b/package/netifd/files/sbin/ifup
@@ -51,7 +51,7 @@ else
 fi
 
 if [ -n "$setup_wifi" ] && grep -q config /etc/config/wireless; then
-	. /etc/functions.sh
+	. /lib/functions.sh
 
 	find_related_radios() {
 		local wdev wnet
diff --git a/package/ppp/files/ppp.sh b/package/ppp/files/ppp.sh
index c516691329cf983755519adafe5b23c73ab38449..297a3291546988eaf9901feb466065d3ab80cd37 100755
--- a/package/ppp/files/ppp.sh
+++ b/package/ppp/files/ppp.sh
@@ -3,7 +3,7 @@
 [ -x /usr/sbin/pppd ] || exit 0
 
 [ -n "$INCLUDE_ONLY" ] || {
-	. /etc/functions.sh
+	. /lib/functions.sh
 	. ../netifd-proto.sh
 	init_proto "$@"
 }
diff --git a/package/pptp/files/pptp.sh b/package/pptp/files/pptp.sh
index 911e0aae2a8a98082716b7919d5fc815f5715a3b..e2e4729b92752f42430baf5f6e8d9832e7380083 100755
--- a/package/pptp/files/pptp.sh
+++ b/package/pptp/files/pptp.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-. /etc/functions.sh
+. /lib/functions.sh
 . ../netifd-proto.sh
 init_proto "$@"
 
diff --git a/package/qos-scripts/files/usr/bin/qos-stat b/package/qos-scripts/files/usr/bin/qos-stat
index 8a39df084700aaf3ebe13a5a6d950e858a0e88f0..78d163888b3e9410e72899221a159b8453e0c226 100755
--- a/package/qos-scripts/files/usr/bin/qos-stat
+++ b/package/qos-scripts/files/usr/bin/qos-stat
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Copyright (C) 2011 OpenWrt.org
 
-. /etc/functions.sh
+. /lib/functions.sh
 
 include /lib/network
 
diff --git a/package/qos-scripts/files/usr/lib/qos/generate.sh b/package/qos-scripts/files/usr/lib/qos/generate.sh
index bb1d7ed11116ce4f2a7a56a9777c6e40266d9f61..440b43f5d12fafec23390cfcb737d4a97f68e096 100755
--- a/package/qos-scripts/files/usr/lib/qos/generate.sh
+++ b/package/qos-scripts/files/usr/lib/qos/generate.sh
@@ -1,5 +1,5 @@
 #!/bin/sh
-[ -e /etc/functions.sh ] && . /etc/functions.sh || . ./functions.sh
+[ -e /lib/functions.sh ] && . /lib/functions.sh || . ./functions.sh
 [ -x /sbin/modprobe ] && {
 	insmod="modprobe"
 	rmmod="$insmod -r"