[X2Go-Commits] [live-build-x2go] 32/160: improved ramdisk size calculation

git-admin at x2go.org git-admin at x2go.org
Sat Nov 18 01:55:36 CET 2017


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch feature/openbox
in repository live-build-x2go.

commit d4d4db211cec5cde6a3a53cbb53efbf6d7a0d1ab
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