[coreboot-gerrit] New patch to review for coreboot: buildgcc: Check free disk and warn if its size is too small

Zheng Bao (zheng.bao@amd.com) gerrit at coreboot.org
Tue Sep 1 02:59:34 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 ce9446d6e0f7377833d769e6cc16f7088749c7a6
Author: zbao <fishbaozi at gmail.com>
Date:   Mon Aug 31 22:58:42 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 a estimated size, which is required when I build i386-elf.
    
    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 | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
index 49e41e5..d25febf 100755
--- a/util/crossgcc/buildgcc
+++ b/util/crossgcc/buildgcc
@@ -338,6 +338,11 @@ GNU General Public License for more details.
 EOF
 }
 
+freedisk() {
+	avail=$(LC_ALL=C eval df -k ./ | sed 1d | awk '{print $4}')
+	test $avail -lt 3145728 && printf "${red}WARNING: There is not enough space.${NC}\n"
+}
+
 build_GMP() {
 	CC="$CC" CFLAGS="-Os" ../${GMP_DIR}/configure --disable-shared --enable-fat --prefix=$TARGETDIR $OPTIONS \
 		|| touch .failed
@@ -583,6 +588,8 @@ case "$PACKAGE" in
 		;;
 esac
 
+freedisk
+
 # Find all the required tools:
 
 TAR=$(searchtool tar) || exit $?



More information about the coreboot-gerrit mailing list