[coreboot-gerrit] Patch set updated for coreboot: buildgcc: Check free disk and warn if its size is too small

Zheng Bao (zheng.bao@amd.com) gerrit at coreboot.org
Thu Sep 17 07:31:48 CET 2015


Zheng Bao (zheng.bao at amd.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/11474

-gerrit

commit b48fce3bd79facc63c849df258fa085b9e0ee8c7
Author: zbao <fishbaozi at gmail.com>
Date:   Tue Sep 1 22:31:08 2015 -0400

    buildgcc: Check free disk and warn if its size is too small
    
    We can only warn and can not stop building, because if the user
    saves the temp file the last time, the space might be enough.
    
    3G is an estimated size, which is required when I build i386-elf.
    
    Command "df" is installed on Linux, FreeBSD, OS X, Cygwin, with
    same output.
    
    Change-Id: Iae988300937018f166ff626b75c3a16bfa757ad9
    Signed-off-by: Zheng Bao <zheng.bao at amd.com>
    Signed-off-by: Zheng Bao <fishbaozi at gmail.com>
---
 util/crossgcc/buildgcc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
index c714718..e2c4e4f 100755
--- a/util/crossgcc/buildgcc
+++ b/util/crossgcc/buildgcc
@@ -291,6 +291,11 @@ cleanup()
 	printf "${green}ok${NC}\n"
 }
 
+freedisk() {
+	avail=$(LC_ALL=C eval df -k ./ | sed 1d | awk '{print $4}')
+	test $avail -lt 3145728 && printf "${red}WARNING: There might be not enough space.${NC}\n"
+}
+
 myhelp()
 {
 	printf "Usage: $0 [-V] [-c] [-p <platform>] [-d <target directory>] [-D <dest dir>] [-C] [-G] [-S]\n"
@@ -594,6 +599,7 @@ case "$PACKAGE" in
 		;;
 esac
 
+freedisk
 # Find all the required tools:
 
 TAR=$(searchtool tar) || exit $?



More information about the coreboot-gerrit mailing list