diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2012-02-26 16:48:15 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-02-26 11:05:27 +0000 |
commit | 9674ea28ffebd75f117531238e517df41ed7dafb (patch) | |
tree | 75983bf7dca3de0a78fe6a2acf1a398c74c78998 /bitbake/lib/bb/runqueue.py | |
parent | aac45679fb17c720f511a30261d34eb64e6a4c70 (diff) | |
download | poky-9674ea28ffebd75f117531238e517df41ed7dafb.tar.gz |
V5 Disk space monitoring
Monitor disk availability and take action when the free disk space or
amount of free inode is running low, it is enabled when BB_DISKMON_DIRS
is set.
* Variable meanings(from meta-yocto/conf/local.conf.sample):
# Set the directories to monitor for disk usage, if more than one
# directories are mounted in the same device, then only one directory
# would be monitored since the monitor is based on the device.
# The format is:
# "action,directory,minimum_space,minimum_free_inode"
#
# The "action" must be set and should be one of:
# ABORT: Immediately abort
# STOPTASKS: The new tasks can't be executed any more, will stop the build
# when the running tasks have been done.
# WARN: show warnings (see BB_DISKMON_WARNINTERVAL for more information)
#
# The "directory" must be set, any directory is OK.
#
# Either "minimum_space" or "minimum_free_inode" (or both of them)
# should be set, otherwise the monitor would not be enabled,
# the unit can be G, M, K or none, but do NOT use GB, MB or KB
# (B is not needed).
#BB_DISKMON_DIRS = "STOPTASKS,${TMPDIR},1G,100K WARN,${SSTATE_DIR},1G,100K"
#
# Set disk space and inode interval (only works when the action is "WARN",
# the unit can be G, M, or K, but do NOT use the GB, MB or KB
# (B is not needed), the format is:
# "disk_space_interval, disk_inode_interval", the default value is
# "50M,5K" which means that it would warn when the free space is
# lower than the minimum space(or inode), and would repeat the action
# when the disk space reduces 50M (or the amount of inode reduces 5k)
# again.
#BB_DISKMON_WARNINTERVAL = "50M,5K"
[YOCTO #1589]
(Bitbake rev: 4d173d441d2beb8e6492b6b1842682f8cf32e6cc)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/runqueue.py')
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 1c3187d462..f08f93aef4 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -31,6 +31,7 @@ import fcntl | |||
31 | import logging | 31 | import logging |
32 | import bb | 32 | import bb |
33 | from bb import msg, data, event | 33 | from bb import msg, data, event |
34 | from bb import monitordisk | ||
34 | 35 | ||
35 | bblogger = logging.getLogger("BitBake") | 36 | bblogger = logging.getLogger("BitBake") |
36 | logger = logging.getLogger("BitBake.RunQueue") | 37 | logger = logging.getLogger("BitBake.RunQueue") |
@@ -775,6 +776,9 @@ class RunQueue: | |||
775 | 776 | ||
776 | self.state = runQueuePrepare | 777 | self.state = runQueuePrepare |
777 | 778 | ||
779 | # For disk space monitor | ||
780 | self.dm = monitordisk.diskMonitor(cfgData) | ||
781 | |||
778 | def check_stamps(self): | 782 | def check_stamps(self): |
779 | unchecked = {} | 783 | unchecked = {} |
780 | current = [] | 784 | current = [] |
@@ -949,6 +953,9 @@ class RunQueue: | |||
949 | else: | 953 | else: |
950 | self.rqexe = RunQueueExecuteScenequeue(self) | 954 | self.rqexe = RunQueueExecuteScenequeue(self) |
951 | 955 | ||
956 | if self.state in [runQueueSceneRun, runQueueRunning, runQueueCleanUp]: | ||
957 | self.dm.check(self) | ||
958 | |||
952 | if self.state is runQueueSceneRun: | 959 | if self.state is runQueueSceneRun: |
953 | retval = self.rqexe.execute() | 960 | retval = self.rqexe.execute() |
954 | 961 | ||