X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/faf7173b4df3a152dbdc574751078b359c116d5b..2617211ff3e8567acd493eed008fda1b35d4b2e2:/package/block-mount/files/fstab.init diff --git a/package/block-mount/files/fstab.init b/package/block-mount/files/fstab.init index bd2bf24cb..6aeee8f34 100644 --- a/package/block-mount/files/fstab.init +++ b/package/block-mount/files/fstab.init @@ -41,11 +41,16 @@ 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 - config_foreach do_mount mount + 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 + config_foreach do_swapon swap # do swap a second time so that swap on filesystems is enabled } stop() {