[X2Go-Commits] [live-build-x2go] 82/166: improved ramdisk size calculation
git-admin at x2go.org
git-admin at x2go.org
Mon Nov 20 02:16:52 CET 2017
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch feature/mate-minidesktop
in repository live-build-x2go.
commit 5d457d2cd431e68a3891662fdefc964561ff965a
Author: Stefan Baur (BAUR-ITCS) <kontakt at baur-itcs.de>
Date: Sun Jul 23 11:16:47 2017 +0200
improved ramdisk size calculation
---
config/includes.chroot/lib/live/config/2300-live-autoupdate | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/config/includes.chroot/lib/live/config/2300-live-autoupdate b/config/includes.chroot/lib/live/config/2300-live-autoupdate
index 0639616..d09130d 100755
--- a/config/includes.chroot/lib/live/config/2300-live-autoupdate
+++ b/config/includes.chroot/lib/live/config/2300-live-autoupdate
@@ -128,7 +128,18 @@ else
MOUNTPOINT="/lib/live/mount/findiso/"
# create a temporary directory and mount a tmpfs there
TEMPDIR=$(mktemp -d --tmpdir=/mnt)
- IMGSIZE=$(df /lib/live/mount/medium | awk ' /medium/ { print $2}')
+
+ if [ -d /lib/live/mount/findiso/ ] ; then
+ # if we have access to the entire filesystem, use the
+ # directory size as base size for the current image -
+ # and if the download directory is even bigger, use that size
+ IMGSIZE=$(du -s "/lib/live/mount/findiso/$(dirname $(sed -e 's/^.*findiso/findiso/' -e 's/ .*$//' /proc/cmdline | awk -F '=' '{ print $2 }'))")
+ IMGSIZEDOWNLOAD=$(du -s "/lib/live/mount/findiso/boot/X2Go-live-download")
+ [ $IMGSIZEDOWNLOAD -gt $IMGSIZE ] && IMGSIZE=$IMGSIZEDOWNLOAD
+ else
+ IMGSIZE=$(df /lib/live/mount/medium | awk ' /medium/ { print $2}')
+ fi
+ # multiply current size by 1.5 as safety margin
mount -t tmpfs -osize=$((IMGSIZE*15/10))k tmpfs $TEMPDIR
fi
--
Alioth's /srv/git/code.x2go.org/live-build-x2go.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/live-build-x2go.git
More information about the x2go-commits
mailing list