summaryrefslogtreecommitdiff
path: root/package/base-files/files
diff options
context:
space:
mode:
authorDaniel Dickinson <crazycshore@gmail.com>2011-04-05 12:12:57 +0000
committerDaniel Dickinson <crazycshore@gmail.com>2011-04-05 12:12:57 +0000
commitd5542b4f59cead42a4fa140deb7da74cc2750f20 (patch)
treef80d06d52ea577fab7469c2427b5e00706038925 /package/base-files/files
parentb62e95c11bef9eb0c1f1dd849c359a37a5568e13 (diff)
downloadmtk-20170518-d5542b4f59cead42a4fa140deb7da74cc2750f20.zip
mtk-20170518-d5542b4f59cead42a4fa140deb7da74cc2750f20.tar.gz
mtk-20170518-d5542b4f59cead42a4fa140deb7da74cc2750f20.tar.bz2
block-mount base-files: Added additional check to pi_include to ensure that a directory used with pi_include actually contains files matching the souring pattern because if not the shell dies due to an empty string in for statement. Added /lib/functions/fsck as an empty dir to block-mount. This combination fixes a warning which generates a lot of bug reports, without panicking the kernel like the last attempt.
SVN-Revision: 26479
Diffstat (limited to 'package/base-files/files')
-rwxr-xr-xpackage/base-files/files/etc/functions.sh16
1 files changed, 10 insertions, 6 deletions
diff --git a/package/base-files/files/etc/functions.sh b/package/base-files/files/etc/functions.sh
index acea617..e4b3bad 100755
--- a/package/base-files/files/etc/functions.sh
+++ b/package/base-files/files/etc/functions.sh
@@ -299,13 +299,17 @@ pi_include() {
elif [ -f "$1" ]; then
. "$1"
elif [ -d "/tmp/overlay/$1" ]; then
- for src_script in /tmp/overlay/$1/*.sh; do
- . "$src_script"
- done
+ if [ -n "$(ls /tmp/overlay/$1/*.sh 2>/dev/null)" ]; then
+ for src_script in /tmp/overlay/$1/*.sh; do
+ . "$src_script"
+ done
+ fi
elif [ -d "$1" ]; then
- for src_script in $1/*.sh; do
- . "$src_script"
- done
+ if [ -n "$(ls $1/*.sh 2>/dev/null)" ]; then
+ for src_script in $1/*.sh; do
+ . "$src_script"
+ done
+ fi
else
echo "WARNING: $1 not found"
return 1