summaryrefslogtreecommitdiff
path: root/package/base-files
diff options
context:
space:
mode:
authorflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2008-08-14 22:21:35 +0000
committerflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2008-08-14 22:21:35 +0000
commitd5249b218d6df367dea872e8a7ae215f5bd7c5cf (patch)
tree0cea6a88ce3347729c1640fec7e9d83dcd22241e /package/base-files
parenta0745cadd4b1545fb0c253ba3d75ada790ccde8b (diff)
Fix negative calculation of the tmpfs for devices with few RAM (#3557)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@12315 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files')
-rwxr-xr-xpackage/base-files/files/etc/preinit2
1 files changed, 1 insertions, 1 deletions
diff --git a/package/base-files/files/etc/preinit b/package/base-files/files/etc/preinit
index 8c30fd8da1..11b9100383 100755
--- a/package/base-files/files/etc/preinit
+++ b/package/base-files/files/etc/preinit
@@ -20,7 +20,7 @@ failsafe() {
mount proc /proc -t proc
mount sysfs /sys -t sysfs
-size=$(awk '/MemTotal:/ {l=5242880;mt=($2*1024);print((s=mt/2)<l)?mt-l:s}' /proc/meminfo)
+size=$(awk '/MemTotal:/ {l=5242880;mt=($2*1024);print((s=mt/2)<l)&&(mt>l)?mt-l:s}' /proc/meminfo)
mount tmpfs /tmp -t tmpfs -o size=$size,nosuid,nodev,mode=1777
if grep devfs /proc/filesystems > /dev/null; then