summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Orgis2020-09-30 13:52:44 +0200
committerThomas Orgis2021-02-26 12:30:38 +0100
commitf64e9a892b0c57f763137718a652ccde048d5fca (patch)
tree88477ba28147cbc0ee695928a0a9c62652420e9e
parente7ab3e8f6918b496012cb51307c2243b6d95da22 (diff)
libgrimoire: half of RAM as default size of TMPFS source directories
-rw-r--r--ChangeLog3
-rwxr-xr-xvar/lib/sorcery/modules/libgrimoire12
2 files changed, 13 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 5f4207ce..75fbef92 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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