Move tmp to a ramdisk

This commit is contained in:
Bob Mottram 2016-11-30 20:10:51 +00:00
parent 8f11ab2102
commit 42d5bc9321
1 changed files with 14 additions and 0 deletions

View File

@ -113,6 +113,17 @@ function detect_usb_drive {
write_config_param USB_DRIVE "$USB_DRIVE"
}
function separate_tmp_filesystem {
tmp_filesystem_size_mb=$1
if [ ! -d /tmp ]; then
mkdir -p /tmp
fi
if ! grep -q '/tmp' /etc/fstab; then
mount -t tmpfs -o size=${tmp_filesystem_size_mb}m tmpfs /tmp
echo "tmpfs /tmp tmpfs nodev,nosuid,noexec,nodiratime,size=${tmp_filesystem_size_mb}M 0 0" >> /etc/fstab
fi
}
function remove_bluetooth {
rmmod -f bnep
rmmod -f bluetooth
@ -549,6 +560,9 @@ function setup_utils {
read_config_param "PROJECT_REPO"
write_config_param "PROJECT_REPO" "$PROJECT_REPO"
function_check separate_tmp_filesystem
separate_tmp_filesystem 20
function_check disable_null_passwords
disable_null_passwords