[package]: block-mount: Fixed two bugs in fstab.init. /etc/fstab was used where /tmp/fstab should have been, and locking was insufficiently careful and was such that it could result in deadlock when hotplug was in use.

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22148 3c298f89-4303-0410-b956-a3cf2f4a3e73
master
Daniel Dickinson 2010-07-12 16:35:39 +00:00
parent d2f3a21390
commit efa3beb78b
1 changed files with 7 additions and 3 deletions

View File

@ -41,9 +41,13 @@ do_swapoff() {
start() {
config_load fstab
mkdir -p /var/lock
lock -w /var/lock/fstab.lck && {
lock /var/lock/fstab.lck
echo '# WARNING: this is an auto generated file, please use uci to set defined filesystems' > /etc/fstab
[ -e /tmp/fstab ] || {
echo '# WARNING: this is an auto generated file, please use uci to set defined filesystems' > /tmp/fstab
}
lock -u /var/lock/fstab.lck
}
config_foreach do_swapon swap
config_foreach do_mount mount
}