X-Git-Url: https://git.cyclocoop.org/?p=lhc%2Fateliers.git;a=blobdiff_plain;f=local%2Ffilesystem-configure;fp=local%2Ffilesystem-configure;h=c6f3cf8253930e1e653b65b0d51c5f9866402d9f;hp=0000000000000000000000000000000000000000;hb=3ad6118386977e346d81042e924e5db9c5f15b7d;hpb=22f04b9fac14adc3d3fc98273ba126c3a51792c3 diff --git a/local/filesystem-configure b/local/filesystem-configure new file mode 100755 index 0000000..c6f3cf8 --- /dev/null +++ b/local/filesystem-configure @@ -0,0 +1,31 @@ +#!/bin/sh -eu +tool=$(readlink -e "${0%/*}/..") +. "$tool"/local/lib.sh + +m4 \ + --define=VM_LVM_LV=$vm_lvm_lv \ + --define=VM_LVM_VG=$vm_lvm_vg \ + <"$tool"/etc/fstab.m4 | +sudo install -m 644 -o root -g root /dev/stdin \ + /etc/fstab +m4 \ + --define=VM_LVM_LV=$vm_lvm_lv \ + --define=VM_LVM_VG=$vm_lvm_vg \ + <"$tool"/etc/crypttab.m4 | +sudo install -m 644 -o root -g root /dev/stdin \ + /etc/crypttab +sudo install -m 644 -o root -g root /dev/stdin \ + /etc/default/tmpfs <<-EOF + LOCK_SIZE=5242880 # NOTE: 5MiB + RAMLOCK=yes + RAMSHM=yes + RAMTMP=yes + RUN_SIZE=10% + SHM_SIZE= + TMP_MODE=1777,nr_inodes=1000k,noatime + TMP_OVERFLOW_LIMIT=1024 + # NOTE: mount tmpfs on /tmp if there is less than the limit size (in kiB) + # on the root filesystem (overriding RAMTMP). + TMP_SIZE=200m + TMPFS_SIZE=20%VM + EOF