Added common_lib.hosts.Host.cleanup_kernels and some functions it's using.
Implemented a fast local version of those functions in LocalHost to not
go through the run() abstraction. Added call to cleanup_kernels() from
generated control file code so it will cleanup unused kernels (not 
referenced by the bootloader) each time it's installing a new kernel.

Signed-off-by: Mihai Rusu <dizzy@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3907 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/frontend/afe/control_file.py b/frontend/afe/control_file.py
index d84af80..d1f0a78 100644
--- a/frontend/afe/control_file.py
+++ b/frontend/afe/control_file.py
@@ -28,6 +28,9 @@
 
 
 def boot_kernel(kernel_info):
+    # remove kernels (and associated data) not referenced by the bootloader
+    job.host.cleanup_kernels()
+
     testkernel = job.kernel(kernel_info['version'])
     if kernel_info['config_file']:
         testkernel.config(kernel_info['config_file'])