瀏覽代碼

Move tmp to a ramdisk

Bob Mottram 8 年之前
父節點
當前提交
42d5bc9321
共有 1 個檔案被更改,包括 14 行新增0 行删除
  1. 14
    0
      src/freedombone-utils-setup

+ 14
- 0
src/freedombone-utils-setup 查看文件

113
     write_config_param USB_DRIVE "$USB_DRIVE"
113
     write_config_param USB_DRIVE "$USB_DRIVE"
114
 }
114
 }
115
 
115
 
116
+function separate_tmp_filesystem {
117
+    tmp_filesystem_size_mb=$1
118
+    if [ ! -d /tmp ]; then
119
+        mkdir -p /tmp
120
+    fi
121
+    if ! grep -q '/tmp' /etc/fstab; then
122
+        mount -t tmpfs -o size=${tmp_filesystem_size_mb}m tmpfs /tmp
123
+        echo "tmpfs       /tmp tmpfs   nodev,nosuid,noexec,nodiratime,size=${tmp_filesystem_size_mb}M   0 0" >> /etc/fstab
124
+    fi
125
+}
126
+
116
 function remove_bluetooth {
127
 function remove_bluetooth {
117
     rmmod -f bnep
128
     rmmod -f bnep
118
     rmmod -f bluetooth
129
     rmmod -f bluetooth
549
     read_config_param "PROJECT_REPO"
560
     read_config_param "PROJECT_REPO"
550
     write_config_param "PROJECT_REPO" "$PROJECT_REPO"
561
     write_config_param "PROJECT_REPO" "$PROJECT_REPO"
551
 
562
 
563
+    function_check separate_tmp_filesystem
564
+    separate_tmp_filesystem 20
565
+
552
     function_check disable_null_passwords
566
     function_check disable_null_passwords
553
     disable_null_passwords
567
     disable_null_passwords
554
 
568