It would be good to monitor disk availability during builds and warn the user if it is running low. This gets complicated by the problem that different parts of the build may be on different mount points/partitions. This functionality may only focus on a few directories, for example: poky/build and poky/build/downloads initially to solve this problem. We'd also want to track available inode numbers as well as space.
This is in M2
Sorry, it should be in M1
Move it to M2, since i should work on bug 1229: bitbake-runtask doesn't work, Wind River is using bitbake-runtask in yocto 1.0, and may go on using it in 1.2, but it doesn't work currently.
Here is the design document: * Summary Monitor disk availability and warn the user if it is running low, the user should specify the following values: # Set the directories to monitor for disk usage BB_DISKMON_DIRS = "${TMPDIR} ${DL_DIR}" # Set the minimum amount of disk space to warn BB_DISKMON_MINSPACE = "1GB" # Set the monitor frequency BB_DISKMON_INTERVAL = "60s" If the variables are not set, it doesn't get activated, it would be disabled by default. * Implementation 1) The main code will be in lib/bb/monitordisk.py 2) The bin/bitbake will invoke the code in lib/bb/monitordisk.py 3) Use the multiprocessing and time module, the multiprocessing is used to fork a process to monitor the diskspace, and use the time's sleep as a timer 4) Use the "print" to print the warning message since the monitor process is a subprocess of bitbake, it can't use the same the logger with bitbake. 5) The warning format is similar to: WARNING: the space of /buildarea/test/downloads is running low (2GB left)
Move it to M3 since it is in patch review, and the Chinese New Year will begin.
http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=robert/disk-space-monitor&id=4dcfea9e72dfb22f3768bdd56bde1e2791b74845
verified on: git info: 927bec5f72230be4f2452d9ef5a747b2c00cb781 git branch: poky/master follow test steps below: 1.set build env. 2.add following info to local.conf : BB_DISKMON_DIRS = "STOPTASKS,${TMPDIR},40G,4510K" BB_DISKMON_WARNINTERVAL = "50M,5K" 3.check free disk space of filesystem which tmp/ is mounted,only 35G left. 4.run "bitbake man",the build process will stop and nothing will build. 5.change "STOPTASKS" to "ABORT",build process will stop and nothing will build. 6.change "STOPTASKS" to "WARN", build process will continue and warnings will output to screen before build and when disk space decrease 50M lower, warning will also output to screen in build process. 7.also check free inodes of the filesystem which tmp/ is mounted,the same result to the free disk space.