diff options
author | Thomas Orgis | 2020-09-30 13:52:44 +0200 |
---|---|---|
committer | Thomas Orgis | 2021-02-26 12:30:38 +0100 |
commit | f64e9a892b0c57f763137718a652ccde048d5fca (patch) | |
tree | 88477ba28147cbc0ee695928a0a9c62652420e9e | |
parent | e7ab3e8f6918b496012cb51307c2243b6d95da22 (diff) |
libgrimoire: half of RAM as default size of TMPFS source directories
-rw-r--r-- | ChangeLog | 3 | ||||
-rwxr-xr-x | var/lib/sorcery/modules/libgrimoire | 12 |
2 files changed, 13 insertions, 2 deletions
@@ -1,3 +1,6 @@ +2020-09-30 Thomas Orgis <sobukus@sourcemage.org> + * libgrimoire: default to default size of tmpfs (half of RAM) + 2020-09-19 Thomas Orgis <sobukus@sourcemage.org> * protected: added readline, ncurses, isl, icu (bug 16112) * protected: also added guile libs, in case you make make diff --git a/var/lib/sorcery/modules/libgrimoire b/var/lib/sorcery/modules/libgrimoire index bc699952..7389b548 100755 --- a/var/lib/sorcery/modules/libgrimoire +++ b/var/lib/sorcery/modules/libgrimoire @@ -39,14 +39,22 @@ real_mk_source_dir() { local NEW_DIR=${NEW_DIR:=$SOURCE_DIRECTORY} local SIZE=$2 - local SIZE=${SIZE:=2g} + # See bug 15946. Even simpler approach: Just specify no size, wich + # also defaults to half of RAM in Linux. + # TODO: Use given size to decide for TMPFS or not, early bail out + # if not enough disk. + local sizepar + if [[ -n "$SIZE" ]]; then + sizepar="size=$SIZE," + fi + # Could also think about inode count being necessary. if [ -n "$NEW_DIR" ]; then rm_source_dir $NEW_DIR mkdir -p $NEW_DIR && if [[ $TMPFS == on ]]; then - mount -o size=$SIZE,nr_inodes=1m -t tmpfs tmpfs $NEW_DIR + mount -o "$sizepar"nr_inodes=1m -t tmpfs tmpfs $NEW_DIR fi fi |