summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcshore <cshore@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-04-05 12:12:57 +0000
committercshore <cshore@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-04-05 12:12:57 +0000
commit198ea09e92556752658bbfffac2b764b6f80959c (patch)
tree21751ae837431af618c34068ef259d79dc1e62aa
parentc930c7dc2404c43507e3a2355875ff99f8332198 (diff)
[package] 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.
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@26479 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rwxr-xr-xpackage/base-files/files/etc/functions.sh16
-rw-r--r--package/block-mount/Makefile4
2 files changed, 12 insertions, 8 deletions
diff --git a/package/base-files/files/etc/functions.sh b/package/base-files/files/etc/functions.sh
index acea617530..e4b3badb46 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
diff --git a/package/block-mount/Makefile b/package/block-mount/Makefile
index d2313f77f4..c2c9d33f13 100644
--- a/package/block-mount/Makefile
+++ b/package/block-mount/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=block-mount
PKG_VERSION:=0.2.0
-PKG_RELEASE:=4
+PKG_RELEASE:=5
include $(INCLUDE_DIR)/package.mk
@@ -50,7 +50,7 @@ define Package/block-mount/install
$(INSTALL_BIN) ./files/fstab.init $(1)/etc/init.d/fstab
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DATA) ./files/fstab.config $(1)/etc/config/fstab
- $(INSTALL_DIR) $(1)/lib/functions
+ $(INSTALL_DIR) $(1)/lib/functions/fsck
$(INSTALL_DATA) ./files/mount.sh $(1)/lib/functions/
$(INSTALL_DATA) ./files/fsck.sh $(1)/lib/functions/
$(INSTALL_DATA) ./files/block.sh $(1)/lib/functions/