Zheng Bao (zheng.bao@amd.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/11474
-gerrit
commit 2c8f7b9aa6446093b9395dcc763c01a2a3643195 Author: zbao fishbaozi@gmail.com Date: Tue Sep 1 07:45:41 2015 -0400
buildgcc: Check free disk and warn if its size is too small
We can only warn but 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.
Change-Id: Iae988300937018f166ff626b75c3a16bfa757ad9 Signed-off-by: Zheng Bao zheng.bao@amd.com Signed-off-by: Zheng Bao fishbaozi@gmail.com --- util/crossgcc/buildgcc | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc index 49e41e5..ec633ac 100755 --- a/util/crossgcc/buildgcc +++ b/util/crossgcc/buildgcc @@ -288,6 +288,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" @@ -583,6 +588,8 @@ case "$PACKAGE" in ;; esac
+freedisk + # Find all the required tools:
TAR=$(searchtool tar) || exit $?