summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorDaniel Dickinson <crazycshore@gmail.com>2010-09-19 23:29:40 +0000
committerDaniel Dickinson <crazycshore@gmail.com>2010-09-19 23:29:40 +0000
commit1385904dfa12b76d208e564b541bd8a81dee22d6 (patch)
treef23e26d7e94d788a282b3e790b7f821ca449730a /package
parent46803a3b75528129a69291b39be90674de65bdc8 (diff)
downloadmtk-20170518-1385904dfa12b76d208e564b541bd8a81dee22d6.zip
mtk-20170518-1385904dfa12b76d208e564b541bd8a81dee22d6.tar.gz
mtk-20170518-1385904dfa12b76d208e564b541bd8a81dee22d6.tar.bz2
base-files: Add function pi_include the /lib/functions/boot.sh used by preinit, which safely sources files as well as working correctly whether the script using it is a package added to the jffs2 part of a squashfs or built into an image or on some other root filesystem.
SVN-Revision: 23099
Diffstat (limited to 'package')
-rw-r--r--package/base-files/files/lib/functions/boot.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/package/base-files/files/lib/functions/boot.sh b/package/base-files/files/lib/functions/boot.sh
index f93eec9..91ab930 100644
--- a/package/base-files/files/lib/functions/boot.sh
+++ b/package/base-files/files/lib/functions/boot.sh
@@ -98,3 +98,16 @@ ramoverlay() {
mount -t tmpfs root /tmp/root
fopivot /tmp/root /rom 1
}
+
+pi_include() {
+ if [ -f "/tmp/overlay/$1" ]; then
+ . "/tmp/overlay/$1"
+ elif [ -f "$1" ]; then
+ . "$1"
+ else
+ echo "WARNING: $1 not found"
+ return 1
+ fi
+ return 0
+}
+