[SCM] live-initramfs branch, debian, updated. debian/1.236.1-1

Daniel Baumann daniel at debian.org
Sun May 16 06:21:00 UTC 2010


The following commit has been merged in the debian branch:
commit 47cf265a3cfa48a27079d03725b133a57748881d
Author: Daniel Baumann <daniel at debian.org>
Date:   Sat May 1 13:47:42 2010 +0200

    Merging casper 1.220.

diff --git a/docs/ChangeLog.casper b/docs/ChangeLog.casper
index 3bdf715..1540603 100644
--- a/docs/ChangeLog.casper
+++ b/docs/ChangeLog.casper
@@ -1,3 +1,10 @@
+casper (1.220) lucid; urgency=low
+
+  * scripts/casper: calculate memory without "head" utility, thanks to
+    Petar Bogdanovic (LP: #25496).
+
+ -- Kees Cook <kees at ubuntu.com>  Fri, 19 Feb 2010 14:04:18 -0800
+
 casper (1.219) lucid; urgency=low
 
   [ Mario Limonciello ]
diff --git a/scripts/live b/scripts/live
index 110f41d..cdcbc18 100755
--- a/scripts/live
+++ b/scripts/live
@@ -705,7 +705,7 @@ copy_live_to ()
 	if [ "${copytodev}" = "ram" ]
 	then
 		# copying to ram:
-		freespace=$( expr $(awk '/MemFree/{print $2}' /proc/meminfo) + $( awk '/\<Cached/{print $2}' /proc/meminfo ) )
+		freespace=$(awk '/^MemFree:/{f=$2} /^Cached:/{c=$2} END{print f+c}' /proc/meminfo)
 		mount_options="-o size=${size}k"
 		free_string="memory"
 		fstype="tmpfs"
@@ -1008,7 +1008,7 @@ do_snap_copy ()
 			todev=$(awk -v pat="$(base_path ${todir})" '$2 == pat { print $1 }' /proc/mounts)
 			freespace=$(df -k | awk '/'${todev}'/{print $4}')
 		else
-			freespace=$( expr $(awk '/MemFree/{print $2}' /proc/meminfo) + $( awk '/\<Cached/{print $2}' /proc/meminfo))
+			freespace=$(awk '/^MemFree:/{f=$2} /^Cached:/{c=$2} END{print f+c}' /proc/meminfo)
 		fi
 
 		tomount="/mnt/tmpsnap"

-- 
live-initramfs



More information about the debian-live-changes mailing list