aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--package/block-mount/files/fstab.init10
1 files changed, 7 insertions, 3 deletions
diff --git a/package/block-mount/files/fstab.init b/package/block-mount/files/fstab.init
index d755eccf08..fdcd4f52a2 100644
--- a/package/block-mount/files/fstab.init
+++ b/package/block-mount/files/fstab.init
@@ -41,9 +41,13 @@ do_swapoff() {
start() {
config_load fstab
mkdir -p /var/lock
- lock /var/lock/fstab.lck
- echo '# WARNING: this is an auto generated file, please use uci to set defined filesystems' > /etc/fstab
- lock -u /var/lock/fstab.lck
+ lock -w /var/lock/fstab.lck && {
+ lock /var/lock/fstab.lck
+ [ -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
}