[autotest] Remove the last of the support for kernel selection.

This removes all the vestiges related to support selecting a kernel
for test from client side code.  This completes removal of all such
code from the Chrome OS fork of Autotest.

N.B.  It's possible that there are still design concepts within the
code that exist primarily for the benefit of kernel selection.
Finding and simplifying those design concepts are left for the
next intrepid developer.

BUG=chromium:266704
TEST=Run push_to_prod suite in a local instance.

Change-Id: I7a8bbee0f58c14c4826689d5d04999b3708ad5f6
Reviewed-on: https://chromium-review.googlesource.com/349710
Commit-Ready: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
diff --git a/client/bin/boottool.py b/client/bin/boottool.py
deleted file mode 100644
index 9f45488..0000000
--- a/client/bin/boottool.py
+++ /dev/null
@@ -1,17 +0,0 @@
-import os
-from autotest_lib.client.common_lib import utils, error
-from autotest_lib.client.common_lib import boottool as common_boottool
-
-class boottool(common_boottool.boottool):
-    def __init__(self, boottool_exec=None):
-        super(boottool, self).__init__()
-
-        if boottool_exec:
-            self._boottool_exec = boottool_exec
-        else:
-            autodir = os.environ['AUTODIR']
-            self._boottool_exec = autodir + '/tools/boottool'
-
-
-    def _run_boottool(self, *options):
-        return utils.system_output(self._boottool_exec, args=options)
diff --git a/client/bin/config.py b/client/bin/config.py
deleted file mode 100644
index 55aab26..0000000
--- a/client/bin/config.py
+++ /dev/null
@@ -1,48 +0,0 @@
-"""The Job Configuration
-
-The job configuration, holding configuration variable supplied to the job.
-
-The config should be viewed as a hierachical namespace.  The elements
-of the hierachy are separated by periods (.) and where multiple words
-are required at a level they should be separated by underscores (_).
-Please no StudlyCaps.
-
-For example:
-        boot.default_args
-"""
-
-__author__ = """Copyright Andy Whitcroft 2006"""
-
-import os
-
-class config(object):
-    """The BASIC job configuration
-
-    Properties:
-            job
-                    The job object for this job
-            config
-                    The job configuration dictionary
-    """
-
-    def __init__(self, job):
-        """
-                job
-                        The job object for this job
-        """
-        self.job = job
-        self.config = {}
-
-
-    def set(self, name, value):
-        if name == "proxy":
-            os.environ['http_proxy'] = value
-            os.environ['ftp_proxy'] = value
-
-        self.config[name] = value
-
-    def get(self, name):
-        if name in self.config:
-            return self.config[name]
-        else:
-            return None
diff --git a/client/bin/harness.py b/client/bin/harness.py
index d8a5191..a2f6461 100644
--- a/client/bin/harness.py
+++ b/client/bin/harness.py
@@ -3,11 +3,15 @@
 The interface between the client and the server when hosted.
 """
 
+# pylint: disable=missing-docstring
+
 __author__ = """Copyright Andy Whitcroft 2006"""
 
-import os, sys, logging
+import logging
+
 import common
 
+
 class harness(object):
     """The NULL server harness
 
@@ -31,12 +35,6 @@
         """
         self.job = job
 
-        configd = os.path.join(os.environ['AUTODIR'], 'configs')
-        if os.path.isdir(configd):
-            (name, dirs, files) = os.walk(configd).next()
-            job.config_set('kernel.default_config_set',
-                           [ configd + '/' ] + files)
-
 
     def run_start(self):
         """A run within this job is starting"""
@@ -87,7 +85,7 @@
     if not which:
         which = 'standalone'
 
-    logging.debug('Selected harness: %s' % which)
+    logging.debug('Selected harness: %s', which)
 
     harness_name = 'harness_%s' % which
     harness_module = common.setup_modules.import_module(harness_name,
diff --git a/client/bin/harness_ABAT.py b/client/bin/harness_ABAT.py
deleted file mode 100644
index 2ee8694..0000000
--- a/client/bin/harness_ABAT.py
+++ /dev/null
@@ -1,148 +0,0 @@
-"""The ABAT harness interface
-
-The interface as required for ABAT.
-"""
-
-__author__ = """Copyright Andy Whitcroft 2006"""
-
-from autotest_lib.client.bin import utils
-import os, harness, time, re
-
-def autobench_load(fn):
-    disks = re.compile(r'^\s*DATS_FREE_DISKS\s*=(.*\S)\s*$')
-    parts = re.compile(r'^\s*DATS_FREE_PARTITIONS\s*=(.*\S)\s*$')
-    modules = re.compile(r'^\s*INITRD_MODULES\s*=(.*\S)\s*$')
-
-    conf = {}
-
-    try:
-        fd = file(fn, "r")
-    except:
-        return conf
-    for ln in fd.readlines():
-        m = disks.match(ln)
-        if m:
-            val = m.groups()[0]
-            conf['disks'] = val.strip('"').split()
-        m = parts.match(ln)
-        if m:
-            val = m.groups()[0]
-            conf['partitions'] = val.strip('"').split()
-        m = modules.match(ln)
-        if m:
-            val = m.groups()[0]
-            conf['modules'] = val.strip('"').split()
-    fd.close()
-
-    return conf
-
-
-class harness_ABAT(harness.harness):
-    """The ABAT server harness
-
-    Properties:
-            job
-                    The job object for this job
-    """
-
-    def __init__(self, job, harness_args):
-        """
-                job
-                        The job object for this job
-        """
-        self.setup(job)
-
-        if 'ABAT_STATUS' in os.environ:
-            self.status = file(os.environ['ABAT_STATUS'], "w")
-        else:
-            self.status = None
-
-
-    def __send(self, msg):
-        if self.status:
-            msg = msg.rstrip()
-            self.status.write(msg + "\n")
-            self.status.flush()
-
-
-    def __send_status(self, code, subdir, operation, msg):
-        self.__send("STATUS %s %s %s %s" % (code, subdir, operation, msg))
-
-
-    def __root_device(self):
-        device = None
-        root = re.compile(r'^\S*(/dev/\S+).*\s/\s*$')
-
-        df = utils.system_output('df -lP')
-        for line in df.split("\n"):
-            m = root.match(line)
-            if m:
-                device = m.groups()[0]
-
-        return device
-
-
-    def run_start(self):
-        """A run within this job is starting"""
-        self.__send_status('GOOD', '----', '----', 'run starting')
-
-        # Load up the autobench.conf if it exists.
-        conf = autobench_load("/etc/autobench.conf")
-        if 'partitions' in conf:
-            self.job.config_set('partition.partitions',
-                    conf['partitions'])
-
-        # Search the boot loader configuration for the autobench entry,
-        # and extract its args.
-        args = None
-        for entry in self.job.bootloader.get_entries().itervalues():
-            if entry['title'].startswith('autobench'):
-                args = entry.get('args')
-
-        if args:
-            args = re.sub(r'autobench_args:.*', '', args)
-            args = re.sub(r'root=\S*', '', args)
-            args += " root=" + self.__root_device()
-
-            self.job.config_set('boot.default_args', args)
-
-        # Turn off boot_once semantics.
-        self.job.config_set('boot.set_default', True)
-
-        # For RedHat installs we do not load up the module.conf
-        # as they cannot be builtin.  Pass them as arguments.
-        vendor = utils.get_os_vendor()
-        if vendor in ['Red Hat', 'Fedora Core'] and 'modules' in conf:
-            args = '--allow-missing'
-            for mod in conf['modules']:
-                args += " --with " + mod
-            self.job.config_set('kernel.mkinitrd_extra_args', args)
-
-
-    def run_reboot(self):
-        """A run within this job is performing a reboot
-           (expect continue following reboot)
-        """
-        self.__send("REBOOT")
-
-
-    def run_complete(self):
-        """A run within this job is completing (all done)"""
-        self.__send("DONE")
-
-
-    def test_status_detail(self, code, subdir, operation, msg, tag,
-                           optional_fields):
-        """A test within this job is completing (detail)"""
-
-        # Send the first line with the status code as a STATUS message.
-        lines = msg.split("\n")
-        self.__send_status(code, subdir, operation, lines[0])
-
-
-    def test_status(self, msg, tag):
-        lines = msg.split("\n")
-
-        # Send each line as a SUMMARY message.
-        for line in lines:
-            self.__send("SUMMARY :" + line)
diff --git a/client/bin/harness_unittest.py b/client/bin/harness_unittest.py
index a94af55..8a6f2b4 100755
--- a/client/bin/harness_unittest.py
+++ b/client/bin/harness_unittest.py
@@ -1,8 +1,10 @@
 #!/usr/bin/python
+# pylint: disable=missing-docstring
+
 import unittest
 import common
 from autotest_lib.client.common_lib.test_utils import mock
-from autotest_lib.client.bin import harness, harness_standalone, harness_ABAT
+from autotest_lib.client.bin import harness, harness_standalone
 
 
 class harness_unittest(unittest.TestCase):
@@ -34,15 +36,5 @@
         self.god.check_playback()
 
 
-    def test_select_ABAT(self):
-        job = object()
-        self.god.stub_class(harness_ABAT, "harness_ABAT")
-
-        harness_args = ''
-        harness_ABAT.harness_ABAT.expect_new(job, harness_args)
-        harness.select('ABAT', job, harness_args)
-        self.god.check_playback()
-
-
 if  __name__ == "__main__":
     unittest.main()
diff --git a/client/bin/job.py b/client/bin/job.py
index 20bb276..43f729b 100644
--- a/client/bin/job.py
+++ b/client/bin/job.py
@@ -5,12 +5,14 @@
 Copyright Andy Whitcroft, Martin J. Bligh 2006
 """
 
+# pylint: disable=missing-docstring
+
 import copy, os, re, shutil, sys, time, traceback, types, glob
 import logging, getpass, weakref
 from autotest_lib.client.bin import client_logging_config
-from autotest_lib.client.bin import utils, parallel, kernel, xen
-from autotest_lib.client.bin import profilers, boottool, harness
-from autotest_lib.client.bin import config, sysinfo, test, local_host
+from autotest_lib.client.bin import utils, parallel
+from autotest_lib.client.bin import profilers, harness
+from autotest_lib.client.bin import sysinfo, test, local_host
 from autotest_lib.client.bin import partition as partition_lib
 from autotest_lib.client.common_lib import base_job
 from autotest_lib.client.common_lib import error, barrier, logging_manager
@@ -76,7 +78,6 @@
 
     Optional properties provided by this implementation:
         control
-        bootloader
         harness
     """
 
@@ -90,8 +91,7 @@
         '_state', '_max_disk_usage_rate', 0.0, namespace='client')
 
 
-    def __init__(self, control, options, drop_caches=True,
-                 extra_copy_cmdline=None):
+    def __init__(self, control, options, drop_caches=True):
         """
         Prepare a client side job object.
 
@@ -104,15 +104,11 @@
                           method will be called during construction.  [False]
         @param drop_caches: If true, utils.drop_caches() is called before and
                 between all tests.  [True]
-        @param extra_copy_cmdline: list of additional /proc/cmdline arguments to
-                copy from the running kernel to all the installed kernels with
-                this job
         """
         super(base_client_job, self).__init__(options=options)
         self._pre_record_init(control, options)
         try:
-            self._post_record_init(control, options, drop_caches,
-                                   extra_copy_cmdline)
+            self._post_record_init(control, options, drop_caches)
         except Exception, err:
             self.record(
                     'ABORT', None, None,'client.bin.job.__init__ failed: %s' %
@@ -212,8 +208,8 @@
             self, status_indenter(self), record_hook=client_job_record_hook,
             tap_writer=self._tap)
 
-    def _post_record_init(self, control, options, drop_caches,
-                          extra_copy_cmdline):
+
+    def _post_record_init(self, control, options, drop_caches):
         """
         Perform job initialization not required by self.record().
         """
@@ -238,18 +234,14 @@
                 manage_stdout_and_stderr=True, redirect_fds=True)
         self.logging.start_logging()
 
-        self._config = config.config(self)
         self.profilers = profilers.profilers(self)
 
-        self._init_bootloader()
-
         self.machines = [options.hostname]
         self.machine_dict_list = [{'hostname' : options.hostname}]
         # Client side tests should always run the same whether or not they are
         # running in the lab.
         self.in_lab = False
-        self.hosts = set([local_host.LocalHost(hostname=options.hostname,
-                                               bootloader=self.bootloader)])
+        self.hosts = set([local_host.LocalHost(hostname=options.hostname)])
 
         self.args = []
         if options.args:
@@ -270,8 +262,6 @@
         if options.log:
             self.enable_external_logging()
 
-        self._init_cmdline(extra_copy_cmdline)
-
         self.num_tests_run = None
         self.num_tests_failed = None
 
@@ -292,14 +282,6 @@
             utils.drop_caches()
 
 
-    def _init_bootloader(self):
-        """
-        Perform boottool initialization.
-        """
-        tool = self.config_get('boottool.executable')
-        self.bootloader = boottool.boottool(tool)
-
-
     def _init_packages(self):
         """
         Perform the packages support initialization.
@@ -308,26 +290,6 @@
             self.autodir, run_function_dargs={'timeout':3600})
 
 
-    def _init_cmdline(self, extra_copy_cmdline):
-        """
-        Initialize default cmdline for booted kernels in this job.
-        """
-        copy_cmdline = set(['console'])
-        if extra_copy_cmdline is not None:
-            copy_cmdline.update(extra_copy_cmdline)
-
-        # extract console= and other args from cmdline and add them into the
-        # base args that we use for all kernels we install
-        cmdline = utils.read_one_line('/proc/cmdline')
-        kernel_args = []
-        for karg in cmdline.split():
-            for param in copy_cmdline:
-                if karg.startswith(param) and \
-                    (len(param) == len(karg) or karg[len(param)] == '='):
-                    kernel_args.append(karg)
-        self.config_set('boot.default_args', ' '.join(kernel_args))
-
-
     def _cleanup_results_dir(self):
         """Delete everything in resultsdir"""
         assert os.path.exists(self.resultdir)
@@ -376,14 +338,6 @@
         self._max_disk_usage_rate = max_rate
 
 
-    def relative_path(self, path):
-        """\
-        Return a patch relative to the job results directory
-        """
-        head = len(self.resultdir) + 1     # remove the / inbetween
-        return path[head:]
-
-
     def control_get(self):
         return self.control
 
@@ -396,14 +350,6 @@
         self.harness = harness.select(which, self, harness_args)
 
 
-    def config_set(self, name, value):
-        self._config.set(name, value)
-
-
-    def config_get(self, name):
-        return self._config.get(name)
-
-
     def setup_dirs(self, results_dir, tmp_dir):
         if not tmp_dir:
             tmp_dir = os.path.join(self.tmpdir, 'build')
@@ -417,7 +363,7 @@
         # as "build.2", "build.3", etc. Whilst this is a little bit
         # inconsistent, 99.9% of jobs will only have one build
         # (that's not done as kernbench, sparse, or buildtest),
-        # so it works out much cleaner. One of life's comprimises.
+        # so it works out much cleaner. One of life's compromises.
         if not results_dir:
             results_dir = os.path.join(self.resultdir, 'build')
             i = 2
@@ -430,23 +376,6 @@
         return (results_dir, tmp_dir)
 
 
-    def xen(self, base_tree, results_dir = '', tmp_dir = '', leave = False, \
-                            kjob = None ):
-        """Summon a xen object"""
-        (results_dir, tmp_dir) = self.setup_dirs(results_dir, tmp_dir)
-        build_dir = 'xen'
-        return xen.xen(self, base_tree, results_dir, tmp_dir, build_dir,
-                       leave, kjob)
-
-
-    def kernel(self, base_tree, results_dir = '', tmp_dir = '', leave = False):
-        """Summon a kernel object"""
-        (results_dir, tmp_dir) = self.setup_dirs(results_dir, tmp_dir)
-        build_dir = 'linux'
-        return kernel.auto_kernel(self, base_tree, results_dir, tmp_dir,
-                                  build_dir, leave)
-
-
     def barrier(self, *args, **kwds):
         """Create a barrier object"""
         return barrier.barrier(*args, **kwds)
@@ -775,64 +704,6 @@
             raise error.JobError('Reboot failed: %s' % description)
 
 
-    def end_reboot(self, subdir, kernel, patches, running_id=None):
-        self._check_post_reboot(subdir, running_id=running_id)
-
-        # strip ::<timestamp> from the kernel version if present
-        kernel = kernel.split("::")[0]
-        kernel_info = {"kernel": kernel}
-        for i, patch in enumerate(patches):
-            kernel_info["patch%d" % i] = patch
-        self.record("END GOOD", subdir, "reboot", optional_fields=kernel_info)
-
-
-    def end_reboot_and_verify(self, expected_when, expected_id, subdir,
-                              type='src', patches=[]):
-        """ Check the passed kernel identifier against the command line
-            and the running kernel, abort the job on missmatch. """
-
-        logging.info("POST BOOT: checking booted kernel "
-                     "mark=%d identity='%s' type='%s'",
-                     expected_when, expected_id, type)
-
-        running_id = utils.running_os_ident()
-
-        cmdline = utils.read_one_line("/proc/cmdline")
-
-        find_sum = re.compile(r'.*IDENT=(\d+)')
-        m = find_sum.match(cmdline)
-        cmdline_when = -1
-        if m:
-            cmdline_when = int(m.groups()[0])
-
-        # We have all the facts, see if they indicate we
-        # booted the requested kernel or not.
-        bad = False
-        if (type == 'src' and expected_id != running_id or
-            type == 'rpm' and
-            not running_id.startswith(expected_id + '::')):
-            logging.error("Kernel identifier mismatch")
-            bad = True
-        if expected_when != cmdline_when:
-            logging.error("Kernel command line mismatch")
-            bad = True
-
-        if bad:
-            logging.error("   Expected Ident: " + expected_id)
-            logging.error("    Running Ident: " + running_id)
-            logging.error("    Expected Mark: %d", expected_when)
-            logging.error("Command Line Mark: %d", cmdline_when)
-            logging.error("     Command Line: " + cmdline)
-
-            self._record_reboot_failure(subdir, "reboot.verify", "boot failure",
-                                        running_id=running_id)
-            raise error.JobError("Reboot returned with the wrong kernel")
-
-        self.record('GOOD', subdir, 'reboot.verify',
-                    utils.running_os_full_version())
-        self.end_reboot(subdir, expected_id, patches, running_id=running_id)
-
-
     def partition(self, device, loop_size=0, mountpoint=None):
         """
         Work with a machine partition
@@ -875,19 +746,9 @@
         self._state.set('client', 'cpu_count', utils.count_cpus())
 
 
-    def reboot(self, tag=LAST_BOOT_TAG):
-        if tag == LAST_BOOT_TAG:
-            tag = self.last_boot_tag
-        else:
-            self.last_boot_tag = tag
-
+    def reboot(self):
         self.reboot_setup()
         self.harness.run_reboot()
-        default = self.config_get('boot.set_default')
-        if default:
-            self.bootloader.set_default(tag)
-        else:
-            self.bootloader.boot_once(tag)
 
         # HACK: using this as a module sometimes hangs shutdown, so if it's
         # installed unload it first
diff --git a/client/bin/job_unittest.py b/client/bin/job_unittest.py
index 205aa8f..b3107df 100755
--- a/client/bin/job_unittest.py
+++ b/client/bin/job_unittest.py
@@ -1,17 +1,17 @@
 #!/usr/bin/python
+# pylint: disable=missing-docstring
 
 import logging
 import os
 import shutil
 import StringIO
 import sys
-import time
 import unittest
 
 import common
-from autotest_lib.client.bin import job, boottool, config, sysinfo, harness
-from autotest_lib.client.bin import test, xen, kernel, utils
-from autotest_lib.client.common_lib import packages, error, log
+from autotest_lib.client.bin import job, sysinfo, harness
+from autotest_lib.client.bin import utils
+from autotest_lib.client.common_lib import error
 from autotest_lib.client.common_lib import logging_manager, logging_config
 from autotest_lib.client.common_lib import base_job_unittest
 from autotest_lib.client.common_lib.test_utils import mock
@@ -55,7 +55,7 @@
     job.__init__ generic tests."""
     OPTIONAL_ATTRIBUTES = (
         base_job_unittest.test_init.generic_tests.OPTIONAL_ATTRIBUTES
-        - set(['control', 'bootloader', 'harness']))
+        - set(['control', 'harness']))
 
 
 class test_init_minimal_options(abstract_test_init, job_test_case):
@@ -82,7 +82,6 @@
         class stub_harness:
             run_start = lambda self: None
         self.god.stub_function_to_return(job.harness, 'select', stub_harness())
-        self.god.stub_function_to_return(job.boottool, 'boottool', object())
         class options:
             tag = ''
             verbose = False
@@ -157,9 +156,7 @@
         self.god.stub_function(harness, 'select')
         self.god.stub_function(sysinfo, 'log_per_reboot_data')
 
-        self.god.stub_class(config, 'config')
         self.god.stub_class(job.local_host, 'LocalHost')
-        self.god.stub_class(boottool, 'boottool')
         self.god.stub_class(sysinfo, 'sysinfo')
 
         self.god.stub_class_method(job.base_client_job,
@@ -214,24 +211,13 @@
             shutil.copyfile.expect_call(mock.is_string_comparator(),
                                  os.path.join(resultdir, 'control'))
 
-        self.config = config.config.expect_new(self.job)
-        self.job.config_get.expect_call(
-                'boottool.executable').and_return(None)
-        bootloader = boottool.boottool.expect_new(None)
-        job.local_host.LocalHost.expect_new(hostname='localhost',
-                                            bootloader=bootloader)
+        job.local_host.LocalHost.expect_new(hostname='localhost')
         job_sysinfo.log_per_reboot_data.expect_call()
         if not cont:
             self.job.record.expect_call('START', None, None)
 
         my_harness.run_start.expect_call()
 
-        self.god.stub_function(utils, 'read_one_line')
-        utils.read_one_line.expect_call('/proc/cmdline').and_return(
-            'blah more-blah root=lala IDENT=81234567 blah-again console=tty1')
-        self.job.config_set.expect_call('boot.default_args',
-                                        'more-blah console=tty1')
-
 
     def construct_job(self, cont):
         # will construct class instance using __new__
@@ -254,8 +240,7 @@
         options.args = ''
         options.output_dir = ''
         options.tap_report = None
-        self.job.__init__(self.control, options,
-                          extra_copy_cmdline=['more-blah'])
+        self.job.__init__(self.control, options)
 
         # check
         self.god.check_playback()
@@ -303,26 +288,19 @@
 
         self._setup_pre_record_init(False)
         self.job._post_record_init.expect_call(
-                self.control, options, True, ['more-blah']).and_raises(error)
+                self.control, options, True).and_raises(error)
         self.job.record.expect_call(
                 'ABORT', None, None,'client.bin.job.__init__ failed: %s' %
                 str(error))
 
         self.assertRaises(
                 Exception, self.job.__init__, self.control, options,
-                drop_caches=True, extra_copy_cmdline=['more-blah'])
+                drop_caches=True)
 
         # check
         self.god.check_playback()
 
 
-    def test_relative_path(self):
-        self.construct_job(True)
-        dummy = "asdf"
-        ret = self.job.relative_path(os.path.join(self.job.resultdir, dummy))
-        self.assertEquals(ret, dummy)
-
-
     def test_control_functions(self):
         self.construct_job(True)
         control_file = "blah"
@@ -344,36 +322,6 @@
         self.god.check_playback()
 
 
-    def test_config_set(self):
-        self.construct_job(True)
-
-        # unstub config_set
-        self.god.unstub(self.job, 'config_set')
-        # record
-        name = "foo"
-        val = 10
-        self.config.set.expect_call(name, val)
-
-        # run and test
-        self.job.config_set(name, val)
-        self.god.check_playback()
-
-
-    def test_config_get(self):
-        self.construct_job(True)
-
-        # unstub config_get
-        self.god.unstub(self.job, 'config_get')
-        # record
-        name = "foo"
-        val = 10
-        self.config.get.expect_call(name).and_return(val)
-
-        # run and test
-        self.job.config_get(name)
-        self.god.check_playback()
-
-
     def test_setup_dirs_raise(self):
         self.construct_job(True)
 
@@ -415,85 +363,6 @@
         self.god.check_playback()
 
 
-    def test_xen(self):
-        self.construct_job(True)
-
-        # setup
-        self.god.stub_function(self.job, "setup_dirs")
-        self.god.stub_class(xen, "xen")
-        results = 'results_dir'
-        tmp = 'tmp'
-        build = 'xen'
-        base_tree = object()
-
-        # record
-        self.job.setup_dirs.expect_call(results,
-                                        tmp).and_return((results, tmp))
-        myxen = xen.xen.expect_new(self.job, base_tree, results, tmp, build,
-                                   False, None)
-
-        # run job and check
-        axen = self.job.xen(base_tree, results, tmp)
-        self.god.check_playback()
-        self.assertEquals(myxen, axen)
-
-
-    def test_kernel_rpm(self):
-        self.construct_job(True)
-
-        # setup
-        self.god.stub_function(self.job, "setup_dirs")
-        self.god.stub_class(kernel, "rpm_kernel")
-        self.god.stub_function(kernel, "preprocess_path")
-        self.god.stub_function(self.job.pkgmgr, "fetch_pkg")
-        self.god.stub_function(utils, "get_os_vendor")
-        results = 'results_dir'
-        tmp = 'tmp'
-        build = 'xen'
-        path = "somepath.rpm"
-        packages_dir = os.path.join("autodir/packages", path)
-
-        # record
-        self.job.setup_dirs.expect_call(results,
-                                        tmp).and_return((results, tmp))
-        kernel.preprocess_path.expect_call(path).and_return(path)
-        os.path.exists.expect_call(path).and_return(False)
-        self.job.pkgmgr.fetch_pkg.expect_call(path, packages_dir, repo_url='')
-        utils.get_os_vendor.expect_call()
-        mykernel = kernel.rpm_kernel.expect_new(self.job, [packages_dir],
-                                                results)
-
-        # check
-        akernel = self.job.kernel(path, results, tmp)
-        self.god.check_playback()
-        self.assertEquals(mykernel, akernel)
-
-
-    def test_kernel(self):
-        self.construct_job(True)
-
-        # setup
-        self.god.stub_function(self.job, "setup_dirs")
-        self.god.stub_class(kernel, "kernel")
-        self.god.stub_function(kernel, "preprocess_path")
-        results = 'results_dir'
-        tmp = 'tmp'
-        build = 'linux'
-        path = "somepath.deb"
-
-        # record
-        self.job.setup_dirs.expect_call(results,
-                                        tmp).and_return((results, tmp))
-        kernel.preprocess_path.expect_call(path).and_return(path)
-        mykernel = kernel.kernel.expect_new(self.job, path, results, tmp,
-                                            build, False)
-
-        # check
-        akernel = self.job.kernel(path, results, tmp)
-        self.god.check_playback()
-        self.assertEquals(mykernel, akernel)
-
-
     def test_run_test_logs_test_error_from_unhandled_error(self):
         self.construct_job(True)
 
@@ -644,73 +513,6 @@
         self.god.check_playback()
 
 
-    def test_end_boot(self):
-        self.construct_job(True)
-        self.god.stub_function(self.job, "_check_post_reboot")
-
-        # set up the job class
-        self.job._record_prefix = '\t\t'
-
-        self.job._check_post_reboot.expect_call("sub", running_id=None)
-        self.job.record.expect_call("END GOOD", "sub", "reboot",
-                                    optional_fields={"kernel": "2.6.15-smp",
-                                                     "patch0": "patchname"})
-
-        # run test
-        self.job.end_reboot("sub", "2.6.15-smp", ["patchname"])
-        self.god.check_playback()
-
-
-    def test_end_boot_and_verify_success(self):
-        self.construct_job(True)
-        self.god.stub_function(self.job, "_check_post_reboot")
-
-        # set up the job class
-        self.job._record_prefix = '\t\t'
-
-        self.god.stub_function(utils, "running_os_ident")
-        utils.running_os_ident.expect_call().and_return("2.6.15-smp")
-
-        utils.read_one_line.expect_call("/proc/cmdline").and_return(
-            "blah more-blah root=lala IDENT=81234567 blah-again")
-
-        self.god.stub_function(utils, "running_os_full_version")
-        running_id = "2.6.15-smp"
-        utils.running_os_full_version.expect_call().and_return(running_id)
-
-        self.job.record.expect_call("GOOD", "sub", "reboot.verify",
-                                    running_id)
-        self.job._check_post_reboot.expect_call("sub", running_id=running_id)
-        self.job.record.expect_call("END GOOD", "sub", "reboot",
-                                    optional_fields={"kernel": running_id})
-
-        # run test
-        self.job.end_reboot_and_verify(81234567, "2.6.15-smp", "sub")
-        self.god.check_playback()
-
-
-    def test_end_boot_and_verify_failure(self):
-        self.construct_job(True)
-        self.god.stub_function(self.job, "_record_reboot_failure")
-
-        # set up the job class
-        self.job._record_prefix = '\t\t'
-
-        self.god.stub_function(utils, "running_os_ident")
-        utils.running_os_ident.expect_call().and_return("2.6.15-smp")
-
-        utils.read_one_line.expect_call("/proc/cmdline").and_return(
-            "blah more-blah root=lala IDENT=81234567 blah-again")
-
-        self.job._record_reboot_failure.expect_call("sub", "reboot.verify",
-                "boot failure", running_id="2.6.15-smp")
-
-        # run test
-        self.assertRaises(error.JobError, self.job.end_reboot_and_verify,
-                          91234567, "2.6.16-smp", "sub")
-        self.god.check_playback()
-
-
     def test_parse_args(self):
         test_set = {"a='foo bar baz' b='moo apt'":
                     ["a='foo bar baz'", "b='moo apt'"],
diff --git a/client/bin/kernel.py b/client/bin/kernel.py
deleted file mode 100644
index cb0ef99..0000000
--- a/client/bin/kernel.py
+++ /dev/null
@@ -1,877 +0,0 @@
-import os, shutil, copy, pickle, re, glob, time, logging
-from autotest_lib.client.bin import kernel_config, os_dep, kernelexpand, test
-from autotest_lib.client.bin import utils
-from autotest_lib.client.common_lib import log, error, packages
-
-
-def tee_output_logdir_mark(fn):
-    def tee_logdir_mark_wrapper(self, *args, **dargs):
-        mark = self.__class__.__name__ + "." + fn.__name__
-        logging.info("--- START %s ---", mark)
-        self.job.logging.tee_redirect_debug_dir(self.log_dir)
-        try:
-            result = fn(self, *args, **dargs)
-        finally:
-            self.job.logging.restore()
-            logging.info("--- END %s ---", mark)
-
-        return result
-
-    tee_logdir_mark_wrapper.__name__ = fn.__name__
-    return tee_logdir_mark_wrapper
-
-
-def _add_kernel_to_bootloader(bootloader, base_args, tag, args, image, initrd):
-    """
-    Add a kernel with the specified tag to the boot config using the given
-    bootloader object. Also process the base_args and args kernel arguments
-    by removing all root= options and give the last root= option value to
-    the bootloader as a root device.
-
-    @param bootloader: bootloader object
-    @param base_args: base cmdline kernel arguments
-    @param tag: kernel tag
-    @param args: kernel cmdline arguments that are merged with base_args; a
-            root= option in "args" will override any from base_args
-    @param image: kernel image file
-    @param initrd: initrd file
-    """
-    # remove existing entry if present
-    bootloader.remove_kernel(tag)
-
-    if base_args:
-        args = ' '.join((base_args, args))
-
-    root_prefix = 'root='
-    # stores the last root= value
-    root = None
-    # a list with all arguments that don't start with root= so we give them
-    # later to bootloader.add_kernel()
-    arglist = []
-
-    for arg in args.split():
-        if arg.startswith(root_prefix):
-            # set the current root value with the one from the argument
-            # thus after processing all the arguments we keep the last
-            # root value (so root= options from args overrides any from
-            # base_args)
-            root = arg[len(root_prefix):]
-        else:
-            arglist.append(arg)
-
-    # Add the kernel entry. it will keep all arguments from the default entry.
-    # args='_dummy_' is used to workaround a boottool limitation of not being
-    # able to add arguments to a kernel that does not already have any of its
-    # own by way of its own append= section below the image= line in lilo.conf.
-    bootloader.add_kernel(image, tag, initrd=initrd, root=root, args='_dummy_')
-    # Now, for each argument in arglist, try to add it to the kernel that was
-    # just added. In each step, if the arg already existed on the args string,
-    # that particular arg will be skipped
-    for a in arglist:
-        bootloader.add_args(kernel=tag, args=a)
-    bootloader.remove_args(kernel=tag, args='_dummy_')
-
-
-class BootableKernel(object):
-
-    def __init__(self, job):
-        self.job = job
-        self.installed_as = None  # kernel choice in bootloader menu
-        self.image = None
-        self.initrd = ''
-
-
-    def _boot_kernel(self, args, ident_check, expected_ident, subdir, notes):
-        """
-        Boot a kernel, with post-boot kernel id check
-
-        @param args:  kernel cmdline arguments
-        @param ident_check: check kernel id after boot
-        @param expected_ident:
-        @param subdir: job-step qualifier in status log
-        @param notes:  additional comment in status log
-        """
-        # If we can check the kernel identity do so.
-        if ident_check:
-            when = int(time.time())
-            args += " IDENT=%d" % when
-            self.job.next_step_prepend(["job.end_reboot_and_verify", when,
-                                        expected_ident, subdir, notes])
-        else:
-            self.job.next_step_prepend(["job.end_reboot", subdir,
-                                        expected_ident, notes])
-
-        self.add_to_bootloader(args)
-
-        # defer fsck for next reboot, to avoid reboots back to default kernel
-        utils.system('touch /fastboot')  # this file is removed automatically
-
-        # Boot it.
-        self.job.start_reboot()
-        self.job.reboot(tag=self.installed_as)
-
-
-    def add_to_bootloader(self, args=''):
-        # Point bootloader to the selected tag.
-        _add_kernel_to_bootloader(self.job.bootloader,
-                                  self.job.config_get('boot.default_args'),
-                                  self.installed_as, args, self.image,
-                                  self.initrd)
-
-
-class kernel(BootableKernel):
-    """ Class for compiling kernels.
-
-    Data for the object includes the src files
-    used to create the kernel, patches applied, config (base + changes),
-    the build directory itself, and logged output
-
-    Properties:
-            job
-                    Backpointer to the job object we're part of
-            autodir
-                    Path to the top level autotest dir (/usr/local/autotest)
-            src_dir
-                    <tmp_dir>/src/
-            build_dir
-                    <tmp_dir>/linux/
-            config_dir
-                    <results_dir>/config/
-            log_dir
-                    <results_dir>/debug/
-            results_dir
-                    <results_dir>/results/
-    """
-
-    autodir = ''
-
-    def __init__(self, job, base_tree, subdir, tmp_dir, build_dir, leave=False):
-        """Initialize the kernel build environment
-
-        job
-                which job this build is part of
-        base_tree
-                base kernel tree. Can be one of the following:
-                        1. A local tarball
-                        2. A URL to a tarball
-                        3. A local directory (will symlink it)
-                        4. A shorthand expandable (eg '2.6.11-git3')
-        subdir
-                subdir in the results directory (eg "build")
-                (holds config/, debug/, results/)
-        tmp_dir
-
-        leave
-                Boolean, whether to leave existing tmpdir or not
-        """
-        super(kernel, self).__init__(job)
-        self.autodir = job.autodir
-
-        self.src_dir    = os.path.join(tmp_dir, 'src')
-        self.build_dir  = os.path.join(tmp_dir, build_dir)
-                # created by get_kernel_tree
-        self.config_dir = os.path.join(subdir, 'config')
-        self.log_dir    = os.path.join(subdir, 'debug')
-        self.results_dir = os.path.join(subdir, 'results')
-        self.subdir     = os.path.basename(subdir)
-
-        if not leave:
-            if os.path.isdir(self.src_dir):
-                utils.system('rm -rf ' + self.src_dir)
-            if os.path.isdir(self.build_dir):
-                utils.system('rm -rf ' + self.build_dir)
-
-        if not os.path.exists(self.src_dir):
-            os.mkdir(self.src_dir)
-        for path in [self.config_dir, self.log_dir, self.results_dir]:
-            if os.path.exists(path):
-                utils.system('rm -rf ' + path)
-            os.mkdir(path)
-
-        logpath = os.path.join(self.log_dir, 'build_log')
-        self.logfile = open(logpath, 'w+')
-        self.applied_patches = []
-
-        self.target_arch = None
-        self.build_target = 'bzImage'
-        self.build_image = None
-
-        arch = utils.get_current_kernel_arch()
-        if arch == 's390' or arch == 's390x':
-            self.build_target = 'image'
-        elif arch == 'ia64':
-            self.build_target = 'all'
-            self.build_image = 'vmlinux.gz'
-
-        if not leave:
-            self.logfile.write('BASE: %s\n' % base_tree)
-
-            # Where we have direct version hint record that
-            # for later configuration selection.
-            shorthand = re.compile(r'^\d+\.\d+\.\d+')
-            if shorthand.match(base_tree):
-                self.base_tree_version = base_tree
-            else:
-                self.base_tree_version = None
-
-            # Actually extract the tree.  Make sure we know it occured
-            self.extract(base_tree)
-
-
-    def kernelexpand(self, kernel):
-        # If we have something like a path, just use it as it is
-        if '/' in kernel:
-            return [kernel]
-
-        # Find the configured mirror list.
-        mirrors = self.job.config_get('mirror.mirrors')
-        if not mirrors:
-            # LEGACY: convert the kernel.org mirror
-            mirror = self.job.config_get('mirror.ftp_kernel_org')
-            if mirror:
-                korg = 'http://www.kernel.org/pub/linux/kernel'
-                mirrors = [
-                  [ korg + '/v2.6', mirror + '/v2.6' ],
-                  [ korg + '/people/akpm/patches/2.6', mirror + '/akpm' ],
-                  [ korg + '/people/mbligh', mirror + '/mbligh' ],
-                ]
-
-        patches = kernelexpand.expand_classic(kernel, mirrors)
-        print patches
-
-        return patches
-
-
-    @log.record
-    @tee_output_logdir_mark
-    def extract(self, base_tree):
-        if os.path.exists(base_tree):
-            self.get_kernel_tree(base_tree)
-        else:
-            base_components = self.kernelexpand(base_tree)
-            print 'kernelexpand: '
-            print base_components
-            self.get_kernel_tree(base_components.pop(0))
-            if base_components:      # apply remaining patches
-                self.patch(*base_components)
-
-
-    @log.record
-    @tee_output_logdir_mark
-    def patch(self, *patches):
-        """Apply a list of patches (in order)"""
-        if not patches:
-            return
-        print 'Applying patches: ', patches
-        self.apply_patches(self.get_patches(patches))
-
-
-    @log.record
-    @tee_output_logdir_mark
-    def config(self, config_file = '', config_list = None, defconfig = False, make = None):
-        self.set_cross_cc()
-        config = kernel_config.kernel_config(self.job, self.build_dir,
-                 self.config_dir, config_file, config_list,
-                 defconfig, self.base_tree_version, make)
-
-
-    def get_patches(self, patches):
-        """fetch the patches to the local src_dir"""
-        local_patches = []
-        for patch in patches:
-            dest = os.path.join(self.src_dir, os.path.basename(patch))
-            # FIXME: this isn't unique. Append something to it
-            # like wget does if it's not there?
-            print "get_file %s %s %s %s" % (patch, dest, self.src_dir,
-                                            os.path.basename(patch))
-            utils.get_file(patch, dest)
-            # probably safer to use the command, not python library
-            md5sum = utils.system_output('md5sum ' + dest).split()[0]
-            local_patches.append((patch, dest, md5sum))
-        return local_patches
-
-
-    def apply_patches(self, local_patches):
-        """apply the list of patches, in order"""
-        builddir = self.build_dir
-        os.chdir(builddir)
-
-        if not local_patches:
-            return None
-        for (spec, local, md5sum) in local_patches:
-            if local.endswith('.bz2') or local.endswith('.gz'):
-                ref = spec
-            else:
-                ref = utils.force_copy(local, self.results_dir)
-                ref = self.job.relative_path(ref)
-            patch_id = "%s %s %s" % (spec, ref, md5sum)
-            log = "PATCH: " + patch_id + "\n"
-            print log
-            utils.cat_file_to_cmd(local, 'patch -p1 > /dev/null')
-            self.logfile.write(log)
-            self.applied_patches.append(patch_id)
-
-
-    def get_kernel_tree(self, base_tree):
-        """Extract/link base_tree to self.build_dir"""
-
-        # if base_tree is a dir, assume uncompressed kernel
-        if os.path.isdir(base_tree):
-            print 'Symlinking existing kernel source'
-            if os.path.islink(self.build_dir):
-                os.remove(self.build_dir)
-            os.symlink(base_tree, self.build_dir)
-
-        # otherwise, extract tarball
-        else:
-            os.chdir(os.path.dirname(self.src_dir))
-            # Figure out local destination for tarball
-            tarball = os.path.join(self.src_dir, os.path.basename(base_tree.split(';')[0]))
-            utils.get_file(base_tree, tarball)
-            print 'Extracting kernel tarball:', tarball, '...'
-            utils.extract_tarball_to_dir(tarball, self.build_dir)
-
-
-    def extraversion(self, tag, append=True):
-        os.chdir(self.build_dir)
-        extraversion_sub = r's/^CONFIG_LOCALVERSION=\s*"\(.*\)"/CONFIG_LOCALVERSION='
-        cfg = self.build_dir + '/.config'
-        if append:
-            p = extraversion_sub + '"\\1-%s"/' % tag
-        else:
-            p = extraversion_sub + '"-%s"/' % tag
-        utils.system('mv %s %s.old' % (cfg, cfg))
-        utils.system("sed '%s' < %s.old > %s" % (p, cfg, cfg))
-        self.config(make='oldconfig')
-
-
-    @log.record
-    @tee_output_logdir_mark
-    def build(self, make_opts = '', logfile = '', extraversion='autotest'):
-        """build the kernel
-
-        make_opts
-                additional options to make, if any
-        """
-        os_dep.commands('gcc', 'make')
-        if logfile == '':
-            logfile = os.path.join(self.log_dir, 'kernel_build')
-        os.chdir(self.build_dir)
-        if extraversion:
-            self.extraversion(extraversion)
-        self.set_cross_cc()
-        # setup_config_file(config_file, config_overrides)
-
-        # Not needed on 2.6, but hard to tell -- handle failure
-        utils.system('make dep', ignore_status=True)
-        threads = 2 * utils.count_cpus()
-        build_string = 'make -j %d %s %s' % (threads, make_opts,
-                                     self.build_target)
-                                # eg make bzImage, or make zImage
-        print build_string
-        utils.system(build_string)
-        if kernel_config.modules_needed('.config'):
-            utils.system('make -j %d modules' % (threads))
-
-        kernel_version = self.get_kernel_build_ver()
-        kernel_version = re.sub('-autotest', '', kernel_version)
-        self.logfile.write('BUILD VERSION: %s\n' % kernel_version)
-
-        utils.force_copy(self.build_dir+'/System.map',
-                                  self.results_dir)
-
-
-    def build_timed(self, threads, timefile = '/dev/null', make_opts = '',
-                                                    output = '/dev/null'):
-        """time the bulding of the kernel"""
-        os.chdir(self.build_dir)
-        self.set_cross_cc()
-
-        self.clean()
-        build_string = "/usr/bin/time -o %s make %s -j %s vmlinux" \
-                                        % (timefile, make_opts, threads)
-        build_string += ' > %s 2>&1' % output
-        print build_string
-        utils.system(build_string)
-
-        if (not os.path.isfile('vmlinux')):
-            errmsg = "no vmlinux found, kernel build failed"
-            raise error.TestError(errmsg)
-
-
-    @log.record
-    @tee_output_logdir_mark
-    def clean(self):
-        """make clean in the kernel tree"""
-        os.chdir(self.build_dir)
-        print "make clean"
-        utils.system('make clean > /dev/null 2> /dev/null')
-
-
-    @log.record
-    @tee_output_logdir_mark
-    def mkinitrd(self, version, image, system_map, initrd):
-        """Build kernel initrd image.
-        Try to use distro specific way to build initrd image.
-        Parameters:
-                version
-                        new kernel version
-                image
-                        new kernel image file
-                system_map
-                        System.map file
-                initrd
-                        initrd image file to build
-        """
-        vendor = utils.get_os_vendor()
-
-        if os.path.isfile(initrd):
-            print "Existing %s file, will remove it." % initrd
-            os.remove(initrd)
-
-        args = self.job.config_get('kernel.mkinitrd_extra_args')
-
-        # don't leak 'None' into mkinitrd command
-        if not args:
-            args = ''
-
-        # It is important to match the version with a real directory inside
-        # /lib/modules
-        real_version_list = glob.glob('/lib/modules/%s*' % version)
-        rl = len(real_version_list)
-        if rl == 0:
-            logging.error("No directory %s found under /lib/modules. Initramfs"
-                          "creation will most likely fail and your new kernel"
-                          "will fail to build", version)
-        else:
-            if rl > 1:
-                logging.warning("Found more than one possible match for "
-                                "kernel version %s under /lib/modules", version)
-            version = os.path.basename(real_version_list[0])
-
-        if vendor in ['Red Hat', 'Fedora Core']:
-            try:
-                cmd = os_dep.command('dracut')
-                full_cmd = '%s -f %s %s' % (cmd, initrd, version)
-            except ValueError:
-                cmd = os_dep.command('mkinitrd')
-                full_cmd = '%s %s %s %s' % (cmd, args, initrd, version)
-            utils.system(full_cmd)
-        elif vendor in ['SUSE']:
-            utils.system('mkinitrd %s -k %s -i %s -M %s' %
-                         (args, image, initrd, system_map))
-        elif vendor in ['Debian', 'Ubuntu']:
-            if os.path.isfile('/usr/sbin/mkinitrd'):
-                cmd = '/usr/sbin/mkinitrd'
-            elif os.path.isfile('/usr/sbin/mkinitramfs'):
-                cmd = '/usr/sbin/mkinitramfs'
-            else:
-                raise error.TestError('No Debian initrd builder')
-            utils.system('%s %s -o %s %s' % (cmd, args, initrd, version))
-        else:
-            raise error.TestError('Unsupported vendor %s' % vendor)
-
-
-    def set_build_image(self, image):
-        self.build_image = image
-
-
-    @log.record
-    @tee_output_logdir_mark
-    def install(self, tag='autotest', prefix = '/'):
-        """make install in the kernel tree"""
-
-        # Record that we have installed the kernel, and
-        # the tag under which we installed it.
-        self.installed_as = tag
-
-        os.chdir(self.build_dir)
-
-        if not os.path.isdir(prefix):
-            os.mkdir(prefix)
-        self.boot_dir = os.path.join(prefix, 'boot')
-        if not os.path.isdir(self.boot_dir):
-            os.mkdir(self.boot_dir)
-
-        if not self.build_image:
-            images = glob.glob('arch/*/boot/' + self.build_target)
-            if len(images):
-                self.build_image = images[0]
-            else:
-                self.build_image = self.build_target
-
-        # remember installed files
-        self.vmlinux = self.boot_dir + '/vmlinux-' + tag
-        if (self.build_image != 'vmlinux'):
-            self.image = self.boot_dir + '/vmlinuz-' + tag
-        else:
-            self.image = self.vmlinux
-        self.system_map = self.boot_dir + '/System.map-' + tag
-        self.config_file = self.boot_dir + '/config-' + tag
-        self.initrd = ''
-
-        # copy to boot dir
-        utils.force_copy('vmlinux', self.vmlinux)
-        if (self.build_image != 'vmlinux'):
-            utils.force_copy(self.build_image, self.image)
-        utils.force_copy('System.map', self.system_map)
-        utils.force_copy('.config', self.config_file)
-
-        if not kernel_config.modules_needed('.config'):
-            return
-
-        utils.system('make modules_install INSTALL_MOD_PATH=%s' % prefix)
-        if prefix == '/':
-            self.initrd = self.boot_dir + '/initrd-' + tag
-            self.mkinitrd(self.get_kernel_build_ver(), self.image,
-                          self.system_map, self.initrd)
-
-
-    def get_kernel_build_arch(self, arch=None):
-        """
-        Work out the current kernel architecture (as a kernel arch)
-        """
-        if not arch:
-            arch = utils.get_current_kernel_arch()
-        if re.match('i.86', arch):
-            return 'i386'
-        elif re.match('sun4u', arch):
-            return 'sparc64'
-        elif re.match('arm.*', arch):
-            return 'arm'
-        elif re.match('sa110', arch):
-            return 'arm'
-        elif re.match('s390x', arch):
-            return 's390'
-        elif re.match('parisc64', arch):
-            return 'parisc'
-        elif re.match('ppc.*', arch):
-            return 'powerpc'
-        elif re.match('mips.*', arch):
-            return 'mips'
-        else:
-            return arch
-
-
-    def get_kernel_build_release(self):
-        releasem = re.compile(r'.*UTS_RELEASE\s+"([^"]+)".*');
-        versionm = re.compile(r'.*UTS_VERSION\s+"([^"]+)".*');
-
-        release = None
-        version = None
-
-        for f in [self.build_dir + "/include/linux/version.h",
-                  self.build_dir + "/include/linux/utsrelease.h",
-                  self.build_dir + "/include/linux/compile.h",
-                  self.build_dir + "/include/generated/utsrelease.h",
-                  self.build_dir + "/include/generated/compile.h"]:
-            if os.path.exists(f):
-                fd = open(f, 'r')
-                for line in fd.readlines():
-                    m = releasem.match(line)
-                    if m:
-                        release = m.groups()[0]
-                    m = versionm.match(line)
-                    if m:
-                        version = m.groups()[0]
-                fd.close()
-
-        return (release, version)
-
-
-    def get_kernel_build_ident(self):
-        (release, version) = self.get_kernel_build_release()
-
-        if not release or not version:
-            raise error.JobError('kernel has no identity')
-
-        return release + '::' + version
-
-
-    def boot(self, args='', ident=True):
-        """ install and boot this kernel, do not care how
-            just make it happen.
-        """
-
-        # If the kernel has not yet been installed,
-        #   install it now as default tag.
-        if not self.installed_as:
-            self.install()
-
-        expected_ident = self.get_kernel_build_ident()
-        self._boot_kernel(args, ident, expected_ident,
-                          self.subdir, self.applied_patches)
-
-
-    def get_kernel_build_ver(self):
-        """Check Makefile and .config to return kernel version"""
-        version = patchlevel = sublevel = extraversion = localversion = ''
-
-        for line in open(self.build_dir + '/Makefile', 'r').readlines():
-            if line.startswith('VERSION'):
-                version = line[line.index('=') + 1:].strip()
-            if line.startswith('PATCHLEVEL'):
-                patchlevel = line[line.index('=') + 1:].strip()
-            if line.startswith('SUBLEVEL'):
-                sublevel = line[line.index('=') + 1:].strip()
-            if line.startswith('EXTRAVERSION'):
-                extraversion = line[line.index('=') + 1:].strip()
-
-        for line in open(self.build_dir + '/.config', 'r').readlines():
-            if line.startswith('CONFIG_LOCALVERSION='):
-                localversion = line.rstrip().split('"')[1]
-
-        return "%s.%s.%s%s%s" %(version, patchlevel, sublevel, extraversion, localversion)
-
-
-    def set_build_target(self, build_target):
-        if build_target:
-            self.build_target = build_target
-            print 'BUILD TARGET: %s' % self.build_target
-
-
-    def set_cross_cc(self, target_arch=None, cross_compile=None,
-                     build_target='bzImage'):
-        """Set up to cross-compile.
-                This is broken. We need to work out what the default
-                compile produces, and if not, THEN set the cross
-                compiler.
-        """
-
-        if self.target_arch:
-            return
-
-        # if someone has set build_target, don't clobber in set_cross_cc
-        # run set_build_target before calling set_cross_cc
-        if not self.build_target:
-            self.set_build_target(build_target)
-
-        # If no 'target_arch' given assume native compilation
-        if target_arch is None:
-            target_arch = utils.get_current_kernel_arch()
-            if target_arch == 'ppc64':
-                if self.build_target == 'bzImage':
-                    self.build_target = 'vmlinux'
-
-        if not cross_compile:
-            cross_compile = self.job.config_get('kernel.cross_cc')
-
-        if cross_compile:
-            os.environ['CROSS_COMPILE'] = cross_compile
-        else:
-            if os.environ.has_key('CROSS_COMPILE'):
-                del os.environ['CROSS_COMPILE']
-
-        return                 # HACK. Crap out for now.
-
-        # At this point I know what arch I *want* to build for
-        # but have no way of working out what arch the default
-        # compiler DOES build for.
-
-        def install_package(package):
-            raise NotImplementedError("I don't exist yet!")
-
-        if target_arch == 'ppc64':
-            install_package('ppc64-cross')
-            cross_compile = os.path.join(self.autodir, 'sources/ppc64-cross/bin')
-
-        elif target_arch == 'x86_64':
-            install_package('x86_64-cross')
-            cross_compile = os.path.join(self.autodir, 'sources/x86_64-cross/bin')
-
-        os.environ['ARCH'] = self.target_arch = target_arch
-
-        self.cross_compile = cross_compile
-        if self.cross_compile:
-            os.environ['CROSS_COMPILE'] = self.cross_compile
-
-
-    def pickle_dump(self, filename):
-        """dump a pickle of ourself out to the specified filename
-
-        we can't pickle the backreference to job (it contains fd's),
-        nor would we want to. Same for logfile (fd's).
-        """
-        temp = copy.copy(self)
-        temp.job = None
-        temp.logfile = None
-        pickle.dump(temp, open(filename, 'w'))
-
-
-class rpm_kernel(BootableKernel):
-    """
-    Class for installing a binary rpm kernel package
-    """
-
-    def __init__(self, job, rpm_package, subdir):
-        super(rpm_kernel, self).__init__(job)
-        self.rpm_package = rpm_package
-        self.log_dir = os.path.join(subdir, 'debug')
-        self.subdir = os.path.basename(subdir)
-        if os.path.exists(self.log_dir):
-            utils.system('rm -rf ' + self.log_dir)
-        os.mkdir(self.log_dir)
-
-
-    def build(self, *args, **dargs):
-        """
-        Dummy function, binary kernel so nothing to build.
-        """
-        pass
-
-
-    @log.record
-    @tee_output_logdir_mark
-    def install(self, tag='autotest', install_vmlinux=True):
-        self.installed_as = tag
-
-        self.image = None
-        self.initrd = ''
-        for rpm_pack in self.rpm_package:
-            rpm_name = utils.system_output('rpm -qp ' + rpm_pack)
-
-            # install
-            utils.system('rpm -i --force ' + rpm_pack)
-
-            # get file list
-            files = utils.system_output('rpm -ql ' + rpm_name).splitlines()
-
-            # search for vmlinuz
-            for file in files:
-                if file.startswith('/boot/vmlinuz'):
-                    self.full_version = file[len('/boot/vmlinuz-'):]
-                    self.image = file
-                    self.rpm_flavour = rpm_name.split('-')[1]
-
-                    # get version and release number
-                    self.version, self.release = utils.system_output(
-                            'rpm --queryformat="%{VERSION}\\n%{RELEASE}\\n" -q '
-                            + rpm_name).splitlines()[0:2]
-
-                    # prefer /boot/kernel-version before /boot/kernel
-                    if self.full_version:
-                        break
-
-            # search for initrd
-            for file in files:
-                if file.startswith('/boot/init'):
-                    self.initrd = file
-                    # prefer /boot/initrd-version before /boot/initrd
-                    if len(file) > len('/boot/initrd'):
-                        break
-
-        if self.image == None:
-            errmsg = "specified rpm file(s) don't contain /boot/vmlinuz"
-            raise error.TestError(errmsg)
-
-        # install vmlinux
-        if install_vmlinux:
-            for rpm_pack in self.rpm_package:
-                vmlinux = utils.system_output(
-                        'rpm -q -l -p %s | grep /boot/vmlinux' % rpm_pack)
-            utils.system('cd /; rpm2cpio %s | cpio -imuv .%s 2>&1'
-                         % (rpm_pack, vmlinux))
-            if not os.path.exists(vmlinux):
-                raise error.TestError('%s does not exist after installing %s'
-                                      % (vmlinux, rpm_pack))
-
-
-    def boot(self, args='', ident=True):
-        """ install and boot this kernel
-        """
-
-        # If the kernel has not yet been installed,
-        #   install it now as default tag.
-        if not self.installed_as:
-            self.install()
-
-        expected_ident = self.full_version
-        if not expected_ident:
-            expected_ident = '-'.join([self.version,
-                                       self.rpm_flavour,
-                                       self.release])
-
-        self._boot_kernel(args, ident, expected_ident,
-                          None, 'rpm')
-
-
-class rpm_kernel_suse(rpm_kernel):
-    """ Class for installing openSUSE/SLE rpm kernel package
-    """
-
-    def install(self):
-        # do not set the new kernel as the default one
-        os.environ['PBL_AUTOTEST'] = '1'
-
-        rpm_kernel.install(self, 'dummy')
-        self.installed_as = self.job.bootloader.get_title_for_kernel(self.image)
-        if not self.installed_as:
-            errmsg = "cannot find installed kernel in bootloader configuration"
-            raise error.TestError(errmsg)
-
-
-    def add_to_bootloader(self, tag='dummy', args=''):
-        """ Set parameters of this kernel in bootloader
-        """
-
-        # pull the base argument set from the job config
-        baseargs = self.job.config_get('boot.default_args')
-        if baseargs:
-            args = baseargs + ' ' + args
-
-        self.job.bootloader.add_args(tag, args)
-
-
-def rpm_kernel_vendor(job, rpm_package, subdir):
-    vendor = utils.get_os_vendor()
-    if vendor == "SUSE":
-        return rpm_kernel_suse(job, rpm_package, subdir)
-    else:
-        return rpm_kernel(job, rpm_package, subdir)
-
-
-# just make the preprocessor a nop
-def _preprocess_path_dummy(path):
-    return path.strip()
-
-
-# pull in some optional site-specific path pre-processing
-preprocess_path = utils.import_site_function(__file__,
-    "autotest_lib.client.bin.site_kernel", "preprocess_path",
-    _preprocess_path_dummy)
-
-
-def auto_kernel(job, path, subdir, tmp_dir, build_dir, leave=False):
-    """
-    Create a kernel object, dynamically selecting the appropriate class to use
-    based on the path provided.
-    """
-    kernel_paths = [preprocess_path(path)]
-    if kernel_paths[0].endswith('.list'):
-    # Fetch the list of packages to install
-        kernel_list = os.path.join(tmp_dir, 'kernel.list')
-        utils.get_file(kernel_paths[0], kernel_list)
-        kernel_paths = [p.strip() for p in open(kernel_list).readlines()]
-
-    if kernel_paths[0].endswith('.rpm'):
-        rpm_paths = []
-        for kernel_path in kernel_paths:
-            if os.path.exists(kernel_path):
-                rpm_paths.append(kernel_path)
-            else:
-                # Fetch the rpm into the job's packages directory and pass it to
-                # rpm_kernel
-                rpm_name = os.path.basename(kernel_path)
-
-                # If the preprocessed path (kernel_path) is only a name then
-                # search for the kernel in all the repositories, else fetch the
-                # kernel from that specific path.
-                job.pkgmgr.fetch_pkg(rpm_name, os.path.join(job.pkgdir, rpm_name),
-                                     repo_url=os.path.dirname(kernel_path))
-
-                rpm_paths.append(os.path.join(job.pkgdir, rpm_name))
-        return rpm_kernel_vendor(job, rpm_paths, subdir)
-    else:
-        if len(kernel_paths) > 1:
-            raise error.TestError("don't know what to do with more than one non-rpm kernel file")
-        return kernel(job,kernel_paths[0], subdir, tmp_dir, build_dir, leave)
diff --git a/client/bin/kernel_config.py b/client/bin/kernel_config.py
deleted file mode 100644
index 4b6473b..0000000
--- a/client/bin/kernel_config.py
+++ /dev/null
@@ -1,140 +0,0 @@
-# TODO: need a function to get the newest config file older than us from
-# the repo.
-
-import shutil, os
-from autotest_lib.client.bin import utils
-from autotest_lib.client.common_lib import error, kernel_versions
-
-def apply_overrides(orig_file, changes_file, output_file):
-    override = dict()
-
-    # First suck all the changes into a dictionary.
-    input = file(changes_file, 'r')
-    for line in input.readlines():
-        if line.startswith('CONFIG_'):
-            key = line.split('=')[0]
-            override[key] = line;
-        elif line.startswith('# CONFIG_'):
-            key = line.split(' ')[1]
-            override[key] = line;
-    input.close()
-
-    # Now go through the input file, overriding lines where need be
-    input = file(orig_file, 'r')
-    output = file(output_file, 'w')
-    for line in input.readlines():
-        if line.startswith('CONFIG_'):
-            key = line.split('=')[0]
-        elif line.startswith('# CONFIG_'):
-            key = line.split(' ')[1]
-        else:
-            key = None
-        if key and key in override:
-            output.write(override[key])
-        else:
-            output.write(line)
-    input.close()
-    output.close()
-
-
-def diff_configs(old, new):
-    utils.system('diff -u %s %s > %s' % (old, new, new + '.diff'),
-                 ignore_status=True)
-
-
-
-def modules_needed(config):
-    return (utils.grep('CONFIG_MODULES=y', config) and utils.grep('=m', config))
-
-
-def config_by_name(name, set):
-    version = kernel_versions.version_choose_config(name, set[1:])
-    if version:
-        return set[0] + version
-    return None
-
-
-class kernel_config(object):
-    # Build directory must be ready before init'ing config.
-    #
-    # Stages:
-    #       1. Get original config file
-    #       2. Apply overrides
-    #       3. Do 'make oldconfig' to update it to current source code
-    #                  (gets done implicitly during the process)
-    #
-    # You may specifiy the a defconfig within the tree to build,
-    # or a custom config file you want, or None, to get machine's
-    # default config file from the repo.
-
-    build_dir = ''          # the directory we're building in
-    config_dir = ''         # local repository for config_file data
-
-    build_config = ''       # the config file in the build directory
-    orig_config = ''        # the original config file
-    over_config = ''        # config file + overrides
-
-
-    def __init__(self, job, build_dir, config_dir, orig_file,
-                            overrides, defconfig = False, name = None, make = None):
-        self.build_dir = build_dir
-        self.config_dir = config_dir
-
-        #       1. Get original config file
-        self.build_config = build_dir + '/.config'
-        if (orig_file == '' and not defconfig and not make):    # use user default
-            set = job.config_get("kernel.default_config_set")
-            defconf = None
-            if set and name:
-                defconf = config_by_name(name, set)
-            if not defconf:
-                defconf = job.config_get("kernel.default_config")
-            if defconf:
-                orig_file = defconf
-        if (orig_file == '' and not make and defconfig):        # use defconfig
-            make = 'defconfig'
-        if (orig_file == '' and make): # use the config command
-            print "kernel_config: using " + make + " to configure kernel"
-            os.chdir(build_dir)
-            make_return = utils.system('make %s > /dev/null' % make)
-            self.config_record(make)
-            if (make_return):
-                raise error.TestError('make % failed' % make)
-        else:
-            print "kernel_config: using " + orig_file + \
-                                            " to configure kernel"
-            self.orig_config = config_dir + '/config.orig'
-            utils.get_file(orig_file, self.orig_config)
-            self.update_config(self.orig_config, self.orig_config+'.new')
-            diff_configs(self.orig_config, self.orig_config+'.new')
-
-
-        #       2. Apply overrides
-        if overrides:
-            print "kernel_config: using " + overrides + \
-                                            " to re-configure kernel"
-            self.over_config = config_dir + '/config.over'
-            overrides_local = self.over_config + '.changes'
-            utils.get_file(overrides, overrides_local)
-            apply_overrides(self.build_config, overrides_local, self.over_config)
-            self.update_config(self.over_config, self.over_config+'.new')
-            diff_configs(self.over_config, self.over_config+'.new')
-        else:
-            self.over_config = self.orig_config
-
-
-    def update_config(self, old_config, new_config = 'None'):
-        os.chdir(self.build_dir)
-        shutil.copyfile(old_config, self.build_config)
-        utils.system('yes "" | make oldconfig > /dev/null')
-        if new_config:
-            shutil.copyfile(self.build_config, new_config)
-
-    def config_record(self, name):
-        #Copy the current .config file to the config.<name>[.<n>]
-        i = 1
-        to = self.config_dir + '/config.%s' % name
-        while os.path.exists(to):
-            i += 1
-            to = self.config_dir + '/config.%s.%d' % (name,i)
-        shutil.copyfile(self.build_dir + '/.config', to)
diff --git a/client/bin/kernel_unittest.py b/client/bin/kernel_unittest.py
deleted file mode 100755
index 4ed0d37..0000000
--- a/client/bin/kernel_unittest.py
+++ /dev/null
@@ -1,652 +0,0 @@
-#!/usr/bin/python
-
-import unittest, os, time, re, glob, logging
-import common
-from autotest_lib.client.common_lib.test_utils import mock
-from autotest_lib.client.bin import kernel, job, utils, kernelexpand
-from autotest_lib.client.bin import kernel_config, boottool, os_dep
-
-
-class TestAddKernelToBootLoader(unittest.TestCase):
-
-    def add_to_bootloader(self, base_args, args, bootloader_args,
-                          bootloader_root, tag='image', image='image',
-                          initrd='initrd'):
-        god = mock.mock_god()
-        bootloader = god.create_mock_class(boottool.boottool, "boottool")
-
-        # record
-        bootloader.remove_kernel.expect_call(tag)
-        bootloader.add_kernel.expect_call(image, tag, initrd=initrd,
-                                          args='_dummy_', root=bootloader_root)
-
-        for a in bootloader_args.split():
-            bootloader.add_args.expect_call(kernel=tag, args=a)
-        bootloader.remove_args.expect_call(kernel=tag, args='_dummy_')
-
-        # run and check
-        kernel._add_kernel_to_bootloader(bootloader, base_args, tag, args,
-                                         image, initrd)
-        god.check_playback()
-
-
-    def test_add_kernel_to_bootloader(self):
-        self.add_to_bootloader(base_args='baseargs', args='',
-                               bootloader_args='baseargs', bootloader_root=None)
-        self.add_to_bootloader(base_args='arg1 root=/dev/oldroot arg2',
-                               args='root=/dev/newroot arg3',
-                               bootloader_args='arg1 arg2 arg3',
-                               bootloader_root='/dev/newroot')
-
-
-class TestBootableKernel(unittest.TestCase):
-
-    def setUp(self):
-        self.god = mock.mock_god()
-        self.god.stub_function(time, "time")
-        self.god.stub_function(utils, "system")
-        self.god.stub_function(kernel, "_add_kernel_to_bootloader")
-        job_ = self.god.create_mock_class(job.job, "job")
-        self.kernel = kernel.BootableKernel(job_)
-        self.kernel.job.bootloader = self.god.create_mock_class(
-                              boottool.boottool, "boottool")
-
-
-    def tearDown(self):
-        # note: time.time() can only be unstubbed via tearDown()
-        self.god.unstub_all()
-
-
-    def boot_kernel(self, ident_check):
-        notes = "applied_patches"
-        when = 1
-        args = ''
-        base_args = 'base_args'
-        tag = 'ident'
-        subdir = 'subdir'
-        self.kernel.image = 'image'
-        self.kernel.initrd = 'initrd'
-        self.kernel.installed_as = tag
-
-        # record
-        args_ = args
-        if ident_check:
-            time.time.expect_call().and_return(when)
-            args_ += " IDENT=%d" % when
-            status = ["job.end_reboot_and_verify", when, tag, subdir, notes]
-        else:
-            status = ["job.end_reboot", subdir, tag, notes]
-        self.kernel.job.next_step_prepend.expect_call(status)
-        self.kernel.job.config_get.expect_call(
-                'boot.default_args').and_return(base_args)
-        kernel._add_kernel_to_bootloader.expect_call(
-                self.kernel.job.bootloader, base_args, tag,
-                args_, self.kernel.image, self.kernel.initrd)
-        utils.system.expect_call('touch /fastboot')
-        self.kernel.job.start_reboot.expect_call()
-        self.kernel.job.reboot.expect_call(tag=tag)
-
-        # run and check
-        self.kernel._boot_kernel(args=args, ident_check=ident_check,
-                                 expected_ident=tag, subdir=subdir, notes=notes)
-        self.god.check_playback()
-
-
-    def test_boot_kernel(self):
-        self.boot_kernel(ident_check=False)
-        self.boot_kernel(ident_check=True)
-
-
-class TestKernel(unittest.TestCase):
-    def setUp(self):
-        self.god = mock.mock_god()
-
-        logging.disable(logging.CRITICAL)
-
-        self.god.stub_function(time, "time")
-        self.god.stub_function(os, "mkdir")
-        self.god.stub_function(os, "chdir")
-        self.god.stub_function(os, "symlink")
-        self.god.stub_function(os, "remove")
-        self.god.stub_function(os.path, "isdir")
-        self.god.stub_function(os.path, "exists")
-        self.god.stub_function(os.path, "isfile")
-        self.god.stub_function(os_dep, "commands")
-        self.god.stub_function(kernel, "open")
-        self.god.stub_function(utils, "system")
-        self.god.stub_function(utils, "system_output")
-        self.god.stub_function(utils, "get_file")
-        self.god.stub_function(utils, "get_current_kernel_arch")
-        self.god.stub_function(utils, "cat_file_to_cmd")
-        self.god.stub_function(utils, "force_copy")
-        self.god.stub_function(utils, "extract_tarball_to_dir")
-        self.god.stub_function(utils, "count_cpus")
-        self.god.stub_function(utils, "get_os_vendor")
-        self.god.stub_function(kernelexpand, "expand_classic")
-        self.god.stub_function(kernel_config, "modules_needed")
-        self.god.stub_function(glob, "glob")
-        def dummy_mark(filename, msg):
-            pass
-        self.god.stub_with(kernel, '_mark', dummy_mark)
-
-        self.job = self.god.create_mock_class(job.job, "job")
-        self.job.bootloader = self.god.create_mock_class(boottool.boottool,
-                                                         "boottool")
-
-        class DummyLoggingManager(object):
-            def tee_redirect_debug_dir(self, *args, **kwargs):
-                pass
-
-
-            def restore(self, *args, **kwargs):
-                pass
-
-        self.job.logging = DummyLoggingManager()
-
-        self.job.autodir = "autodir"
-        self.base_tree = "2.6.24"
-        self.tmp_dir = "tmpdir"
-        self.subdir = "subdir"
-
-
-    def tearDown(self):
-        self.god.unstub_all()
-
-
-    def construct_kernel(self):
-        self.kernel = kernel.kernel.__new__(kernel.kernel)
-        self.god.stub_function(self.kernel, "extract")
-
-        # setup
-        self.src_dir    = os.path.join(self.tmp_dir, 'src')
-        self.build_dir  = os.path.join(self.tmp_dir, "build_dir")
-        self.config_dir = os.path.join(self.subdir, 'config')
-        self.log_dir    = os.path.join(self.subdir, 'debug')
-        self.results_dir = os.path.join(self.subdir, 'results')
-
-        # record
-        os.path.isdir.expect_call(self.src_dir).and_return(True)
-        utils.system.expect_call('rm -rf ' + self.src_dir)
-        os.path.isdir.expect_call(self.build_dir).and_return(True)
-        utils.system.expect_call('rm -rf ' + self.build_dir)
-        os.path.exists.expect_call(self.src_dir).and_return(False)
-        os.mkdir.expect_call(self.src_dir)
-        for path in [self.config_dir, self.log_dir, self.results_dir]:
-            os.path.exists.expect_call(path).and_return(True)
-            utils.system.expect_call('rm -rf ' + path)
-            os.mkdir.expect_call(path)
-
-        logpath = os.path.join(self.log_dir, 'build_log')
-        self.logfile = self.god.create_mock_class(file, "file")
-        kernel.open.expect_call(logpath, 'w+').and_return(self.logfile)
-        utils.get_current_kernel_arch.expect_call().and_return('ia64')
-        self.logfile.write.expect_call('BASE: %s\n' % self.base_tree)
-        self.kernel.extract.expect_call(self.base_tree)
-
-        # finish creation of kernel object and test (and unstub extract)
-        self.kernel.__init__(self.job, self.base_tree, self.subdir,
-                             self.tmp_dir, "build_dir")
-        self.god.check_playback()
-        self.god.unstub(self.kernel, "extract")
-
-
-    def test_constructor(self):
-        self.construct_kernel()
-
-
-    def test_kernelexpand1(self):
-        self.construct_kernel()
-
-        ret_val = self.kernel.kernelexpand("/path/to/kernel")
-        self.assertEquals(ret_val, ["/path/to/kernel"])
-        self.god.check_playback()
-
-
-    def test_kernel_expand2(self):
-        self.construct_kernel()
-        kernel = "kernel.tar.gz"
-
-        # record
-        self.job.config_get.expect_call('mirror.mirrors').and_return('mirror')
-        kernelexpand.expand_classic.expect_call(kernel,
-            'mirror').and_return('patches')
-
-        # run
-        self.assertEquals(self.kernel.kernelexpand(kernel), 'patches')
-        self.god.check_playback()
-
-
-    def test_kernel_expand3(self):
-        self.construct_kernel()
-        kernel = "kernel.tar.gz"
-
-        # record
-        self.job.config_get.expect_call('mirror.mirrors')
-        self.job.config_get.expect_call(
-            'mirror.ftp_kernel_org').and_return('mirror')
-        korg = 'http://www.kernel.org/pub/linux/kernel'
-        mirrors = [
-                   [ korg + '/v2.6', 'mirror' + '/v2.6' ],
-                   [ korg + '/people/akpm/patches/2.6', 'mirror' + '/akpm' ],
-                   [ korg + '/people/mbligh', 'mirror' + '/mbligh' ],
-                  ]
-        kernelexpand.expand_classic.expect_call(kernel,
-            mirrors).and_return('patches')
-
-        # run
-        self.assertEquals(self.kernel.kernelexpand(kernel), 'patches')
-        self.god.check_playback()
-
-
-    def test_extract1(self):
-        self.construct_kernel()
-
-        # setup
-        self.god.stub_function(self.kernel, "get_kernel_tree")
-
-        # record
-        os.path.exists.expect_call(self.base_tree).and_return(True)
-        self.kernel.get_kernel_tree.expect_call(self.base_tree)
-        self.job.record.expect_call('GOOD', self.subdir, 'kernel.extract')
-
-        # run
-        self.kernel.extract(self.base_tree)
-        self.god.check_playback()
-        self.god.unstub(self.kernel, "get_kernel_tree")
-
-
-    def test_extract2(self):
-        self.construct_kernel()
-
-        # setup
-        self.god.stub_function(self.kernel, "kernelexpand")
-        self.god.stub_function(self.kernel, "get_kernel_tree")
-        self.god.stub_function(self.kernel, "patch")
-
-        # record
-        os.path.exists.expect_call(self.base_tree).and_return(False)
-        components = ["component0", "component1"]
-        self.kernel.kernelexpand.expect_call(self.base_tree).and_return(
-            components)
-        self.kernel.get_kernel_tree.expect_call(components[0])
-        self.kernel.patch.expect_call(components[1])
-        self.job.record.expect_call('GOOD', self.subdir, 'kernel.extract')
-
-        # run
-        self.kernel.extract(self.base_tree)
-        self.god.check_playback()
-        self.god.unstub(self.kernel, "kernelexpand")
-        self.god.unstub(self.kernel, "get_kernel_tree")
-        self.god.unstub(self.kernel, "patch")
-
-
-    def test_patch1(self):
-        self.construct_kernel()
-        patches = ('patch1', 'patch2')
-        self.god.stub_function(self.kernel, "apply_patches")
-        self.god.stub_function(self.kernel, "get_patches")
-
-        #record
-        self.kernel.get_patches.expect_call(patches).and_return(patches)
-        self.kernel.apply_patches.expect_call(patches)
-        self.job.record.expect_call('GOOD', self.subdir, 'kernel.patch')
-
-        #run
-        self.kernel.patch(*patches)
-        self.god.check_playback()
-        self.god.unstub(self.kernel, "apply_patches")
-        self.god.unstub(self.kernel, "get_patches")
-
-
-    def test_patch2(self):
-        self.construct_kernel()
-        patches = []
-
-        # record
-        self.job.record.expect_call('GOOD', self.subdir, 'kernel.patch')
-
-        # run
-        self.kernel.patch(*patches)
-        self.god.check_playback()
-
-
-    def test_config(self):
-        self.construct_kernel()
-
-        # setup
-        self.god.stub_function(self.kernel, "set_cross_cc")
-        self.god.stub_class(kernel_config, "kernel_config")
-
-        # record
-        self.kernel.set_cross_cc.expect_call()
-        kernel_config.kernel_config.expect_new(self.job, self.build_dir,
-                                               self.config_dir, '', None,
-                                               False, self.base_tree, None)
-        self.job.record.expect_call('GOOD', self.subdir, 'kernel.config')
-
-        # run
-        self.kernel.config()
-        self.god.check_playback()
-        self.god.unstub(self.kernel, "set_cross_cc")
-
-
-    def test_get_patches(self):
-        self.construct_kernel()
-
-        # setup
-        patches = ['patch1', 'patch2', 'patch3']
-        local_patches = []
-
-        # record
-        for patch in patches:
-            dest = os.path.join(self.src_dir, os.path.basename(patch))
-            utils.get_file.expect_call(patch, dest)
-            utils.system_output.expect_call(
-                'md5sum ' + dest).and_return('md5sum')
-            local_patches.append((patch, dest, 'md5sum'))
-
-        # run and check
-        self.assertEquals(self.kernel.get_patches(patches), local_patches)
-        self.god.check_playback()
-
-
-    def test_apply_patches(self):
-        self.construct_kernel()
-
-        # setup
-        patches = []
-        patches.append(('patch1', 'patch1.gz', 'md5sum1'))
-        patches.append(('patch2', 'patch2.bz2', 'md5sum2'))
-        patches.append(('patch3', 'patch3', 'md5sum3'))
-        applied_patches = []
-
-        # record
-        os.chdir.expect_call(self.build_dir)
-
-        patch_id = "%s %s %s" % ('patch1', 'patch1', 'md5sum1')
-        log = "PATCH: " + patch_id + "\n"
-        utils.cat_file_to_cmd.expect_call('patch1.gz',
-            'patch -p1 > /dev/null')
-        self.logfile.write.expect_call(log)
-        applied_patches.append(patch_id)
-
-        patch_id = "%s %s %s" % ('patch2', 'patch2', 'md5sum2')
-        log = "PATCH: " + patch_id + "\n"
-        utils.cat_file_to_cmd.expect_call('patch2.bz2',
-            'patch -p1 > /dev/null')
-        self.logfile.write.expect_call(log)
-        applied_patches.append(patch_id)
-
-        utils.force_copy.expect_call('patch3',
-            self.results_dir).and_return('local_patch3')
-        self.job.relative_path.expect_call('local_patch3').and_return(
-            'rel_local_patch3')
-        patch_id = "%s %s %s" % ('patch3', 'rel_local_patch3', 'md5sum3')
-        log = "PATCH: " + patch_id + "\n"
-        utils.cat_file_to_cmd.expect_call('patch3',
-            'patch -p1 > /dev/null')
-        self.logfile.write.expect_call(log)
-        applied_patches.append(patch_id)
-
-        # run and test
-        self.kernel.apply_patches(patches)
-        self.assertEquals(self.kernel.applied_patches, applied_patches)
-        self.god.check_playback()
-
-
-    def test_get_kernel_tree1(self):
-        self.construct_kernel()
-
-        # record
-        os.path.isdir.expect_call(self.base_tree).and_return(True)
-        os.symlink.expect_call(self.base_tree, self.build_dir)
-
-        # run and check
-        self.kernel.get_kernel_tree(self.base_tree)
-        self.god.check_playback()
-
-
-    def test_get_kernel_tree2(self):
-        self.construct_kernel()
-
-        # record
-        os.path.isdir.expect_call(self.base_tree).and_return(False)
-        os.chdir.expect_call(os.path.dirname(self.src_dir))
-        tarball = os.path.join(self.src_dir, os.path.basename(self.base_tree))
-        utils.get_file.expect_call(self.base_tree, tarball)
-        utils.extract_tarball_to_dir.expect_call(tarball,
-                                                          self.build_dir)
-
-        # run and check
-        self.kernel.get_kernel_tree(self.base_tree)
-        self.god.check_playback()
-
-
-    def test_extraversion(self):
-        self.construct_kernel()
-        tag = "tag"
-        # setup
-        self.god.stub_function(self.kernel, "config")
-
-        # record
-        os.chdir.expect_call(self.build_dir)
-        extraversion_sub = r's/^CONFIG_LOCALVERSION=\s*"\(.*\)"/CONFIG_LOCALVERSION='
-        cfg = self.build_dir + '/.config'
-        p = extraversion_sub + '"\\1-%s"/' % tag
-        utils.system.expect_call('mv %s %s.old' % (cfg, cfg))
-        utils.system.expect_call("sed '%s' < %s.old > %s" % (p, cfg, cfg))
-        self.kernel.config.expect_call(make='oldconfig')
-
-        # run and check
-        self.kernel.extraversion(tag)
-        self.god.check_playback()
-
-
-    def test_build(self):
-        self.construct_kernel()
-        self.god.stub_function(self.kernel, "extraversion")
-        self.god.stub_function(self.kernel, "set_cross_cc")
-        self.god.stub_function(self.kernel, "get_kernel_build_ver")
-        self.kernel.build_target = 'build_target'
-
-        # record
-        os_dep.commands.expect_call('gcc', 'make')
-        logfile = os.path.join(self.log_dir, 'kernel_build')
-        os.chdir.expect_call(self.build_dir)
-        self.kernel.extraversion.expect_call('autotest')
-        self.kernel.set_cross_cc.expect_call()
-        utils.system.expect_call('make dep', ignore_status=True)
-        utils.count_cpus.expect_call().and_return(4)
-        threads = 2 * 4
-        build_string = 'make -j %d %s %s' % (threads, '', 'build_target')
-        utils.system.expect_call(build_string)
-        kernel_config.modules_needed.expect_call('.config').and_return(True)
-        utils.system.expect_call('make -j %d modules' % (threads))
-        self.kernel.get_kernel_build_ver.expect_call().and_return('2.6.24')
-        kernel_version = re.sub('-autotest', '', '2.6.24')
-        self.logfile.write.expect_call('BUILD VERSION: %s\n' % kernel_version)
-        utils.force_copy.expect_call(self.build_dir+'/System.map',
-                                              self.results_dir)
-        self.job.record.expect_call('GOOD', self.subdir, 'kernel.build')
-
-        # run and check
-        self.kernel.build()
-        self.god.check_playback()
-
-
-    def test_build_timed(self):
-        self.construct_kernel()
-        self.god.stub_function(self.kernel, "set_cross_cc")
-        self.god.stub_function(self.kernel, "clean")
-
-        # record
-        os.chdir.expect_call(self.build_dir)
-        self.kernel.set_cross_cc.expect_call()
-        self.kernel.clean.expect_call()
-        build_string = "/usr/bin/time -o /dev/null make  -j 8 vmlinux"
-        build_string += ' > /dev/null 2>&1'
-        utils.system.expect_call(build_string)
-        os.path.isfile.expect_call('vmlinux').and_return(True)
-
-        # run and check
-        self.kernel.build_timed(threads=8)
-        self.god.check_playback()
-
-
-    def test_clean(self):
-        self.construct_kernel()
-
-        # record
-        os.chdir.expect_call(self.build_dir)
-        utils.system.expect_call('make clean > /dev/null 2> /dev/null')
-        self.job.record.expect_call('GOOD', self.subdir, 'kernel.clean')
-
-        # run and check
-        self.kernel.clean()
-        self.god.check_playback()
-
-
-    def test_mkinitrd(self):
-        self.construct_kernel()
-
-        # record
-        utils.get_os_vendor.expect_call().and_return('Ubuntu')
-        os.path.isfile.expect_call('initrd').and_return(True)
-        os.remove.expect_call('initrd')
-        self.job.config_get.expect_call(
-            'kernel.mkinitrd_extra_args').and_return(None)
-        args = ''
-        glob.glob.expect_call('/lib/modules/2.6.24*').and_return(['2.6.24'])
-        os.path.isfile.expect_call('/usr/sbin/mkinitrd').and_return(True)
-        cmd = '/usr/sbin/mkinitrd'
-        utils.system.expect_call('%s %s -o initrd 2.6.24' % (cmd, args))
-        self.job.record.expect_call('GOOD', self.subdir, 'kernel.mkinitrd')
-
-        # run and check
-        self.kernel.mkinitrd(version="2.6.24", image="image",
-                             system_map="system_map", initrd="initrd")
-        self.god.check_playback()
-
-
-    def test_install(self):
-        self.construct_kernel()
-        tag = 'autotest'
-        prefix = '/'
-        self.kernel.build_image = None
-        self.kernel.build_target = 'build_target'
-        self.god.stub_function(self.kernel, "get_kernel_build_ver")
-        self.god.stub_function(self.kernel, "mkinitrd")
-
-        # record
-        os.chdir.expect_call(self.build_dir)
-        os.path.isdir.expect_call(prefix).and_return(False)
-        os.mkdir.expect_call(prefix)
-        boot_dir = os.path.join(prefix, 'boot')
-        os.path.isdir.expect_call(boot_dir).and_return(False)
-        os.mkdir.expect_call(boot_dir)
-        glob.glob.expect_call(
-            'arch/*/boot/' + 'build_target').and_return('')
-        build_image = self.kernel.build_target
-        utils.force_copy.expect_call('vmlinux',
-            '/boot/vmlinux-autotest')
-        utils.force_copy.expect_call('build_target',
-            '/boot/vmlinuz-autotest')
-        utils.force_copy.expect_call('System.map',
-            '/boot/System.map-autotest')
-        utils.force_copy.expect_call('.config',
-            '/boot/config-autotest')
-        kernel_config.modules_needed.expect_call('.config').and_return(True)
-        utils.system.expect_call('make modules_install INSTALL_MOD_PATH=%s'
-                                 % prefix)
-        initrd = boot_dir + '/initrd-' + tag
-        self.kernel.get_kernel_build_ver.expect_call().and_return('2.6.24')
-        self.kernel.mkinitrd.expect_call('2.6.24', '/boot/vmlinuz-autotest',
-            '/boot/System.map-autotest', '/boot/initrd-autotest')
-        self.job.record.expect_call('GOOD', self.subdir, 'kernel.install')
-
-        # run and check
-        self.kernel.install()
-        self.god.check_playback()
-
-
-    def test_get_kernel_build_arch1(self):
-        self.construct_kernel()
-
-        # record
-        utils.get_current_kernel_arch.expect_call().and_return("i386")
-
-        # run and check
-        self.assertEquals(self.kernel.get_kernel_build_arch(), "i386")
-        self.god.check_playback()
-
-
-    def test_get_kernel_build_arch2(self):
-        self.construct_kernel()
-
-        # run and check
-        self.assertEquals(self.kernel.get_kernel_build_arch('i586'), "i386")
-        self.god.check_playback()
-
-
-    def test_get_kernel_build_release(self):
-        self.construct_kernel()
-        mock_file = self.god.create_mock_class(file, "file")
-
-        # record
-        for f in [self.build_dir + "/include/linux/version.h",
-                  self.build_dir + "/include/linux/utsrelease.h"]:
-            os.path.exists.expect_call(f).and_return(True)
-            kernel.open.expect_call(f, 'r').and_return(mock_file)
-            mock_file.readlines.expect_call().and_return("Some lines")
-            mock_file.close.expect_call()
-
-        for f in [self.build_dir + "/include/linux/compile.h",
-                  self.build_dir + "/include/generated/utsrelease.h",
-                  self.build_dir + "/include/generated/compile.h"]:
-            os.path.exists.expect_call(f).and_return(False)
-
-        # run and test
-        self.kernel.get_kernel_build_release()
-        self.god.check_playback()
-
-
-    def test_get_kernel_build_ident(self):
-        self.construct_kernel()
-        self.god.stub_function(self.kernel, "get_kernel_build_release")
-
-        # record
-        self.kernel.get_kernel_build_release.expect_call().and_return(
-            ("AwesomeRelease", "1.0"))
-
-        # run and check
-        self.assertEquals(self.kernel.get_kernel_build_ident(),
-            "AwesomeRelease::1.0")
-        self.god.check_playback()
-
-
-    def test_boot(self):
-        self.construct_kernel()
-        self.god.stub_function(self.kernel, "get_kernel_build_ident")
-        self.god.stub_function(self.kernel, "install")
-        self.god.stub_function(self.kernel, "_boot_kernel")
-        self.kernel.applied_patches = "applied_patches"
-        self.kernel.installed_as = None
-        args = ''
-        expected_ident = 'ident'
-        ident = True
-
-        # record
-        self.kernel.install.expect_call()
-        self.kernel.get_kernel_build_ident.expect_call(
-                ).and_return(expected_ident)
-        self.kernel._boot_kernel.expect_call(
-                args, ident, expected_ident,
-                self.subdir, self.kernel.applied_patches)
-
-        # run and check
-        self.kernel.boot(args=args, ident=ident)
-        self.god.check_playback()
-
-
-if __name__ == "__main__":
-    unittest.main()
diff --git a/client/bin/kernelexpand.py b/client/bin/kernelexpand.py
deleted file mode 100755
index 871b053..0000000
--- a/client/bin/kernelexpand.py
+++ /dev/null
@@ -1,187 +0,0 @@
-#!/usr/bin/python
-#
-# (C) International Business Machines 2008
-# Author: Andy Whitcroft
-#
-# Inspired by kernelexpand by:
-# (C) Martin J. Bligh 2003
-#
-# Released under the GPL, version 2
-
-import sys, re, os
-
-kernel = 'http://www.kernel.org/pub/linux/kernel/'
-mappings = [
-        [ r'^\d+\.\d+\.\d+$', '', True, [
-                kernel + 'v%(major)s/linux-%(full)s.tar.bz2'
-        ]],
-        [ r'^\d+\.\d+\.\d+\.\d+$', '', True, [
-                kernel + 'v%(major)s/linux-%(full)s.tar.bz2'
-        ]],
-        [ r'-rc\d+$', '%(minor-prev)s', True, [
-                kernel + 'v%(major)s/testing/v%(minor)s/linux-%(full)s.tar.bz2',
-                kernel + 'v%(major)s/testing/linux-%(full)s.tar.bz2',
-        ]],
-        [ r'-(git|bk)\d+$', '%(base)s', False, [
-                kernel + 'v%(major)s/snapshots/old/patch-%(full)s.bz2',
-                kernel + 'v%(major)s/snapshots/patch-%(full)s.bz2',
-        ]],
-        [ r'-mm\d+$', '%(base)s', False, [
-                kernel + 'people/akpm/patches/' +
-                        '%(major)s/%(base)s/%(full)s/%(full)s.bz2'
-        ]],
-        [ r'-mjb\d+$', '%(base)s', False, [
-                kernel + 'people/mbligh/%(base)s/patch-%(full)s.bz2'
-        ]]
-];
-
-def decompose_kernel_once(kernel):
-    ##print "S<" + kernel + ">"
-    for mapping in mappings:
-        (suffix, becomes, is_full, patch_templates) = mapping
-
-        params = {}
-
-        match = re.search(r'^(.*)' + suffix, kernel)
-        if not match:
-            continue
-
-        # Generate the parameters for the patches:
-        #  full         => full kernel name
-        #  base         => all but the matches suffix
-        #  minor        => 2.n.m
-        #  major        => 2.n
-        #  minor-prev   => 2.n.m-1
-        params['full'] = kernel
-        params['base'] = match.group(1)
-
-        match = re.search(r'^((\d+\.\d+)\.(\d+))', kernel)
-        if not match:
-            raise "unable to determine major/minor version"
-        params['minor'] = match.group(1)
-        params['major'] = match.group(2)
-        params['minor-prev'] = match.group(2) + '.%d' % (int(match.group(3)) -1)
-
-        # Build the new kernel and patch list.
-        new_kernel = becomes % params
-        patch_list = []
-        for template in patch_templates:
-            patch_list.append(template % params)
-
-        return (is_full, new_kernel, patch_list)
-
-    return (True, kernel, None)
-
-
-def decompose_kernel(kernel):
-    kernel_patches = []
-
-    done = False
-    while not done:
-        (done, kernel, patch_list) = decompose_kernel_once(kernel)
-        if patch_list:
-            kernel_patches.insert(0, patch_list)
-    if not len(kernel_patches):
-        raise NameError('kernelexpand: %s: unknown kernel' % (kernel))
-
-    return kernel_patches
-
-
-# Look for and add potential mirrors.
-def mirror_kernel_components(mirrors, components):
-    new_components = []
-    for component in components:
-        new_patches = []
-        for mirror in mirrors:
-            (prefix, local) = mirror
-            for patch in component:
-                if patch.startswith(prefix):
-                    new_patch = local + patch[len(prefix):]
-                    new_patches.append(new_patch)
-        for patch in component:
-            new_patches.append(patch)
-        new_components.append(new_patches)
-
-    return new_components
-
-
-def url_accessible(url):
-    status = os.system("wget --spider -q '%s'" % (url))
-    #print url + ": status=%d" % (status)
-
-    return status == 0
-
-
-def select_kernel_components(components):
-    new_components = []
-    for component in components:
-        new_patches = []
-        for patch in component:
-            if url_accessible(patch):
-                new_patches.append(patch)
-                break
-        if not len(new_patches):
-            new_patches.append(component[-1])
-        new_components.append(new_patches)
-    return new_components
-
-
-def expand_classic(kernel, mirrors):
-    components = decompose_kernel(kernel)
-    if mirrors:
-        components = mirror_kernel_components(mirrors, components)
-    components = select_kernel_components(components)
-
-    patches = []
-    for component in components:
-        patches.append(component[0])
-
-    return patches
-
-
-if __name__ == '__main__':
-    from optparse import OptionParser
-
-    parser = OptionParser()
-
-    parser.add_option("-m", "--mirror", type="string", dest="mirror",
-            action="append", nargs=2, help="mirror prefix")
-    parser.add_option("-v", "--no-validate", dest="validate",
-            action="store_false", default=True, help="prune invalid entries")
-
-    def usage():
-        parser.print_help()
-        sys.exit(1)
-
-    options, args = parser.parse_args()
-
-    # Check for a kernel version
-    if len(args) != 1:
-        usage()
-    kernel = args[0]
-
-    #mirrors = [
-    #       [ 'http://www.kernel.org/pub/linux/kernel/v2.4',
-    #         'http://kernel.beaverton.ibm.com/mirror/v2.4' ],
-    #       [ 'http://www.kernel.org/pub/linux/kernel/v2.6',
-    #         'http://kernel.beaverton.ibm.com/mirror/v2.6' ],
-    #       [ 'http://www.kernel.org/pub/linux/kernel/people/akpm/patches',
-    #         'http://kernel.beaverton.ibm.com/mirror/akpm' ],
-    #]
-    mirrors = options.mirror
-
-    try:
-        components = decompose_kernel(kernel)
-    except NameError, e:
-        sys.stderr.write(e.args[0] + "\n")
-        sys.exit(1)
-
-    if mirrors:
-        components = mirror_kernel_components(mirrors, components)
-
-    if options.validate:
-        components = select_kernel_components(components)
-
-    # Dump them out.
-    for component in components:
-        print " ".join(component)
diff --git a/client/bin/kernelexpand_unittest.py b/client/bin/kernelexpand_unittest.py
deleted file mode 100755
index bbf1163..0000000
--- a/client/bin/kernelexpand_unittest.py
+++ /dev/null
@@ -1,144 +0,0 @@
-#!/usr/bin/python
-
-import unittest
-from kernelexpand import decompose_kernel
-from kernelexpand import mirror_kernel_components
-
-km = 'http://www.kernel.org/pub/linux/kernel/'
-akpm = km + 'people/akpm/patches/'
-
-kml = 'http://www.example.com/mirror/kernel.org/'
-akpml = 'http://www.example.com/mirror/akpm/'
-
-mirrorA = [
-        [ akpm, akpml ],
-        [ km, kml ],
-]
-
-class kernelexpandTest(unittest.TestCase):
-    def test_decompose_simple(self):
-        correct = [ [ km + 'v2.6/linux-2.6.23.tar.bz2' ] ]
-        sample = decompose_kernel('2.6.23')
-        self.assertEqual(sample, correct)
-
-
-    def test_decompose_fail(self):
-        success = False
-        try:
-            sample = decompose_kernel('1.0.0.0.0')
-            success = True
-        except NameError:
-            pass
-        except Exception, e:
-            self.fail('expected NameError, got something else')
-
-        if success:
-            self.fail('expected NameError, was successful')
-
-
-    def test_decompose_rcN(self):
-        correct = [
-          [ km + 'v2.6/testing/v2.6.23/linux-2.6.23-rc1.tar.bz2',
-            km + 'v2.6/testing/linux-2.6.23-rc1.tar.bz2']
-        ]
-        sample = decompose_kernel('2.6.23-rc1')
-        self.assertEqual(sample, correct)
-
-
-    def test_decompose_mmN(self):
-        correct = [
-          [ km + 'v2.6/linux-2.6.23.tar.bz2' ],
-          [ akpm + '2.6/2.6.23/2.6.23-mm1/2.6.23-mm1.bz2' ]
-        ]
-        sample = decompose_kernel('2.6.23-mm1')
-        self.assertEqual(sample, correct)
-
-
-    def test_decompose_gitN(self):
-        correct = [
-          [ km + 'v2.6/linux-2.6.23.tar.bz2' ],
-          [ km + 'v2.6/snapshots/old/patch-2.6.23-git1.bz2',
-            km + 'v2.6/snapshots/patch-2.6.23-git1.bz2']
-        ]
-        sample = decompose_kernel('2.6.23-git1')
-        self.assertEqual(sample, correct)
-
-
-    def test_decompose_rcN_mmN(self):
-        correct = [
-          [ km + 'v2.6/testing/v2.6.23/linux-2.6.23-rc1.tar.bz2',
-            km + 'v2.6/testing/linux-2.6.23-rc1.tar.bz2' ],
-          [ akpm + '2.6/2.6.23-rc1/2.6.23-rc1-mm1/2.6.23-rc1-mm1.bz2']
-        ]
-        sample = decompose_kernel('2.6.23-rc1-mm1')
-        self.assertEqual(sample, correct)
-
-
-    def test_mirrorA_simple(self):
-        correct = [
-          [ kml + 'v2.6/linux-2.6.23.tar.bz2',
-            km + 'v2.6/linux-2.6.23.tar.bz2' ]
-        ]
-        sample = decompose_kernel('2.6.23')
-        sample = mirror_kernel_components(mirrorA, sample)
-
-        self.assertEqual(sample, correct)
-
-
-    def test_mirrorA_rcN(self):
-        correct = [
-          [ kml + 'v2.6/testing/v2.6.23/linux-2.6.23-rc1.tar.bz2',
-            kml + 'v2.6/testing/linux-2.6.23-rc1.tar.bz2',
-            km + 'v2.6/testing/v2.6.23/linux-2.6.23-rc1.tar.bz2',
-            km + 'v2.6/testing/linux-2.6.23-rc1.tar.bz2' ]
-        ]
-        sample = decompose_kernel('2.6.23-rc1')
-        sample = mirror_kernel_components(mirrorA, sample)
-        self.assertEqual(sample, correct)
-
-
-    def test_mirrorA_mmN(self):
-        correct = [
-          [ kml + 'v2.6/linux-2.6.23.tar.bz2',
-            km + 'v2.6/linux-2.6.23.tar.bz2'],
-          [ akpml + '2.6/2.6.23/2.6.23-mm1/2.6.23-mm1.bz2',
-            kml + 'people/akpm/patches/2.6/2.6.23/2.6.23-mm1/2.6.23-mm1.bz2',
-            akpm + '2.6/2.6.23/2.6.23-mm1/2.6.23-mm1.bz2' ]
-        ]
-
-        sample = decompose_kernel('2.6.23-mm1')
-        sample = mirror_kernel_components(mirrorA, sample)
-        self.assertEqual(sample, correct)
-
-
-    def test_mirrorA_gitN(self):
-        correct = [
-          [ kml + 'v2.6/linux-2.6.23.tar.bz2',
-            km + 'v2.6/linux-2.6.23.tar.bz2'],
-          [ kml + 'v2.6/snapshots/old/patch-2.6.23-git1.bz2',
-            kml + 'v2.6/snapshots/patch-2.6.23-git1.bz2',
-            km + 'v2.6/snapshots/old/patch-2.6.23-git1.bz2',
-            km + 'v2.6/snapshots/patch-2.6.23-git1.bz2' ]
-        ]
-        sample = decompose_kernel('2.6.23-git1')
-        sample = mirror_kernel_components(mirrorA, sample)
-        self.assertEqual(sample, correct)
-
-
-    def test_mirrorA_rcN_mmN(self):
-        correct = [
-          [ kml + 'v2.6/testing/v2.6.23/linux-2.6.23-rc1.tar.bz2',
-            kml + 'v2.6/testing/linux-2.6.23-rc1.tar.bz2',
-            km + 'v2.6/testing/v2.6.23/linux-2.6.23-rc1.tar.bz2',
-            km + 'v2.6/testing/linux-2.6.23-rc1.tar.bz2'],
-          [ akpml + '2.6/2.6.23-rc1/2.6.23-rc1-mm1/2.6.23-rc1-mm1.bz2',
-            kml + 'people/akpm/patches/2.6/2.6.23-rc1/2.6.23-rc1-mm1/2.6.23-rc1-mm1.bz2',
-            akpm + '2.6/2.6.23-rc1/2.6.23-rc1-mm1/2.6.23-rc1-mm1.bz2' ]
-        ]
-        sample = decompose_kernel('2.6.23-rc1-mm1')
-        sample = mirror_kernel_components(mirrorA, sample)
-        self.assertEqual(sample, correct)
-
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/client/bin/partition.py b/client/bin/partition.py
index 9e1dba1..283cce3 100644
--- a/client/bin/partition.py
+++ b/client/bin/partition.py
@@ -6,6 +6,8 @@
 @author: Martin Bligh (mbligh@google.com)
 """
 
+# pylint: disable=missing-docstring
+
 import os, re, string, sys, fcntl, logging
 from autotest_lib.client.bin import os_dep, utils
 from autotest_lib.client.common_lib import error
@@ -159,15 +161,15 @@
 
         device = partname_to_device(partname)
         if exclude_swap and device in active_swap_devices:
-            logging.debug('Skipping %s - Active swap.' % partname)
+            logging.debug('Skipping %s - Active swap.', partname)
             continue
 
         if min_blocks and blocks < min_blocks:
-            logging.debug('Skipping %s - Too small.' % partname)
+            logging.debug('Skipping %s - Too small.', partname)
             continue
 
         if filter_func and not filter_func(partname):
-            logging.debug('Skipping %s - Filter func.' % partname)
+            logging.debug('Skipping %s - Filter func.', partname)
             continue
 
         partitions.append(partition(job, device))
@@ -264,8 +266,8 @@
     for p in partitions:
         print_args = list(args)
         print_args += ['%s=%s' % (key, dargs[key]) for key in dargs.keys()]
-        logging.debug('%s.%s(%s)' % (str(p), method_name,
-                                     ', '.join(print_args)))
+        logging.debug('%s.%s(%s)', str(p), method_name,
+                                     ', '.join(print_args))
         sys.stdout.flush()
         def _run_named_method(function, part=p):
             getattr(part, method_name)(*args, **dargs)
@@ -375,26 +377,9 @@
         """
         @param job: A L{client.bin.job} instance.
         @param device: The device in question (e.g."/dev/hda2"). If device is a
-                file it will be mounted as loopback. If you have job config
-                'partition.partitions', e.g.,
-            job.config_set('partition.partitions', ["/dev/sda2", "/dev/sda3"])
-                you may specify a partition in the form of "partN" e.g. "part0",
-                "part1" to refer to elements of the partition list. This is
-                specially useful if you run a test in various machines and you
-                don't want to hardcode device names as those may vary.
+                file it will be mounted as loopback.
         @param loop_size: Size of loopback device (in MB). Defaults to 0.
         """
-        # NOTE: This code is used by IBM / ABAT. Do not remove.
-        part = re.compile(r'^part(\d+)$')
-        m = part.match(device)
-        if m:
-            number = int(m.groups()[0])
-            partitions = job.config_get('partition.partitions')
-            try:
-                device = partitions[number]
-            except:
-                raise NameError("Partition '" + device + "' not available")
-
         self.device = device
         self.name = os.path.basename(device)
         self.job = job
@@ -732,7 +717,7 @@
                 (pid, usage) = (m.group(1), m.group(2))
                 try:
                     ps = utils.system_output('ps -p %s | sed 1d' % pid)
-                    logging.debug('%s %s %s' % (usage, pid, ps))
+                    logging.debug('%s %s %s', usage, pid, ps)
                 except Exception:
                     pass
                 utils.system('ls -l ' + self.device)
@@ -740,7 +725,7 @@
                 utils.system(umount_cmd)
                 return True
         except error.CmdError:
-            logging.debug('Umount_force failed for %s' % self.device)
+            logging.debug('Umount_force failed for %s', self.device)
             return False
 
 
diff --git a/client/bin/setup_job_unittest.py b/client/bin/setup_job_unittest.py
index c6f824f..cd45725 100755
--- a/client/bin/setup_job_unittest.py
+++ b/client/bin/setup_job_unittest.py
@@ -202,13 +202,6 @@
         self.construct_job()
 
 
-    def test_relative_path(self):
-        self.construct_job()
-        dummy = "asdf"
-        ret = self.job.relative_path(os.path.join(self.job.resultdir, dummy))
-        self.assertEquals(ret, dummy)
-
-
     def test_setup_dirs_raise(self):
         self.construct_job()
 
diff --git a/client/bin/site_job.py b/client/bin/site_job.py
index ce91beb..037c5c9 100755
--- a/client/bin/site_job.py
+++ b/client/bin/site_job.py
@@ -2,16 +2,15 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
-import os
+# pylint: disable=missing-docstring
+
 from datetime import datetime
-from autotest_lib.client.bin import boottool, utils
+
+from autotest_lib.client.bin import utils
 from autotest_lib.client.bin.job import base_client_job
-from autotest_lib.client.common_lib import error
 from autotest_lib.client.cros import cros_logging
 
 
-LAST_BOOT_TAG = object()
-
 class site_job(base_client_job):
 
 
@@ -19,17 +18,6 @@
         base_client_job.__init__(self, *args, **kwargs)
 
 
-    def _runtest(self, url, timeout, tag, args, dargs):
-        # this replaced base_client_job._runtest, which is called by
-        # base_client_job.runtest.group_func (see job.py)
-        try:
-            self.last_error = None
-            base_client_job._runtest(self, url, timeout,tag, args, dargs)
-        except error.TestBaseException, detail:
-            self.last_error = detail
-            raise
-
-
     def run_test(self, url, *args, **dargs):
         log_pauser = cros_logging.LogRotationPauser()
         passed = False
@@ -49,12 +37,7 @@
         return passed
 
 
-    def reboot(self, tag=LAST_BOOT_TAG):
-        if tag == LAST_BOOT_TAG:
-            tag = self.last_boot_tag
-        else:
-            self.last_boot_tag = tag
-
+    def reboot(self):
         self.reboot_setup()
         self.harness.run_reboot()
 
diff --git a/client/bin/xen.py b/client/bin/xen.py
deleted file mode 100644
index d61a334..0000000
--- a/client/bin/xen.py
+++ /dev/null
@@ -1,207 +0,0 @@
-__author__ = """Copyright Martin J. Bligh, 2006,
-                Copyright IBM Corp. 2006, Ryan Harper <ryanh@us.ibm.com>"""
-
-import os, shutil, copy, pickle, re, glob
-from autotest_lib.client.bin import kernel, kernel_config, os_dep, test
-from autotest_lib.client.bin import utils
-
-
-class xen(kernel.kernel):
-
-    def log(self, msg):
-        print msg
-        self.logfile.write('%s\n' % msg)
-
-
-    def __init__(self, job, base_tree, results_dir, tmp_dir, build_dir,
-                                        leave = False, kjob = None):
-        # call base-class
-        kernel.kernel.__init__(self, job, base_tree, results_dir,
-                                        tmp_dir, build_dir, leave)
-        self.kjob = kjob
-
-
-    def config(self, config_file, config_list = None):
-        raise NotImplementedError('config() not implemented for xen')
-
-
-    def build(self, make_opts = '', logfile = '', extraversion='autotest'):
-        """build xen
-
-        make_opts
-                additional options to make, if any
-        """
-        self.log('running build')
-        os_dep.commands('gcc', 'make')
-        # build xen with extraversion flag
-        os.environ['XEN_EXTRAVERSION'] = '-unstable-%s'% extraversion
-        if logfile == '':
-            logfile = os.path.join(self.log_dir, 'xen_build')
-        os.chdir(self.build_dir)
-        self.log('log_dir: %s ' % self.log_dir)
-        self.job.logging.tee_redirect_debug_dir(self.log_dir, log_name=logfile)
-
-        # build xen hypervisor and user-space tools
-        targets = ['xen', 'tools']
-        threads = 2 * utils.count_cpus()
-        for t in targets:
-            build_string = 'make -j %d %s %s' % (threads, make_opts, t)
-            self.log('build_string: %s' % build_string)
-            utils.system(build_string)
-
-        # make a kernel job out of the kernel from the xen src if one isn't provided
-        if self.kjob is None:
-            # get xen kernel tree ready
-            self.log("prep-ing xen'ified kernel source tree")
-            utils.system('make prep-kernels')
-
-            v = self.get_xen_kernel_build_ver()
-            self.log('building xen kernel version: %s' % v)
-
-            # build xen-ified kernel in xen tree
-            kernel_base_tree = os.path.join(self.build_dir, \
-                    'linux-%s' % self.get_xen_kernel_build_ver())
-
-            self.log('kernel_base_tree = %s' % kernel_base_tree)
-            # fix up XENGUEST value in EXTRAVERSION; we can't have
-            # files with '$(XENGEUST)' in the name, =(
-            self.fix_up_xen_kernel_makefile(kernel_base_tree)
-
-            # make the kernel job
-            self.kjob = self.job.kernel(kernel_base_tree)
-
-            # hardcoding dom0 config (no modules for testing, yay!)
-            # FIXME: probe host to determine which config to pick
-            c = self.build_dir + '/buildconfigs/linux-defconfig_xen0_x86_32'
-            self.log('using kernel config: %s ' % c)
-            self.kjob.config(c)
-
-            # Xen's kernel tree sucks; doesn't use bzImage, but vmlinux
-            self.kjob.set_build_target('vmlinuz')
-
-            # also, the vmlinuz is not out in arch/*/boot, ARGH! more hackery
-            self.kjob.set_build_image(self.job.tmpdir + '/build/linux/vmlinuz')
-
-        self.kjob.build()
-
-        self.job.logging.restore()
-
-        xen_version = self.get_xen_build_ver()
-        self.log('BUILD VERSION: Xen: %s Kernel:%s' % \
-                        (xen_version, self.kjob.get_kernel_build_ver()))
-
-
-    def build_timed(self, *args, **kwds):
-        raise NotImplementedError('build_timed() not implemented')
-
-
-    def install(self, tag='', prefix = '/', extraversion='autotest'):
-        """make install in the kernel tree"""
-        self.log('Installing ...')
-
-        os.chdir(self.build_dir)
-
-        if not os.path.isdir(prefix):
-            os.mkdir(prefix)
-        self.boot_dir = os.path.join(prefix, 'boot')
-        if not os.path.isdir(self.boot_dir):
-            os.mkdir(self.boot_dir)
-
-        # remember what we are going to install
-        xen_version = '%s-%s' % (self.get_xen_build_ver(), extraversion)
-        self.xen_image = self.boot_dir + '/xen-' + xen_version + '.gz'
-        self.xen_syms  = self.boot_dir + '/xen-syms-' + xen_version
-
-        self.log('Installing Xen ...')
-        os.environ['XEN_EXTRAVERSION'] = '-unstable-%s'% extraversion
-
-        # install xen
-        utils.system('make DESTDIR=%s -C xen install' % prefix)
-
-        # install tools
-        utils.system('make DESTDIR=%s -C tools install' % prefix)
-
-        # install kernel
-        ktag = self.kjob.get_kernel_build_ver()
-        kprefix = prefix
-        self.kjob.install(tag=ktag, prefix=kprefix)
-
-
-    def add_to_bootloader(self, tag='autotest', args=''):
-        """ add this kernel to bootloader, taking an
-            optional parameter of space separated parameters
-            e.g.:  kernel.add_to_bootloader('mykernel', 'ro acpi=off')
-        """
-
-        # turn on xen mode
-        self.job.bootloader.enable_xen_mode()
-
-        # remove existing entry if present
-        self.job.bootloader.remove_kernel(tag)
-
-        # add xen and xen kernel
-        self.job.bootloader.add_kernel(
-                self.kjob.image, tag, initrd=self.kjob.initrd,
-                xen_hypervisor=self.xen_image)
-
-        # if no args passed, populate from /proc/cmdline
-        if not args:
-            args = open('/proc/cmdline', 'r').readline().strip()
-
-        # add args to entry one at a time
-        for a in args.split(' '):
-            self.job.bootloader.add_args(tag, a)
-
-        # turn off xen mode
-        self.job.bootloader.disable_xen_mode()
-
-
-    def get_xen_kernel_build_ver(self):
-        """Check xen buildconfig for current kernel version"""
-        version = patchlevel = sublevel = ''
-        extraversion = localversion = ''
-
-        version_file = self.build_dir + '/buildconfigs/mk.linux-2.6-xen'
-
-        for line in open(version_file, 'r').readlines():
-            if line.startswith('LINUX_VER'):
-                start = line.index('=') + 1
-                version = line[start:].strip() + "-xen"
-                break
-
-        return version
-
-
-    def fix_up_xen_kernel_makefile(self, kernel_dir):
-        """Fix up broken EXTRAVERSION in xen-ified Linux kernel Makefile"""
-        xenguest = ''
-        makefile = kernel_dir + '/Makefile'
-
-        for line in open(makefile, 'r').readlines():
-            if line.startswith('XENGUEST'):
-                start = line.index('=') + 1
-                xenguest = line[start:].strip()
-                break;
-
-        # change out $XENGUEST in EXTRAVERSION line
-        utils.system('sed -i.old "s,\$(XENGUEST),%s," %s' % (xenguest,
-                                                             makefile))
-
-
-    def get_xen_build_ver(self):
-        """Check Makefile and .config to return kernel version"""
-        version = patchlevel = sublevel = ''
-        extraversion = localversion = ''
-
-        for line in open(self.build_dir + '/xen/Makefile', 'r').readlines():
-            if line.startswith('export XEN_VERSION'):
-                start = line.index('=') + 1
-                version = line[start:].strip()
-            if line.startswith('export XEN_SUBVERSION'):
-                start = line.index('=') + 1
-                sublevel = line[start:].strip()
-            if line.startswith('export XEN_EXTRAVERSION'):
-                start = line.index('=') + 1
-                extraversion = line[start:].strip()
-
-        return "%s.%s%s" % (version, sublevel, extraversion)
diff --git a/client/common_lib/base_job.py b/client/common_lib/base_job.py
index 35ab0d9..63c3f3d 100644
--- a/client/common_lib/base_job.py
+++ b/client/common_lib/base_job.py
@@ -1,3 +1,5 @@
+# pylint: disable=missing-docstring
+
 import os, copy, logging, errno, fcntl, time, re, weakref, traceback
 import tarfile
 import cPickle as pickle
@@ -885,8 +887,6 @@
     @property args: A list of addtional miscellaneous command-line arguments
         provided when starting the job.
 
-    @property last_boot_tag: The label of the kernel from the last reboot.
-        [OPTIONAL,PERSISTENT]
     @property automatic_test_tag: A string which, if set, will be automatically
         added to the test name when running tests.
 
@@ -904,9 +904,6 @@
     @property num_tests_failed: The number of tests failed during the job.
         [OPTIONAL]
 
-    @property bootloader: An instance of the boottool class. May not be
-        available on job instances where access to the bootloader is not
-        available (e.g. on the server running a server job). [OPTIONAL]
     @property harness: An instance of the client test harness. Only available
         in contexts where client test execution happens. [OPTIONAL]
     @property logging: An instance of the logging manager associated with the
@@ -959,8 +956,6 @@
         '_state', 'default_profile_only', False)
     run_test_cleanup = _job_state.property_factory(
         '_state', 'run_test_cleanup', True)
-    last_boot_tag = _job_state.property_factory(
-        '_state', 'last_boot_tag', None)
     automatic_test_tag = _job_state.property_factory(
         '_state', 'automatic_test_tag', None)
 
diff --git a/client/common_lib/base_job_unittest.py b/client/common_lib/base_job_unittest.py
index 1d97725..3e9d244 100755
--- a/client/common_lib/base_job_unittest.py
+++ b/client/common_lib/base_job_unittest.py
@@ -1,5 +1,7 @@
 #!/usr/bin/python
 
+# pylint: disable=missing-docstring
+
 import logging
 import os
 import shutil
@@ -80,12 +82,12 @@
             'profdir', 'toolsdir',
 
             # other special attributes
-            'args', 'automatic_test_tag', 'bootloader', 'control',
+            'args', 'automatic_test_tag', 'control',
             'default_profile_only', 'drop_caches',
             'drop_caches_between_iterations', 'harness', 'hosts',
-            'last_boot_tag', 'logging', 'machines', 'num_tests_failed',
-            'num_tests_run', 'pkgmgr', 'profilers', 'resultdir',
-            'run_test_cleanup', 'sysinfo', 'tag', 'user', 'use_sequence_number',
+            'logging', 'machines', 'num_tests_failed', 'num_tests_run',
+            'pkgmgr', 'profilers', 'resultdir', 'run_test_cleanup',
+            'sysinfo', 'tag', 'user', 'use_sequence_number',
             'warning_loggers', 'warning_manager', 'label', 'test_retry',
             'parent_job_id', 'in_lab', 'machine_dict_list'
             ])
@@ -93,10 +95,9 @@
         OPTIONAL_ATTRIBUTES = set([
             'serverdir',
 
-            'automatic_test_tag', 'bootloader', 'control', 'harness',
-            'last_boot_tag', 'num_tests_run', 'num_tests_failed', 'tag',
-            'warning_manager', 'warning_loggers', 'label', 'test_retry',
-            'parent_job_id'
+            'automatic_test_tag', 'control', 'harness', 'num_tests_run',
+            'num_tests_failed', 'tag', 'warning_manager',
+            'warning_loggers', 'label', 'test_retry', 'parent_job_id'
             ])
 
         OPTIONAL_ATTRIBUTES_DEVICE_ERROR = set(['failed_with_device_error'])
diff --git a/client/common_lib/boottool.py b/client/common_lib/boottool.py
deleted file mode 100644
index f123f1c..0000000
--- a/client/common_lib/boottool.py
+++ /dev/null
@@ -1,295 +0,0 @@
-# Copyright 2009 Google Inc. Released under the GPL v2
-
-import re
-
-
-class boottool(object):
-    """
-    Common class for the client and server side boottool wrappers.
-    """
-
-    def __init__(self):
-        self._xen_mode = False
-
-
-    def _run_boottool(self, *options):
-        """
-        Override in derivations to execute the "boottool" command and return
-        the stdout output in case of success. In case of failure an exception
-        should be raised.
-
-        @param options: a sequence of command line arguments to give to the
-                boottool command
-        @return string with the stdout output of the boottool command.
-        @raise Exception in case of boottool command failure.
-        """
-        raise NotImplementedError('_run_boottool not implemented!')
-
-
-    def get_type(self):
-        """
-        Return the installed bootloader type.
-        """
-        return self._run_boottool('--bootloader-probe').strip()
-
-
-    def get_architecture(self):
-        """
-        Get the system architecture reported by the bootloader.
-        """
-        return self._run_boottool('--arch-probe').strip()
-
-
-    def get_titles(self):
-        """
-        Returns a list of boot entries titles.
-        """
-        return [entry['title'] for entry in self.get_entries().itervalues()]
-
-
-    def get_default(self):
-        """
-        Return an int with the # of the default bootloader entry.
-        """
-        return int(self._run_boottool('--default').strip())
-
-
-    def set_default(self, index):
-        """
-        Set the default boot entry.
-
-        @param index: entry index number to set as the default.
-        """
-        assert index is not None
-        self._run_boottool('--set-default=%s' % index)
-
-
-    def get_default_title(self):
-        """
-        Get the default entry title.
-
-        @return a string of the default entry title.
-        """
-        return self.get_entry('default')['title']
-
-
-    def _parse_entry(self, entry_str):
-        """
-        Parse entry as returned by boottool.
-
-        @param entry_str: one entry information as returned by boottool
-        @return: dictionary of key -> value where key is the string before
-                the first ":" in an entry line and value is the string after
-                it
-        """
-        entry = {}
-        for line in entry_str.splitlines():
-            if len(line) == 0:
-                continue
-            name, value = line.split(':', 1)
-            name = name.strip()
-            value = value.strip()
-
-            if name == 'index':
-                # index values are integrals
-                value = int(value)
-            entry[name] = value
-
-        return entry
-
-
-    def get_entry(self, search_info):
-        """
-        Get a single bootloader entry information.
-
-        NOTE: if entry is "fallback" and bootloader is grub
-        use index instead of kernel title ("fallback") as fallback is
-        a special option in grub
-
-        @param search_info: can be 'default', position number or title
-        @return a dictionary of key->value where key is the type of entry
-                information (ex. 'title', 'args', 'kernel', etc) and value
-                is the value for that piece of information.
-        """
-        return self._parse_entry(self._run_boottool('--info=%s' % search_info))
-
-
-    def get_entries(self):
-        """
-        Get all entries information.
-
-        @return: a dictionary of index -> entry where entry is a dictionary
-                of entry information as described for get_entry().
-        """
-        raw = "\n" + self._run_boottool('--info=all')
-        entries = {}
-        for entry_str in raw.split("\nindex"):
-            if len(entry_str.strip()) == 0:
-                continue
-            entry = self._parse_entry("index" + entry_str)
-            entries[entry["index"]] = entry
-
-        return entries
-
-
-    def get_title_for_kernel(self, path):
-        """
-        Returns a title for a particular kernel.
-
-        @param path: path of the kernel image configured in the boot config
-        @return: if the given kernel path is found it will return a string
-                with the title for the found entry, otherwise returns None
-        """
-        entries = self.get_entries()
-        for entry in entries.itervalues():
-            if entry.get('kernel') == path:
-                return entry['title']
-        return None
-
-
-    def add_args(self, kernel, args):
-        """
-        Add cmdline arguments for the specified kernel.
-
-        @param kernel: can be a position number (index) or title
-        @param args: argument to be added to the current list of args
-        """
-
-        parameters = ['--update-kernel=%s' % kernel, '--args=%s' % args]
-
-        #add parameter if this is a Xen entry
-        if self._xen_mode:
-            parameters.append('--xen')
-
-        self._run_boottool(*parameters)
-
-
-    def remove_args(self, kernel, args):
-        """
-        Removes specified cmdline arguments.
-
-        @param kernel: can be a position number (index) or title
-        @param args: argument to be removed of the current list of args
-        """
-
-        parameters = ['--update-kernel=%s' % kernel, '--remove-args=%s' % args]
-
-        #add parameter if this is a Xen entry
-        if self._xen_mode:
-            parameters.append('--xen')
-
-        self._run_boottool(*parameters)
-
-
-    def __remove_duplicate_cmdline_args(self, cmdline):
-        """
-        Remove the duplicate entries in cmdline making sure that the first
-        duplicate occurances are the ones removed and the last one remains
-        (this is in order to not change the semantics of the "console"
-        parameter where the last occurance has special meaning)
-
-        @param cmdline: a space separate list of kernel boot parameters
-            (ex. 'console=ttyS0,57600n8 nmi_watchdog=1')
-        @return: a space separated list of kernel boot parameters without
-            duplicates
-        """
-        copied = set()
-        new_args = []
-
-        for arg in reversed(cmdline.split()):
-            if arg not in copied:
-                new_args.insert(0, arg)
-                copied.add(arg)
-        return ' '.join(new_args)
-
-
-    def add_kernel(self, path, title='autoserv', root=None, args=None,
-                   initrd=None, default=False, position='end',
-                   xen_hypervisor=None):
-        """
-        Add a kernel entry to the bootloader (or replace if one exists
-        already with the same title).
-
-        @param path: string path to the kernel image file
-        @param title: title of this entry in the bootloader config
-        @param root: string of the root device
-        @param args: string with cmdline args
-        @param initrd: string path to the initrd file
-        @param default: set to True to make this entry the default one
-                (default False)
-        @param position: where to insert the new entry in the bootloader
-                config file (default 'end', other valid input 'start', or
-                # of the title)
-        @param xen_hypervisor: xen hypervisor image file (valid only when
-                xen mode is enabled)
-        """
-        if title in self.get_titles():
-            self.remove_kernel(title)
-
-        parameters = ['--add-kernel=%s' % path, '--title=%s' % title]
-
-        if root:
-            parameters.append('--root=%s' % root)
-
-        if args:
-            parameters.append('--args=%s' %
-                              self.__remove_duplicate_cmdline_args(args))
-
-        if initrd:
-            parameters.append('--initrd=%s' % initrd)
-
-        if default:
-            parameters.append('--make-default')
-
-        if position:
-            parameters.append('--position=%s' % position)
-
-        # add parameter if this is a Xen entry
-        if self._xen_mode:
-            parameters.append('--xen')
-            if xen_hypervisor:
-                parameters.append('--xenhyper=%s' % xen_hypervisor)
-
-        self._run_boottool(*parameters)
-
-
-    def remove_kernel(self, kernel):
-        """
-        Removes a specific entry from the bootloader configuration.
-
-        @param kernel: can be 'start', 'end', entry position or entry title.
-        """
-        self._run_boottool('--remove-kernel=%s' % kernel)
-
-
-    def boot_once(self, title=None):
-        """
-        Sets a specific entry for the next boot, then falls back to the
-        default kernel.
-
-        @param kernel: title that identifies the entry to set for booting. If
-                evaluates to false, this becomes a no-op.
-        """
-        if title:
-            self._run_boottool('--boot-once', '--title=%s' % title)
-
-
-    def enable_xen_mode(self):
-        """
-        Enables xen mode. Future operations will assume xen is being used.
-        """
-        self._xen_mode = True
-
-
-    def disable_xen_mode(self):
-        """
-        Disables xen mode.
-        """
-        self._xen_mode = False
-
-
-    def get_xen_mode(self):
-        """
-        Returns a boolean with the current status of xen mode.
-        """
-        return self._xen_mode
diff --git a/client/common_lib/boottool_unittest.py b/client/common_lib/boottool_unittest.py
deleted file mode 100755
index f3e06e3..0000000
--- a/client/common_lib/boottool_unittest.py
+++ /dev/null
@@ -1,311 +0,0 @@
-#!/usr/bin/python
-
-import unittest
-import common
-
-from autotest_lib.client.common_lib.test_utils import mock
-from autotest_lib.client.common_lib import boottool
-
-
-class test_boottool(unittest.TestCase):
-    def setUp(self):
-        self.god = mock.mock_god()
-        # creates a bootloader with _run_boottool mocked out
-        self.bt_mock = boottool.boottool()
-        self.god.stub_function(self.bt_mock, '_run_boottool')
-
-
-    def tearDown(self):
-        self.god.unstub_all()
-
-
-    def expect_run_boottool(self, args, result=''):
-        self.bt_mock._run_boottool.expect_call(*args).and_return(result)
-
-
-    def test_get_type(self):
-        # set up the recording
-        self.expect_run_boottool(('--bootloader-probe',), 'lilo\n')
-        # run the test
-        self.assertEquals(self.bt_mock.get_type(), 'lilo')
-        self.god.check_playback()
-
-
-    def test_get_arch(self):
-        # set up the recording
-        self.expect_run_boottool(('--arch-probe',), 'x86_64\n')
-        # run the test
-        self.assertEquals(self.bt_mock.get_architecture(), 'x86_64')
-        self.god.check_playback()
-
-
-    def test_get_default(self):
-        # set up the recording
-        self.expect_run_boottool(('--default',), '0\n')
-        # run the test
-        self.assertEquals(self.bt_mock.get_default(), 0)
-        self.god.check_playback()
-
-
-    def test_get_titles(self):
-        # set up the recording
-        self.expect_run_boottool(
-                ('--info=all',), '\nindex\t: 0\ntitle\t: title #1\n'
-                '\nindex\t: 1\ntitle\t: title #2\n')
-        # run the test
-        self.assertEquals(self.bt_mock.get_titles(),
-                          ['title #1', 'title #2'])
-        self.god.check_playback()
-
-
-    def test_get_entry(self):
-        RESULT = (
-        'index\t: 5\n'
-        'args\t: ro single\n'
-        'boot\t: (hd0,0)\n'
-        'initrd\t: /boot/initrd.img-2.6.15-23-386\n'
-        'kernel\t: /boot/vmlinuz-2.6.15-23-386\n'
-        'root\t: UUID=07D7-0714\n'
-        'savedefault\t:   \n'
-        'title\t: Distro, kernel 2.6.15-23-386\n'
-        )
-        # set up the recording
-        self.expect_run_boottool(('--info=5',), RESULT)
-        # run the test
-        info = self.bt_mock.get_entry(5)
-        self.god.check_playback()
-        expected_info = {'index': 5, 'args': 'ro single',
-                         'boot': '(hd0,0)',
-                         'initrd': '/boot/initrd.img-2.6.15-23-386',
-                         'kernel': '/boot/vmlinuz-2.6.15-23-386',
-                         'root': 'UUID=07D7-0714', 'savedefault': '',
-                         'title': 'Distro, kernel 2.6.15-23-386'}
-        self.assertEquals(expected_info, info)
-
-
-    def test_get_entry_missing_result(self):
-        # set up the recording
-        self.expect_run_boottool(('--info=4',), '')
-        # run the test
-        info = self.bt_mock.get_entry(4)
-        self.god.check_playback()
-        self.assertEquals({}, info)
-
-
-    def test_get_entries(self):
-        RESULT = (
-        'index\t: 5\n'
-        'args\t: ro single\n'
-        'boot\t: (hd0,0)\n'
-        'initrd\t: /boot/initrd.img-2.6.15-23-386\n'
-        'kernel\t: /boot/vmlinuz-2.6.15-23-386\n'
-        'root\t: UUID=07D7-0714\n'
-        'savedefault\t:   \n'
-        'title\t: Distro, kernel 2.6.15-23-386\n'
-        '\n'
-        'index\t: 7\n'
-        'args\t: ro single\n'
-        'boot\t: (hd0,0)\n'
-        'initrd\t: /boot/initrd.img-2.6.15-23-686\n'
-        'kernel\t: /boot/vmlinuz-2.6.15-23-686\n'
-        'root\t: UUID=07D7-0714\n'
-        'savedefault\t:   \n'
-        'title\t: Distro, kernel 2.6.15-23-686\n'
-        )
-        # set up the recording
-        self.expect_run_boottool(('--info=all',), RESULT)
-        # run the test
-        info = self.bt_mock.get_entries()
-        self.god.check_playback()
-        expected_info = {
-            5: {'index': 5, 'args': 'ro single', 'boot': '(hd0,0)',
-                'initrd': '/boot/initrd.img-2.6.15-23-386',
-                'kernel': '/boot/vmlinuz-2.6.15-23-386',
-                'root': 'UUID=07D7-0714', 'savedefault': '',
-                'title': 'Distro, kernel 2.6.15-23-386'},
-            7: {'index': 7, 'args': 'ro single', 'boot': '(hd0,0)',
-                'initrd': '/boot/initrd.img-2.6.15-23-686',
-                'kernel': '/boot/vmlinuz-2.6.15-23-686',
-                'root': 'UUID=07D7-0714', 'savedefault': '',
-                'title': 'Distro, kernel 2.6.15-23-686'}}
-        self.assertEquals(expected_info, info)
-
-
-    def test_set_default(self):
-        # set up the recording
-        self.expect_run_boottool(('--set-default=41',))
-        # run the test
-        self.bt_mock.set_default(41)
-        self.god.check_playback()
-
-
-    def test_add_args(self):
-        # set up the recording
-        self.expect_run_boottool(
-            ('--update-kernel=10', '--args=some kernel args'))
-        # run the test
-        self.bt_mock.add_args(10, 'some kernel args')
-        self.god.check_playback()
-
-
-    def test_remove_args(self):
-        # set up the recording
-        self.expect_run_boottool(
-            ('--update-kernel=12', '--remove-args=some kernel args'))
-        # run the test
-        self.bt_mock.remove_args(12, 'some kernel args')
-        self.god.check_playback()
-
-
-    def setup_add_kernel(self, oldtitle, path, title, root=None, args=None,
-                         initrd=None, default=False, position='end',
-                         xen_hypervisor=None):
-        self.bt_mock.get_titles = self.god.create_mock_function('get_titles')
-        # set up the recording
-        self.bt_mock.get_titles.expect_call().and_return([oldtitle])
-        if oldtitle == title:
-            self.expect_run_boottool(('--remove-kernel=%s' % oldtitle,))
-
-        parameters = ['--add-kernel=%s' % path, '--title=%s' % title]
-        if root:
-            parameters.append('--root=%s' % root)
-        if args:
-            parameters.append('--args=%s' % args)
-        if initrd:
-            parameters.append('--initrd=%s' % initrd)
-        if default:
-            parameters.append('--make-default')
-        if position:
-            parameters.append('--position=%s' % position)
-        if self.bt_mock.get_xen_mode():
-            parameters.append('--xen')
-            if xen_hypervisor:
-                parameters.append('--xenhyper=%s' % xen_hypervisor)
-        self.expect_run_boottool(parameters)
-
-
-    def test_add_kernel_basic(self):
-        # set up the recording
-        self.setup_add_kernel(
-                'notmylabel', '/unittest/kernels/vmlinuz', 'mylabel')
-        # run the test
-        self.bt_mock.add_kernel('/unittest/kernels/vmlinuz',
-                                'mylabel')
-        self.god.check_playback()
-
-
-    def test_add_kernel_removes_old(self):
-        # set up the recording
-        self.setup_add_kernel(
-                'mylabel', '/unittest/kernels/vmlinuz', 'mylabel')
-        # run the test
-        self.bt_mock.add_kernel('/unittest/kernels/vmlinuz', 'mylabel')
-        self.god.check_playback()
-
-
-    def test_add_kernel_adds_root(self):
-        # set up the recording
-        self.setup_add_kernel(
-                'notmylabel', '/unittest/kernels/vmlinuz', 'mylabel',
-                root='/unittest/root')
-        # run the test
-        self.bt_mock.add_kernel('/unittest/kernels/vmlinuz',
-                                'mylabel', root='/unittest/root')
-        self.god.check_playback()
-
-
-    def test_add_kernel_adds_args(self):
-        # set up the recording
-        self.setup_add_kernel(
-                'notmylabel', '/unittest/kernels/vmlinuz', 'mylabel',
-                args='my kernel args')
-        # run the test
-        self.bt_mock.add_kernel('/unittest/kernels/vmlinuz',
-                                'mylabel', args='my kernel args')
-        self.god.check_playback()
-
-
-    def test_add_kernel_args_remove_duplicates(self):
-        # set up the recording
-        self.setup_add_kernel(
-                'notmylabel', '/unittest/kernels/vmlinuz', 'mylabel',
-                args='param2 param1')
-        # run the test
-        self.bt_mock.add_kernel('/unittest/kernels/vmlinuz',
-                                'mylabel', args='param1 param2 param1')
-        self.god.check_playback()
-
-
-    def test_add_kernel_adds_initrd(self):
-        # set up the recording
-        self.setup_add_kernel(
-                'notmylabel', '/unittest/kernels/vmlinuz', 'mylabel',
-                initrd='/unittest/initrd')
-        # run the test
-        self.bt_mock.add_kernel('/unittest/kernels/vmlinuz',
-                                'mylabel', initrd='/unittest/initrd')
-        self.god.check_playback()
-
-
-    def test_add_kernel_enables_make_default(self):
-        # set up the recording
-        self.setup_add_kernel(
-                'notmylabel', '/unittest/kernels/vmlinuz', 'mylabel',
-                default=True)
-        # run the test
-        self.bt_mock.add_kernel('/unittest/kernels/vmlinuz',
-                                'mylabel', default=True)
-        self.god.check_playback()
-
-
-    def test_add_kernel_position(self):
-        # set up the recording
-        self.setup_add_kernel(
-                'notmylabel', '/unittest/kernels/vmlinuz', 'mylabel',
-                position=5)
-        # run the test
-        self.bt_mock.add_kernel('/unittest/kernels/vmlinuz',
-                                'mylabel', position=5)
-        self.god.check_playback()
-
-
-    def test_remove_kernel(self):
-        # set up the recording
-        self.expect_run_boottool(('--remove-kernel=14',))
-        # run the test
-        self.bt_mock.remove_kernel(14)
-        self.god.check_playback()
-
-
-    def test_boot_once(self):
-        # set up the recording
-        self.expect_run_boottool(('--boot-once', '--title=autotest'))
-        # run the test
-        self.bt_mock.boot_once('autotest')
-        self.god.check_playback()
-
-
-    def test_enable_xen(self):
-        self.bt_mock.enable_xen_mode()
-        self.assertTrue(self.bt_mock.get_xen_mode())
-
-
-    def test_disable_xen(self):
-        self.bt_mock.disable_xen_mode()
-        self.assertFalse(self.bt_mock.get_xen_mode())
-
-
-    def test_add_kernel_xen(self):
-        # set up the recording
-        self.bt_mock.enable_xen_mode()
-        self.setup_add_kernel(
-                'notmylabel', '/unittest/kernels/vmlinuz', 'mylabel',
-                xen_hypervisor='xen_image')
-        # run the test
-        self.bt_mock.add_kernel('/unittest/kernels/vmlinuz',
-                                'mylabel', xen_hypervisor='xen_image')
-        self.god.check_playback()
-
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/client/common_lib/log.py b/client/common_lib/log.py
index 10813c1..f79f7de 100644
--- a/client/common_lib/log.py
+++ b/client/common_lib/log.py
@@ -1,3 +1,5 @@
+# pylint: disable=missing-docstring
+
 import sys, re, traceback
 
 # these statuses are ordered such that a status earlier in the list will
@@ -14,53 +16,6 @@
         return True
 
 
-def is_failure(status):
-    if not is_valid_status(status):
-        return False
-    if status in ('START', 'INFO'):
-        return False
-    if status.startswith('END '):
-        status = status[len('END '):]
-    return job_statuses.index(status) <= job_statuses.index("FAIL")
-
-
-def record(fn):
-    """
-    Generic method decorator for logging calls under the
-    assumption that return=GOOD, exception=FAIL. The method
-    determines parameters as:
-            subdir = self.subdir if it exists, or None
-            operation = "class name"."method name"
-            status = None on GOOD, str(exception) on FAIL
-    The object using this method must have a job attribute
-    for the logging to actually occur, otherwise the logging
-    will silently fail.
-
-    Logging can explicitly be disabled for a call by passing
-    a logged=False parameter
-    """
-    def recorded_func(self, *args, **dargs):
-        logged = dargs.pop('logged', True)
-        job = getattr(self, 'job', None)
-        # if logging is disabled/unavailable, just
-        # call the method
-        if not logged or job is None:
-            return fn(self, *args, **dargs)
-        # logging is available, so wrap the method call
-        # in success/failure logging
-        subdir = getattr(self, 'subdir', None)
-        operation = '%s.%s' % (self.__class__.__name__,
-                               fn.__name__)
-        try:
-            result = fn(self, *args, **dargs)
-            job.record('GOOD', subdir, operation)
-        except Exception, detail:
-            job.record('FAIL', subdir, operation, str(detail))
-            raise
-        return result
-    return recorded_func
-
-
 def log_and_ignore_errors(msg):
     """ A decorator for wrapping functions in a 'log exception and ignore'
     try-except block. """
diff --git a/client/deps/boottool/Linux-Bootloader-1.2.tar.gz b/client/deps/boottool/Linux-Bootloader-1.2.tar.gz
deleted file mode 100644
index 79fa930..0000000
--- a/client/deps/boottool/Linux-Bootloader-1.2.tar.gz
+++ /dev/null
Binary files differ
diff --git a/client/deps/boottool/boottool.py b/client/deps/boottool/boottool.py
deleted file mode 100755
index a391be3..0000000
--- a/client/deps/boottool/boottool.py
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/python
-
-import os
-from autotest_lib.client.bin import utils
-
-# To use this, you have to set PERL5LIB to:
-#               autodir+'deps/boottool/lib/perl'
-# or on Ubuntu we also need
-#               autodir+'deps/boottool/share/perl'
-# because it uses nonstandard locations
-
-version = 1
-
-def setup(tarball, topdir):
-    srcdir = os.path.join(topdir, 'src')
-    utils.extract_tarball_to_dir(tarball, srcdir)
-    os.chdir(srcdir)
-    utils.system('perl Makefile.PL PREFIX=' + topdir)
-    utils.make()
-    utils.make('install')
-    os.chdir(topdir)
-
-
-pwd = os.getcwd()
-tarball = os.path.join(pwd, 'Linux-Bootloader-1.2.tar.gz')
-utils.update_version(pwd+'/src', False, version, setup, tarball, pwd)
diff --git a/client/deps/boottool/control b/client/deps/boottool/control
deleted file mode 100644
index 7d8fabb..0000000
--- a/client/deps/boottool/control
+++ /dev/null
@@ -1 +0,0 @@
-job.setup_dep(['boottool'])
diff --git a/client/tools/boottool b/client/tools/boottool
deleted file mode 100755
index 728e4ef..0000000
--- a/client/tools/boottool
+++ /dev/null
@@ -1,2822 +0,0 @@
-#!/usr/bin/perl
-=head1 NAME
-
-Linux::Bootloader - Base class interacting with Linux bootloaders
-
-=head1 SYNOPSIS
-
-	
-	my $bootloader = new Linux::Bootloader();
-        my $config_file='/boot/grub/menu.lst';
-	
-	$bootloader->read($config_file);
-	$bootloader->print_info('all');
-	$bootloader->add(%hash);
-	$bootloader->update(%hash);
-	$bootloader->remove(2);
-	$bootloader->get_default();
-	$bootloader->set_default(2);
-	%hash = $bootloader->read_entry(0);
-	$bootloader->write($config_file);
-
-  
-=head1 DESCRIPTION
-
-This module provides base functions for working with bootloader configuration files.
-
-=head1 FUNCTIONS
-
-=head2 new()
-
-	Creates a new Linux::Bootloader object.
-
-=head2 read()
-
-	Reads configuration file into an array.
-	Takes: string.
-	Returns: undef on error.
-
-=head2 write()
-
-	Writes configuration file.
-	Takes: string.
-	Returns: undef on error.
-
-=head2 print_info()
-
-	Prints information from config.
-	Takes: string.
-	Returns: undef on error.
-
-=head2 _info()
-
-	Parse config into array of hashes.
-	Takes: nothing.
-	Returns: array of hashes.
-
-=head2 get_default()
-
-	Determine current default kernel.
-	Takes: nothing.
-	Returns: integer, undef on error.
-
-=head2 set_default()
-
-	Set new default kernel.
-	Takes: integer.
-	Returns: undef on error.
-
-=head2 add()
-
-	Add new kernel to config.
-	Takes: hash.
-	Returns: undef on error.
-
-=head2 update()
-
-	Update args of an existing kernel entry.
-	Takes: hash.
-	Returns: undef on error.
-
-=head2 remove()
-
-	Remove kernel from config.
-	Takes: string.
-	Returns: undef on error.
-
-=head2 read_entry()
-
-        Read an existing entry into a hash suitable to add or update from.
-	Takes: integer or title
-	Returns: undef or hash
-
-=head2 debug($level)
-
-        Sets or gets the current debug level, 0-5.
-        Returns:  Debug level
-
-=head2 _check_config()
-
-        Conducts a basic check for kernel validity
-        Returns:  true if checks out okay,
-                  false if not okay,
-                  undef on error
-
-=head2 _lookup()
-
-        Converts title into position.
-	Takes: string.
-        Returns:  integer,
-                  undef on error
-
-=cut
-
-
-package Linux::Bootloader;
-
-use strict;
-use warnings;
-
-use vars qw( $VERSION );
-
-
-sub new {
-    my $this = shift;
-    my $class = ref($this) || $this;
-    if ( defined $class and $class  eq 'Linux::Bootloader' ){
-        my $detected_bootloader = Linux::Bootloader::Detect::detect_bootloader();
-        unless (defined $detected_bootloader) { return undef; }
-        $class = "Linux::Bootloader::" . "\u$detected_bootloader";
-        eval" require $class; ";
-    } 
-    my $self = bless ({}, $class);
-    $self->{config_file} = shift;
-    unless (defined $self->{'config_file'}){
-        $self->_set_config_file(); 
-    }
-
-    $self->{config}	= [];
-    $self->{debug}	= 0;
-    $self->{'entry'}    = {};
-
-    return $self;
-}
-
-
-### Generic Functions ###
-
-# Read config file into array
-
-sub read {
-  my $self=shift;
-  my $config_file=shift || $self->{config_file};
-  print ("Reading $config_file.\n") if $self->debug()>1;
-
-  open(CONFIG, "$config_file")
-    || warn ("ERROR:  Can't open $config_file.\n") && return undef;
-  @{$self->{config}}=<CONFIG>;
-  close(CONFIG);
-
-  print ("Current config:\n @{$self->{config}}") if $self->debug()>4;
-  print ("Closed $config_file.\n") if $self->debug()>2;
-  return 1;
-}
-
-
-# Write new config
-
-sub write {
-  my $self=shift;
-  my $config_file=shift || $self->{config_file};
-  my @config=@{$self->{config}};
-
-  return undef unless $self->_check_config();
-
-  print ("Writing $config_file.\n") if $self->debug()>1;
-  print join("",@config) if $self->debug() > 4;
-
-  if (-w $config_file) {
-    system("cp","$config_file","$config_file.bak.boottool");
-    if ($? != 0) {
-      warn "ERROR:  Cannot backup $config_file.\n"; 
-      return undef;
-    } else {
-      print "Backed up config to $config_file.bak.boottool.\n";
-    }
-
-    open(CONFIG, ">$config_file")
-      || warn ("ERROR:  Can't open config file.\n") && return undef;
-    print CONFIG join("",@config);
-    close(CONFIG);
-    return 0;
-  } else {
-    print join("",@config) if $self->debug() > 2;
-    warn "WARNING:  You do not have write access to $config_file.\n";
-    return 1;
-  }
-}
-
-
-# Parse config into array of hashes
-
-sub _info {
-  my $self=shift;
-
-  return undef unless $self->_check_config();
-  my @config=@{$self->{config}};
-
-  # remove garbarge - comments, blank lines
-  @config=grep(!/^#|^\n/, @config);
-
-  my %matches = ( default => '^\s*default[\s+\=]+(\S+)',
-                  timeout => '^\s*timeout[\s+\=]+(\S+)',
-                  title   => '^\s*label[\s+\=]+(\S+)',
-                  root    => '^\s*root[\s+\=]+(\S+)',
-                  args    => '^\s*append[\s+\=]+(.*)',
-                  initrd  => '^\s*initrd[\s+\=]+(\S+)',
-                );
-
-  my @sections;
-  my $index=0;
-  foreach (@config) {
-    if ($_ =~ /^\s*(image|other)[\s+\=]+(\S+)/i) {
-      $index++;
-      $sections[$index]{'kernel'} = $2;
-    }
-    foreach my $key (keys %matches) {
-      if ($_ =~ /$matches{$key}/i) {
-        $sections[$index]{$key} = $1;
-	$sections[$index]{$key} =~ s/\"|\'//g if ($key eq 'args');
-      }
-    }
-  }
-
-  # sometimes config doesn't have a default, so goes to first
-  if (!(defined $sections[0]{'default'})) {
-    $sections[0]{'default'} = '0';
-
-  # if default is label name, we need position
-  } else {
-    foreach my $index (1..$#sections) {
-      if ($sections[$index]{'title'} eq $sections[0]{'default'}) {
-        $sections[0]{'default'} = $index-1;
-        last;
-      }
-    }
-  }
-
-  # if still no valid default, set to first
-  if ( $sections[0]{'default'} !~ m/^\d+$/ ) {
-    $sections[0]{'default'} = 0;
-  }
-
-  # return array of hashes
-  return @sections;
-}
-
-
-# Determine current default kernel
-
-sub get_default {
-  my $self = shift;
-
-  print ("Getting default.\n") if $self->debug()>1;
-  return undef unless $self->_check_config();
-
-  my @sections = $self->_info();
-  my $default = $sections[0]{'default'};
-  if ($default =~ /^\d+$/) {
-      return 0+$default;
-  }
-
-}
-
-# Find the template entry.
-sub get_template {
-  my ($self) = @_;
-
-  print ("Getting template.\n") if $self->debug()>1;
-  return undef unless $self->_check_config();
-
-  my @sections = $self->_info();
-  my $default = $sections[0]{'default'} + 1;
-
-  if (defined $sections[$default]{'kernel'}) {
-    return $default - 1;
-  }
-  for ($default = 1; $default <= $#sections; $default++) {
-    if (defined $sections[$default]->{'kernel'}) {
-      return $default - 1;
-    }
-  }
-  return undef;
-}
-
-
-# Set new default kernel
-
-sub set_default {
-  my $self=shift;
-  my $newdefault=shift;
-
-  print ("Setting default.\n") if $self->debug()>1;
-
-  return undef unless defined $newdefault;
-  return undef unless $self->_check_config();
-
-  my @config=@{$self->{config}};
-  my @sections=$self->_info();
-
-  # if not a number, do title lookup
-  if ($newdefault !~ /^\d+$/) {
-    $newdefault = $self->_lookup($newdefault);
-  }
-
-  my $kcount = $#sections-1;
-  if ((!defined $newdefault) || ($newdefault < 0) || ($newdefault > $kcount)) {
-    warn "ERROR:  Enter a default between 0 and $kcount.\n";
-    return undef;
-  }
-
-  # convert position to title
-  $newdefault = $sections[++$newdefault]{title};
- 
-  foreach my $index (0..$#config) {
-    if ($config[$index] =~ /^\s*default/i) { 
-      $config[$index] = "default=$newdefault	# set by $0\n"; 
-      last;
-    }
-  }
-  @{$self->{config}} = @config;
-}
-
-
-# Add new kernel to config
-
-sub add {
-  my $self=shift;
-  my %param=@_;
-
-  print ("Adding kernel.\n") if $self->debug()>1;
-
-  if (!defined $param{'add-kernel'} && defined $param{'kernel'}) {
-    $param{'add-kernel'} = $param{'kernel'};
-  } elsif (!defined $param{'add-kernel'} || !defined $param{'title'}) {
-    warn "ERROR:  kernel path (--add-kernel), title (--title) required.\n";
-    return undef;
-  } elsif (!(-f "$param{'add-kernel'}")) {
-    warn "ERROR:  kernel $param{'add-kernel'} not found!\n";
-    return undef;
-  } elsif (defined $param{'initrd'} && !(-f "$param{'initrd'}")) {
-    warn "ERROR:  initrd $param{'initrd'} not found!\n";
-    return undef;
-  }
-
-  return undef unless $self->_check_config();
-
-  # remove title spaces and truncate if more than 15 chars
-  $param{title} =~ s/\s+//g;
-  $param{title} = substr($param{title}, 0, 15) if length($param{title}) > 15;
-
-  my @sections=$self->_info();
-
-  # check if title already exists
-  if (defined $self->_lookup($param{title})) {
-    warn ("WARNING:  Title already exists.\n");
-    if (defined $param{force}) {
-      $self->remove($param{title});
-    } else {
-      return undef;
-    }
-  }
-
-  my @config = @{$self->{config}};
-  @sections=$self->_info();
- 
-  # Use default kernel to fill in missing info
-  my $default=$self->get_template();
-  $default++;
-
-  foreach my $p ('args', 'root') {
-    if (! defined $param{$p}) {
-      $param{$p} = $sections[$default]{$p};
-    }
-  }
-
-  # use default entry to determine if path (/boot) should be removed
-  my $bootpath = $sections[$default]{'kernel'};
-  $bootpath =~ s@[^/]*$@@;
-
-  $param{'add-kernel'} =~ s@^/boot/@$bootpath@;
-  $param{'initrd'} =~ s@^/boot/@$bootpath@ unless !defined $param{'initrd'};
-
-  my @newkernel;
-  push (@newkernel, "image=$param{'add-kernel'}\n", "\tlabel=$param{title}\n");
-  push (@newkernel, "\tappend=\"$param{args}\"\n") if defined $param{args};
-  push (@newkernel, "\tinitrd=$param{initrd}\n") if defined $param{initrd};
-  push (@newkernel, "\troot=$param{root}\n") if defined $param{root};
-  ##push (@newkernel, "\tread-only\n\n");
-
-  if (!defined $param{position} || $param{position} !~ /end|\d+/) {
-    $param{position}=0;
-  }
-
-  my @newconfig;
-  if ($param{position}=~/end/ || $param{position} >= $#sections) { 
-    $param{position}=$#sections;
-    push (@newconfig,@config);
-    if ($newconfig[$#newconfig] =~ /\S/) {
-      push (@newconfig, "\n");
-    }
-    push (@newconfig,@newkernel);
-  } else {
-    my $index=0;
-    foreach (@config) {
-      if ($_ =~ /^\s*(image|other)/i) { 
-        if ($index==$param{position}) {
-          push (@newconfig, @newkernel);
-        }
-        $index++;
-      }
-      push (@newconfig, $_);
-    }
-  }
-
-  @{$self->{config}} = @newconfig;
-
-  if (defined $param{'make-default'}) { 
-    $self->set_default($param{position});
-  } 
-}
-
-
-# Update kernel args
-
-sub update {
-  my $self=shift;
-  my %params=@_;
-
-  print ("Updating kernel.\n") if $self->debug()>1;
-
-  if (!defined $params{'update-kernel'} || (!defined $params{'args'} && !defined $params{'remove-args'})) {
-    warn "ERROR:  kernel position or title (--update-kernel) and args (--args or --remove-args) required.\n";
-    return undef;
-  }
-
-  return undef unless $self->_check_config();
-
-  my @config = @{$self->{config}};
-  my @sections=$self->_info();
-
-  # if not a number, do title lookup
-  if ($params{'update-kernel'} !~ /^\d+$/) {
-    $params{'update-kernel'} = $self->_lookup($params{'update-kernel'});
-  }
-
-  my $kcount = $#sections-1;
-  if ($params{'update-kernel'} !~ /^\d+$/ || $params{'update-kernel'} < 0 || $params{'update-kernel'} > $kcount) {
-    warn "ERROR:  Enter a default between 0 and $kcount.\n";
-    return undef;
-  }
-
-  my $index=-1;
-  foreach (@config) {
-    if ($_ =~ /^\s*(image|other)/i) {
-      $index++;
-    }
-    if ($index==$params{'update-kernel'}) {
-      if ($_ =~ /(^\s*append[\s\=]+)(.*)\n/i) {
-        my $append = $1;
-        my $args = $2;
-        $args =~ s/\"|\'//g;
-	$args = $self->_build_args($args, $params{'remove-args'}, $params{'args'});
-        if ($_ eq "$append\"$args\"\n") {
-          warn "WARNING:  No change made to args.\n";
-          return undef;
-        } else {
-          $_ = "$append\"$args\"\n";
-        }
-        next;
-      }
-    }
-  }
-  @{$self->{config}} = @config;
-}
-
-
-# Remove kernel from config
-
-sub remove {
-  my $self=shift;
-  my $position=shift;
-  my @newconfig;
-
-  return undef unless defined $position;
-  return undef unless $self->_check_config();
-
-  my @config=@{$self->{config}};
-  my @sections=$self->_info();
-
-  if ($position=~/^end$/i) {
-    $position=$#sections-1;
-  } elsif ($position=~/^start$/i) {
-    $position=0;
-  }
-
-  print ("Removing kernel $position.\n") if $self->debug()>1;
-
-  # remove based on title
-  if ($position !~ /^\d+$/) {
-    my $removed=0;
-    for (my $index=$#sections; $index > 0; $index--) {
-      if (defined $sections[$index]{title} && $position eq $sections[$index]{title}) {
-        $removed++ if $self->remove($index-1);
-      }
-    }
-    if (! $removed) {
-      warn "ERROR:  No kernel with specified title.\n";
-      return undef;
-    }
-
-  # remove based on position
-  } elsif ($position =~ /^\d+$/) {
-
-    if ($position < 0 || $position > $#sections) {
-      warn "ERROR:  Enter a position between 0 and $#sections.\n";
-      return undef;
-    }
-
-    my $index=-1;
-    foreach (@config) {
-      if ($_ =~ /^\s*(image|other|title)/i) {
-        $index++
-      }
-      # add everything to newconfig, except removed kernel (keep comments)
-      if ($index != $position || $_ =~ /^#/) {
-        push (@newconfig, $_)
-      }
-    }
-    @{$self->{config}} = @newconfig;
-
-
-    # if we removed the default, set new default to first
-    $self->set_default(0) if $position == $sections[0]{'default'};
-
-    print "Removed kernel $position.\n";
-    return 1;
-
-  } else {
-    warn "WARNING:  problem removing entered position.\n";
-    return undef;
-  }
-
-}
-
-
-# Print info from config
-
-sub print_info {
-  my $self=shift;
-  my $info=shift;
-
-  return undef unless defined $info; 
-  return undef unless $self->_check_config();
-
-  print ("Printing config info.\n") if $self->debug()>1;
-
-  my @config=@{$self->{config}};
-  my @sections=$self->_info();
-
-  my ($start,$end);
-  if ($info =~ /default/i) {
-    $start=$end=$self->get_default()
-  } elsif ($info =~ /all/i) {
-    $start=0; $end=$#sections-1
-  } elsif ($info =~ /^\d+/) {
-    $start=$end=$info
-  } else {
-    my $index = $self->_lookup($info);
-    if (!defined $index) {
-      warn "ERROR:  input should be: #, default, all, or a valid title.\n";
-      return undef;
-    }
-    $start=$end=$index;
-  }
-
-  if ($start < 0 || $end > $#sections-1) {
-    warn "ERROR:  No kernels with that index.\n";
-    return undef;
-  }
-
-  for my $index ($start..$end) {
-    print "\nindex\t: $index\n";
-    $index++;
-    foreach ( sort keys(%{$sections[$index]}) ) {
-      print "$_\t: $sections[$index]{$_}\n";
-    }
-  }
-}
-
-
-# Set/get debug level
-
-sub debug {
-  my $self=shift;
-  if (@_) {
-      $self->{debug} = shift;
-  }
-  return $self->{debug} || 0;
-}
-
-# Get a bootloader entry as a hash to edit or update.
-sub read_entry {
-  my $self=shift;
-  my $entry=shift;
-
-  if ($entry !~ /^\d+$/) {
-    $entry = $self->_lookup($entry);
-  }
-  my @sections=$self->_info();
-
-  my $index = $entry + 1;
-  if ((defined $sections[$index]{'title'})) {
-    $self->{'entry'}->{'index'} = $index;
-    foreach my $key ( keys %{$sections[$index]} ){
-      $self->{'entry'}->{'data'}->{ $key } = $sections[$index]{$key};
-    }
-    return $self->{'entry'}->{'data'};
-  } else {
-    return undef;
-  }
-}
-
-# Basic check for valid config
-
-sub _check_config {
-  my $self=shift;
-
-  print ("Verifying config.\n") if $self->debug()>3;
-
-  if ($#{$self->{config}} < 5) {
-    warn "ERROR:  you must read a valid config file first.\n";
-    return undef;
-  }
-  return 1;
-}
-
-
-# lookup position using title
-
-sub _lookup {
-  my $self=shift;
-  my $title=shift;
-  
-  unless ( defined $title ){ return undef; }
-
-  my @sections=$self->_info();
-
-  for my $index (1..$#sections) {
-    my $tmp = $sections[$index]{title};
-    if (defined $tmp and $title eq $tmp) {
-      return $index-1;
-    }
-  }
-  return undef;
-}
-
-sub _build_args {
-  my ($self, $args, $toremove, $toadd) = @_;
-
-  if (defined $toremove) {
-    my $base;
-    foreach my $remove (split(' ', $toremove)) {
-      $base = $remove; $base =~ s/\=.*//;
-      $args =~ s/(^|\s+)$base(\=\S+|\s+|$)/$1/ig;
-    }
-  }
-
-  if (defined $toadd) {
-    my $base;
-    foreach my $add (split(' ', $toadd)) {
-      $base = $add; $base =~ s/\=.*//;
-      if (!($args =~ s/(^|\s+)$base(\=\S+)?(\s+|$)/$1$add$3/ig)) {
-        $args .= " $add";
-      }
-    }
-  }
-
-  $args =~ s/\s+/ /g;
-  return $args;
-}
-
-
-=head1 AUTHOR
-
-Jason N., Open Source Development Labs, Engineering Department <eng@osdl.org>
-
-=head1 COPYRIGHT
-
-Copyright (C) 2006 Open Source Development Labs
-All Rights Reserved.
-
-This script is free software; you can redistribute it and/or modify it
-under the same terms as Perl itself.
-
-=head1 SEE ALSO
-
-L<boottool>, L<Linux::Bootloader::Grub>, L<Linux::Bootloader::Lilo>, 
-L<Linux::Bootloader::Elilo>, L<Linux::Bootloader::Yaboot>
-
-=cut
-
-
-1;
-package Linux::Bootloader::Detect;
-
-=head1 NAME
-
-Linux::Bootloader::Detect - detects the bootloader and architecture of the system.
-
-=head1 SYNOPSIS
-
-Attempts to determine the bootloader by checking for configuration files
-for grub, lilo, elilo and yaboot then searching the master boot record
-for GRUB, LILO, ELILO and YABOOT.
-
-Determines the architecture by running uname -m.
-
-=head1 DESCRIPTION
-
-To attempt to discover the bootloader being used by the system
-detect_bootloader first calls detect_bootloader_from_conf attempts to locate
-/boot/grub/menu.lst, /etc/lilo.conf, /boot/efi/elilo.conf and
-/etc/yaboot.conf and returns the corresponding bootloader name. If
-either undef of multiple are returned because no configuration files or
-multiple configuration files were found detect_bootloader calls
-detect_bootloader_from_mbr which generates a list of all devices accessable from
-the /dev directory reading in the first 512 bytes from each hd and sd
-device using head then redirects the output to grep to determine if
-"GRUB", "LILO", "ELILO" or "YABOOT" is present returning the
-corresponding value if exactly one mbr on the system contained a
-bootloader or multiple if more than one was found and undef if none were
-found. detect_bootloader returns either grub, lilo, elilo, yaboot or
-undef.
-
-To attempt to discover the architecture of the system
-detect_architecture makes a uname -m system call returning x86, ppc,
-ia64 or undef.
-
-=head1 FUNCTIONS
-
-=cut
-
-use strict;
-use warnings;
-
-use vars qw( $VERSION );
-
-=head3 detect_architecture([style])
-
-Input:
-Output: string
-
-This function determines the architecture by calling uname -m.  By
-default it will report back exactly what uname -m reports, but if you
-specify a "style", detect_architecture will do some mappings.  Possible
-styles include:
-
- Style    Example return values (not an exhaustive list...)
- [none]   i386, i686, sparc, sun4u, ppc64, s390x, x86_64, parisc64
- linux    i386, i386, sparc, sparc, ppc64, s390,  x86_64, parisc
- gentoo    x86,  x86, sparc, sparc, ppc64,         amd64, hppa
-
-Returns undef on error.
-
-=cut
-
-sub detect_architecture {
-    my $arch_style = shift || 'uname';
-
-    my $arch;
-    if ($arch_style eq 'linux') {
-        $arch = `uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/ -e s/s390x/s390/ -e s/parisc64/parisc/`;
-        chomp $arch;
-    } elsif ($arch_style eq 'gentoo') {
-        $arch = `uname -m | sed -e s/i.86/x86/ -e s/sun4u/sparc/ -e s/arm.*/arm/ -e s/sa110/arm/ -e s/x86_64/amd64/ -e s/sparc.*/sparc/ -e s/parisc.*/hppa/`;
-        chomp $arch;
-    } else {
-        $arch = `uname -m`;
-        chomp $arch;
-    }
-    return $arch;
-}
-
-=head3 detect_os_vendor()
-
-Input:
-Output: string
-
-This function determines the OS vendor (linux distribution breed).
-
-Return values: "Red Hat", "Fedora", "SUSE", "Ubuntu", "Debian", or
-"Unknown" if none of the predefined patterns could be found on the
-issue file.
-
-=cut
-
-sub detect_os_vendor {
-    my $vendor = "";
-    my $issue_file = '/etc/issue';
-    if ( not system("egrep 'Red Hat' $issue_file") ){
-       $vendor = 'Red Hat';
-    } elsif ( not system("egrep 'Fedora' $issue_file") ){
-       $vendor = 'Fedora';
-    } elsif ( not system("egrep 'SUSE' $issue_file") ){
-       $vendor = 'SUSE';
-    } elsif ( not system("egrep 'Ubuntu' $issue_file") ){
-       $vendor = 'Ubuntu';
-    } elsif ( not system("egrep 'Debian' $issue_file") ){
-       $vendor = 'Debian';
-    } else {
-       $vendor = 'Unknown';
-    }
-    return $vendor;
-}
-
-=head3 detect_bootloader(['device1', 'device2', ...])
-
-Input:  devices to detect against (optional)
-Output: string
-
-This function attempts to determine the bootloader being used on the
-system by first checking for conf files and then falling back to check
-the master boot record.
-
-Possible return values:     
-
-    grub        grub was determined to be the bootloader in use
-    lilo        lilo was determined to be is the bootloader in use
-    elilo       elilo was determined to be the bootloader in use
-    yaboot      yaboot was determined to be the bootloader in use
-    undef       it was impossible to determine which bootloader was being used
-                due either to configuration files for multiple bootloaders or
-                bootloader on multiple hard disks
-
-=cut
-
-sub detect_bootloader {
-    return detect_bootloader_from_conf(@_) 
-        || detect_bootloader_from_mbr(@_);
-}
-
-=head2 detect_bootloader_from_conf()
-
-Detects bootloaders by the presence of config files.  This is not as
-reliable of a mechanism as looking in the MBR, but tends to be
-significantly faster.  
-
-If called in list context, it will return a list of the bootloaders that
-it found.
-
-If called in scalar context and only a single bootloader config file is
-present it will return the name of that bootloader.  Otherwise, if
-multiple (or no) bootloaders are detected, it will return undef.
-
-=cut
-
-sub detect_bootloader_from_conf {
-    my @boot_loader = ();
-
-    my %boot_list = ( grub   => '/boot/grub/menu.lst', 
-                      lilo   => '/etc/lilo.conf', 
-                      elilo  => '/etc/elilo.conf', 
-                      yaboot => '/etc/yaboot.conf',
-                      zipl   => '/etc/zipl.conf',
-                      );
-
-    foreach my $key ( sort keys %boot_list ) {
-        if ( -f $boot_list{$key} ) {
-            push ( @boot_loader, $key ); 
-        }
-    }
-
-    if (wantarray()) {
-        return @boot_loader;
-    } elsif (@boot_loader == 1) {
-        return pop( @boot_loader );
-    } elsif (@boot_loader == 2) {
-	if ($boot_loader[0] eq 'lilo' && $boot_loader[1] eq 'yaboot') {
-		return 'lilo';
-	}
-    }
-
-    if (scalar(@boot_loader) > 1) {
-        warn "Warning: Multiple bootloader configs; not certain which is in use.\n";
-	warn "         " . join(' ', @boot_loader) . "\n";
-    }
-    return undef;
-}
-
-=head2 detect_bootloader_from_mbr([@devices])
-
-Detects the bootloader by scanning the master boot record (MBR) of the
-specified devices (or all devices if not indicated).  
-
-The device arguments must be relative to the /dev/ directory.  I.e.,
-('hda', 'sdb', 'cdroms/cdrom0', etc.)
-
-=cut
-
-sub detect_bootloader_from_mbr {
-    my @filelist = @_;
-    my @boot_loader = ();
-
-    my %map = (
-        "GRUB"   => 'grub',
-        "LILO"   => 'lilo',
-        "EFI"    => 'elilo',
-        "yaboot" => 'yaboot',
-    );
-
-    if ( ! @filelist && opendir( DIRH, "/sys/block" ) ) {
-        @filelist = grep { /^[sh]d.$/ } readdir(DIRH);
-        closedir(DIRH);
-    }
-
-    foreach my $dev ( @filelist ) {
-        if ( -b "/dev/$dev" ) {
-            my $strings = `dd if=/dev/$dev bs=512 count=1 2>/dev/null`;
-            if ($?) {
-                warn "Error:  Could not read MBR on /dev/$dev (are you root?)\n";
-            } else {
-                $strings = `echo $strings | strings`;
-                foreach my $loader (keys %map) {
-                    if ($strings =~ /$loader/ms) {
-                        push @boot_loader, $map{$loader};
-                    }
-                }
-            }
-        }
-    }
-
-    if (wantarray()) {
-        # Show them all
-        return @boot_loader;
-    } elsif (@boot_loader == 1) {
-        # Found exactly one
-        return pop @boot_loader;
-    } elsif (@boot_loader == 2) {
-        # This is the Lilo/Grub exception
-        # Grub on MBR with previous Lilo install
-        # Are they lilo and grub in that order?
-        if ($boot_loader[0] eq 'lilo' and $boot_loader[1] eq 'grub'){
-            warn "Warning:  Grub appears to be used currently, but Lilo was in past.\n";
-            return $boot_loader[1];
-        }
-    } else {
-        warn "Warning: Multiple MBR's present; not certain which is in use.\n";
-	warn "         " . join(' ', @boot_loader) . "\n";
-        return undef;
-    }
-
-    # Either none or too many to choose from
-    return undef;
-}
-
-1;
-
-=head1 AUTHOR
-
-Open Source Development Labs, Engineering Department <eng@osdl.org>
-
-=head1 COPYRIGHT
-
-Copyright (C) 2006 Open Source Development Labs
-All Rights Reserved.
-
-This script is free software; you can redistribute it and/or modify it
-under the same terms as Perl itself.
-
-=head1 SEE ALSO
-
-L<Linux::Bootloader>
-
-=cut
-
-package Linux::Bootloader::Elilo;
-
-=head1 NAME
-
-Linux::Bootloader::Elilo - Parse and modify ELILO configuration files.
-
-=head1 SYNOPSIS
-
-	
-	my $bootloader = Linux::Bootloader::Elilo->new();
-	my $config_file='/etc/elilo.conf';
-
-	$bootloader->read($config_file)
-
-	# add a kernel	
-	$bootloader->add(%hash)
-
-	# remove a kernel
-	$bootloader->remove(2)
-
-	# set new default
-	$bootloader->set_default(1)
-
-	$bootloader->write($config_file)
-
-
-=head1 DESCRIPTION
-
-This module provides functions for working with ELILO configuration files.
-
-	Adding a kernel:
-	- add kernel at start, end, or any index position.
-	- kernel path and title are required.
-	- root, kernel args, initrd are optional.
-	- any options not specified are copied from default.
-	- remove any conflicting kernels if force is specified.
-	
-	Removing a kernel:
-	- remove by index position
-	- or by title/label
-
-
-=head1 FUNCTIONS
-
-Also see L<Linux::Bootloader> for functions available from the base class.
-
-=head2 new()
-
-	Creates a new Linux::Bootloader::Elilo object.
-
-=head2 install()
-
-        Attempts to install bootloader.
-        Takes: nothing.
-        Returns: undef on error.
-
-=cut
-
-
-use strict;
-use warnings;
-
-@Linux::Bootloader::Elilo::ISA = qw(Linux::Bootloader);
-use base 'Linux::Bootloader';
-
-
-use vars qw( $VERSION );
-
-
-sub _set_config_file {
-    my $self=shift;
-    $self->{'config_file'}='/etc/elilo.conf';
-}
-
-
-### ELILO functions ###
-
-
-# Run command to install bootloader
-
-sub install {
-  my $self=shift;
-
-  my $elilo = '';
-  $elilo = '/sbin/elilo' if (-f '/sbin/elilo');
-  $elilo = '/usr/sbin/elilo' if (-f '/usr/sbin/elilo');
-  if ($elilo ne '') {
-      system($elilo);
-      if ($? != 0) { 
-	warn ("ERROR:  Failed to run elilo.\n") && return undef; 
-      }
-  }
-  return 1;
-}
-
-# Set kernel to be booted once
-
-sub boot_once {
-    my $self=shift;
-    my $label = shift;
-
-    return undef unless defined $label;
-
-    $self->read( '/etc/elilo.conf' );
-    my @config=@{$self->{config}};
-
-    if ( ! grep( /^checkalt/i, @config ) ) {
-        warn("ERROR:  Failed to set boot-once.\n");
-        warn("Please add 'checkalt' to global config.\n");
-        return undef;
-    }
-
-    my @sections = $self->_info();
-    my $position = $self->_lookup($label);
-    $position++;
-    my $efiroot = `grep ^EFIROOT /usr/sbin/elilo | cut -d '=' -f 2`;
-    chomp($efiroot);
-
-    my $kernel = $efiroot . $sections[$position]{kernel};
-    my $root = $sections[$position]{root};
-    my $args = $sections[$position]{args};
-
-    #system( "/usr/sbin/eliloalt", "-d" );
-    if ( system( "/usr/sbin/eliloalt", "-s", "$kernel root=$root $args" ) ) {
-        warn("ERROR:  Failed to set boot-once.\n");
-        warn("1) Check that EFI var support is compiled into kernel.\n");
-        warn("2) Verify eliloalt works.  You may need to patch it to support sysfs EFI vars.\n");
-        return undef;
-    }
-    return 1;
-}
-
-
-1;
-
-
-=head1 AUTHOR
-
-Open Source Development Labs, Engineering Department <eng@osdl.org>
-
-=head1 COPYRIGHT
-
-Copyright (C) 2006 Open Source Development Labs
-All Rights Reserved.
-
-This script is free software; you can redistribute it and/or modify it
-under the same terms as Perl itself.
-
-=head1 SEE ALSO
-
-L<Linux::Bootloader>
-
-=cut
-
-
-package Linux::Bootloader::Grub;
-
-=head1 NAME
-
-Linux::Bootloader::Grub - Parse and modify GRUB configuration files.
-
-=head1 SYNOPSIS
-
-
-        my $config_file='/boot/grub/menu.lst';
-	$bootloader = Linux::Bootloader::Grub->new($config_file);
-
-        $bootloader->read();
-
-	# add a kernel	
-	$bootloader->add(%hash)
-
-	# remove a kernel
-	$bootloader->remove(2)
-
-	# print config info
-	$bootloader->print_info('all')
-
-	# set new default
-	$bootloader->set_default(1)
-
-        $bootloader->write();
-
-
-=head1 DESCRIPTION
-
-This module provides functions for working with GRUB configuration files.
-
-	Adding a kernel:
-	- add kernel at start, end, or any index position.
-	- kernel path and title are required.
-	- root, kernel args, initrd, savedefault, module are optional.
-	- any options not specified are copied from default.
-	- remove any conflicting kernels first if force is specified.
-	
-	Removing a kernel:
-	- remove by index position
-	- or by title/label
-
-
-=head1 FUNCTIONS
-
-Also see L<Linux::Bootloader> for functions available from the base class.
-
-=head2 new()
-
-	Creates a new Linux::Bootloader::Grub object.
-
-=head2 _info()
-
-	Parse config into array of hashes.
-	Takes: nothing.
-	Returns: array of hashes containing config file options and boot entries,
-                 undef on error.
-
-=head2 set_default()
-
-	Set new default kernel.
-	Takes: integer or string, boot menu position or title.
-	Returns: undef on error.
-
-=head2 add()
-
-	Add new kernel to config.
-	Takes: hash containing kernel path, title, etc.
-	Returns: undef on error.
-
-=head2 update()
-
-        Update args of an existing kernel entry.
-        Takes: hash containing args and entry to update.
-        Returns: undef on error.
-
-=head2 install()
-
-        Prints message on how to re-install grub.
-        Takes: nothing.
-        Returns: nothing.
-
-=head2 update_main_options()
-
-	This updates or adds a general line anywhere before the first 'title' line.
-	it is called with the 'update' and 'option' options, when no 'update-kernel'
-	is specified.
-
-=head2 boot_once()
-
-	This is a special case of using 'fallback'.   This function makes the current 
-	default the fallback kernel and sets the passed argument to be the default 
-	kernel which saves to the fallback kernel after booting.  The file 
-	'/boot/grub/default' is created if it does not exist.
-
-	This only works with grub versions 0.97 or better.
-
-=head2 _get_bootloader_version()
-
-        Prints detected grub version.
-        Takes: nothing.
-        Returns: nothing.
-
-=cut
-
-use strict;
-use warnings;
-
-@Linux::Bootloader::Grub::ISA = qw(Linux::Bootloader);
-use base 'Linux::Bootloader';
-
-
-use vars qw( $VERSION );
-
-
-sub _set_config_file {
-    my $self=shift;
-    $self->{'config_file'}='/boot/grub/menu.lst';
-}
-
-
-### GRUB functions ###
-
-# Parse config into array of hashes
-
-sub _info {
-  my $self=shift;
-
-  return undef unless $self->_check_config();
-
-  my @config=@{$self->{config}};
-  @config=grep(!/^#|^\n/, @config);
-
-  my %matches = ( default => '^\s*default\s*\=*\s*(\S+)',
-		  timeout => '^\s*timeout\s*\=*\s*(\S+)',
-		  fallback => '^\s*fallback\s*\=*\s*(\S+)',
-		  kernel => '^\s*kernel\s+(\S+)',
-		  root 	=> '^\s*kernel\s+.*\s+.*root=(\S+)',
-		  args 	=> '^\s*kernel\s+\S+\s+(.*)\n',
-		  boot 	=> '^\s*root\s+(.*)',
-		  initrd => '^\s*initrd\s+(.*)',
-		  savedefault => '^\s*savedefault\s+(.*)',
-		  module      => '^\s*module\s+(.+)',
-		);
-
-  my @sections;
-  my $index=0;
-  foreach (@config) {
-      if ($_ =~ /^\s*title\s+(.*)/i) {
-        $index++;
-        $sections[$index]{title} = $1;
-      }
-      foreach my $key (keys %matches) {
-        if ($_ =~ /$matches{$key}/i) {
-          $key .= '2' if exists $sections[$index]{$key};
-          $sections[$index]{$key} = $1;
-          if ($key eq 'args') {
-	    $sections[$index]{$key} =~ s/root=\S+\s*//i;
-	    delete $sections[$index]{$key} if ($sections[$index]{$key} !~ /\S/);
-          }
-        }
-      }
-  }
-
-  # sometimes config doesn't have a default, so goes to first
-  if (!(defined $sections[0]{'default'})) { 
-    $sections[0]{'default'} = '0'; 
-
-  # if default is 'saved', read from grub default file
-  } elsif ($sections[0]{'default'} =~ m/^saved$/i) {
-    open(DEFAULT_FILE, '/boot/grub/default')
-      || warn ("ERROR:  cannot read grub default file.\n") && return undef;
-    my @default_config = <DEFAULT_FILE>;
-    close(DEFAULT_FILE);
-    $default_config[0] =~ /^(\d+)/;
-    $sections[0]{'default'} = $1;
-  }
-
-  # return array of hashes
-  return @sections;
-}
-
-
-# Set new default kernel
-
-sub set_default {
-  my $self=shift;
-  my $newdefault=shift;
-
-  return undef unless defined $newdefault;
-  return undef unless $self->_check_config();
-
-  my @config=@{$self->{config}};
-  my @sections=$self->_info();
-
-  # if not a number, do title lookup
-  if ($newdefault !~ /^\d+$/ && $newdefault !~ m/^saved$/) {
-    $newdefault = $self->_lookup($newdefault);
-    return undef unless (defined $newdefault);
-  }
-
-  my $kcount = $#sections-1;
-  if ($newdefault !~ m/saved/) {
-    if (($newdefault < 0) || ($newdefault > $kcount)) {
-      warn "ERROR:  Enter a default between 0 and $kcount.\n";
-      return undef;
-    }
-  }
-
-  foreach my $index (0..$#config) {
-
-    if ($config[$index] =~ /(^\s*default\s*\=*\s*)\d+/i) { 
-      $config[$index] = "$1$newdefault\n";
-      last;
-    } elsif ($config[$index] =~ /^\s*default\s*\=*\s*saved/i) {
-      my @default_config;
-      my $default_config_file='/boot/grub/default';
-
-      open(DEFAULT_FILE, $default_config_file) 
-        || warn ("ERROR:  cannot open default file.\n") && return undef;
-      @default_config = <DEFAULT_FILE>;
-      close(DEFAULT_FILE);
-
-      if ($newdefault eq 'saved') {
-          warn "WARNING:  Setting new default to '0'\n";
-          $newdefault = 0;
-      }
-
-      $default_config[0] = "$newdefault\n";
-
-      open(DEFAULT_FILE, ">$default_config_file") 
-        || warn ("ERROR:  cannot open default file.\n") && return undef;
-      print DEFAULT_FILE join("",@default_config);
-      close(DEFAULT_FILE);
-      last;
-    }
-  }
-  @{$self->{config}} = @config;
-}
-
-
-# Add new kernel to config
-
-sub add {
-  my $self=shift;
-  my %param=@_;
-
-  print ("Adding kernel.\n") if $self->debug()>1;
-
-  if (!defined $param{'add-kernel'} || !defined $param{'title'}) { 
-    warn "ERROR:  kernel path (--add-kernel), title (--title) required.\n";
-    return undef; 
-  } elsif (!(-f "$param{'add-kernel'}")) { 
-    warn "ERROR:  kernel $param{'add-kernel'} not found!\n";
-    return undef; 
-  } elsif (defined $param{'initrd'} && !(-f "$param{'initrd'}")) { 
-    warn "ERROR:  initrd $param{'initrd'} not found!\n";
-    return undef; 
-  }
-
-  return undef unless $self->_check_config();
-
-  my @sections=$self->_info();
-
-  # check if title already exists
-  if (defined $self->_lookup($param{title})) {
-    warn ("WARNING:  Title already exists.\n");
-    if (defined $param{force}) {
-      $self->remove($param{title});
-    } else {
-      return undef;
-    }
-  }
-
-  my @config = @{$self->{config}};
-  @sections=$self->_info();
-
-  # Use default kernel to fill in missing info
-  my $default=$self->get_template();
-  $default++;
-
-  foreach my $p ('args', 'root', 'boot', 'savedefault') {
-    if (! defined $param{$p}) {
-      $param{$p} = $sections[$default]{$p};
-    }
-  }
-
-  # use default entry to determine if path (/boot) should be removed
-  my $bootpath = $sections[$default]{'kernel'};
-  $bootpath =~ s@[^/]*$@@;
-
-  $param{'add-kernel'} =~ s@^/boot/@$bootpath@;
-  $param{'initrd'} =~ s@^/boot/@$bootpath@ unless !defined $param{'initrd'};
-
-  my @newkernel;
-  push(@newkernel, "title\t$param{title}\n") if defined $param{title};
-  push(@newkernel, "\troot $param{boot}\n") if defined $param{boot};
-
-  my $line;
-  if ( defined $param{xen} ) {
-      $line = "\tkernel $sections[$default]{kernel}";
-      $line .= " $sections[$default]{root}" if defined $sections[$default]{root};
-      $line .= " $sections[$default]{args}" if defined $sections[$default]{args};
-      push( @newkernel, "$line\n" );
-      push( @newkernel, "\tinitrd $sections[$default]{'initrd'}\n" ) if defined $sections[$default]{'initrd'};
-      $line = "\tmodule $param{'add-kernel'}" if defined $param{'add-kernel'};
-      $line .= " root=$param{root}"    if defined $param{root};
-      $line .= " $param{args}"         if defined $param{args};
-      push( @newkernel, "$line\n" );
-      push( @newkernel, "\tmodule $param{initrd}\n" ) if defined $param{initrd};
-  } else {
-      $line = "\tkernel $param{'add-kernel'}" if defined $param{'add-kernel'};
-      $line .= " root=$param{root}"    if defined $param{root};
-      $line .= " $param{args}"         if defined $param{args};
-      push( @newkernel, "$line\n" );
-      push( @newkernel, "\tinitrd $param{initrd}\n" ) if defined $param{initrd};
-  }
-
-  push(@newkernel, "\tsavedefault $param{savedefault}\n") if defined $param{savedefault};
-
-  foreach my $module (@{$param{'module'}}) {
-     push(@newkernel, "\tmodule " . $module . "\n");
-  }
-
-  push(@newkernel, "\n");
-
-  if (!defined $param{position} || $param{position} !~ /end|\d+/) { 
-    $param{position}=0 
-  }
-
-  my @newconfig;
-  if ($param{position}=~/end/ || $param{position} >= $#sections) { 
-    $param{position}=$#sections;
-    push (@newconfig,@config);
-    if ($newconfig[$#newconfig] =~ /\S/) { 
-      push (@newconfig, "\n"); 
-    }
-    push (@newconfig,@newkernel);
-  } else {
-    my $index=0;
-    foreach (@config) {
-      if ($_ =~ /^\s*title/i) { 
-        if ($index==$param{position}) { 
-          push (@newconfig, @newkernel); 
-        }
-        $index++;
-      }
-      push (@newconfig, $_);
-    }
-  }
-
-  @{$self->{config}} = @newconfig;
-
-  if (defined $param{'make-default'} || defined $param{'boot-once'}) { 
-    $self->set_default($param{position});
-  }
-  print "Added: $param{'title'}.\n";
-}
-
-
-# Update kernel args
-
-sub update {
-  my $self=shift;
-  my %params=@_;
-
-  print ("Updating kernel.\n") if $self->debug()>1;
-
-  if (defined $params{'option'} && !defined $params{'update-kernel'}) {
-    return $self->update_main_options(%params);
-  } elsif (!defined $params{'update-kernel'} || (!defined $params{'args'} && !defined $params{'remove-args'} && !defined $params{'option'})) { 
-    warn "ERROR:  kernel position or title (--update-kernel) and args (--args or --remove-args) required.\n";
-    return undef; 
-  }
-
-  return undef unless $self->_check_config();
-
-#  my @config = @{$self->{config}};
-  my @sections=$self->_info();
-
-  # if not a number, do title lookup
-  if (defined $params{'update-kernel'} and $params{'update-kernel'} !~ /^\d+$/) {
-    $params{'update-kernel'} = $self->_lookup($params{'update-kernel'});
-  }
-
-  my $kcount = $#sections-1;
-  if ($params{'update-kernel'} !~ /^\d+$/ || $params{'update-kernel'} < 0 || $params{'update-kernel'} > $kcount) {
-    warn "ERROR:  Enter a default between 0 and $kcount.\n";
-    return undef;
-  }
-
-  my $kregex = '(^\s*kernel\s+\S+)(.*)';
-  $kregex = '(^\s*module\s+\S+vmlinuz\S+)(.*)' if defined $params{'xen'};
-
-  my $index=-1;
-  my $config_line = -1;
-  my $line = '';
-  foreach $line (@{$self->{config}}) {
-    $config_line = $config_line + 1;
-    if ($line =~ /^\s*title/i) {
-      $index++;
-    }
-    if ($index==$params{'update-kernel'}) {
-      if (defined $params{'args'} or defined $params{'remove-args'}){
-        if ( $line =~ /$kregex/i ) {
-          my $kernel = $1;
-          my $args = $self->_build_args($2, $params{'remove-args'}, $params{'args'});
-          if ($line eq $kernel . $args . "\n") {
-            warn "WARNING:  No change made to args.\n";
-            return undef;
-          } else {
-            $line = $kernel . $args . "\n";
-          }
-          next;
-        }
-      } elsif (defined $params{'option'}){
-        foreach my $val ( keys %params){
-          if ($line =~ m/^\s*$val.*/i) {
-            splice @{$self->{config}},$config_line,1,"$val $params{$val}\n";
-            delete $params{$val};
-            $config_line += 1;
-          }
-        }
-      }
-    } elsif ($index > $params{'update-kernel'}){
-      last;
-    }
-  }
-  # Add any leftover parameters
-  delete $params{'update-kernel'};
-  if (defined $params{'option'}){
-    delete $params{'option'};
-    $config_line -= 1;
-    foreach my $val ( keys %params){
-      splice @{$self->{config}},$config_line,0,"$val $params{$val}\n";
-      $config_line += 1;
-    }
-  }
-}
-
-
-# Run command to install bootloader
-
-sub install {
-  my $self=shift;
-  my $device;
-
-  warn "Re-installing grub is currently unsupported.\n";
-  warn "If you really need to re-install grub, use 'grub-install <device>'.\n";
-  return undef;
-
-  #system("grub-install $device");
-  #if ($? != 0) {
-  #  warn ("ERROR:  Failed to run grub-install.\n") && return undef;
-  #}
-  #return 1;
-}
-
-
-sub update_main_options{
-  my $self=shift;
-  my %params=@_;
-  delete $params{'option'};
-  foreach my $val (keys %params){
-    my $x=0;
-    foreach my $line ( @{$self->{config}} ) {
-      # Replace 
-      if ($line =~ m/^\s*$val/) {
-	splice (@{$self->{config}},$x,1,"$val $params{$val}\n");
-        last;
-      }
-      # Add
-      if ($line =~ /^\s*title/i) {
-        #  This is a new option, add it before here
-        print "Your option is not in current configuration.  Adding.\n";
-	splice @{$self->{config}},$x,0,"$val $params{$val}\n";
-        last;
-      }
-      $x+=1;
-    }
-  }
-}
-
-
-sub boot_once {
-  my $self=shift;
-  my $entry_to_boot_once = shift;
-  my $detected_os_vendor = Linux::Bootloader::Detect::detect_os_vendor();
-
-  unless ( $entry_to_boot_once ) { print "No kernel\n"; return undef;}
-  $self->read();
-  my $default=$self->get_default();
-
-  if ( $self->_get_bootloader_version() < 0.97 ){
-     warn "This function works for grub version 0.97 and up.  No action taken.  \nUpgrade, then re-try.\n";
-     return undef;
-  }
-
-  if ( $detected_os_vendor eq "Red Hat" or $detected_os_vendor eq "Fedora" ) {
-    # if not a number, do title lookup
-    if ( $entry_to_boot_once !~ /^\d+$/ ) {
-      $entry_to_boot_once = $self->_lookup($entry_to_boot_once);
-      return undef unless ( defined $entry_to_boot_once );
-    }
-
-    return `echo "savedefault --default=$entry_to_boot_once" --once | grub --batch`;
-  } else {
-  if ( $default == $self->_lookup($entry_to_boot_once)){
-     warn "The default and once-boot kernels are the same.  No action taken.  \nSet default to something else, then re-try.\n";
-     return undef;
-  }
-
-  $self->set_default('saved');
-  if ( ! -f '/boot/grub/default' ){
-     open FH, '>/boot/grub/default'; 
-     my $file_contents="default
-#
-#
-#
-#
-#
-#
-#
-#
-#
-#
-# WARNING: If you want to edit this file directly, do not remove any line
-# from this file, including this warning. Using `grub-set-default\' is
-# strongly recommended.
-";
-    print FH $file_contents;
-    close FH;
-  }
-  $self->set_default( "$entry_to_boot_once" );
-  $self->update( 'option'=>'','fallback' => $default );
-  $self->update( 'update-kernel'=>"$entry_to_boot_once",'option'=>'','savedefault' => 'fallback' );
-  $self->update( 'update-kernel'=>"$default",'option'=>'', 'savedefault' => '' );
-  $self->write();
-  }
-}
-
-sub _get_bootloader_version {
-  my $self = shift;
-  return `grub --version | sed 's/grub (GNU GRUB //' | sed 's/)//'`;
-}
-
-
-1;
-
-
-=head1 AUTHOR
-
-Open Source Development Labs, Engineering Department <eng@osdl.org>
-
-=head1 COPYRIGHT
-
-Copyright (C) 2006 Open Source Development Labs
-All Rights Reserved.
-
-This script is free software; you can redistribute it and/or modify it
-under the same terms as Perl itself.
-
-=head1 SEE ALSO
-
-L<Linux::Bootloader>
-
-=cut
-
-package Linux::Bootloader::Lilo;
-
-=head1 NAME
-
-Linux::Bootloader::Lilo - Parse and modify LILO configuration files.
-
-=head1 SYNOPSIS
-
-	
-	my $bootloader = Linux::Bootloader::Lilo->new();
-	my $config_file='/etc/lilo.conf';
-
-	$bootloader->read($config_file)
-
-	# add a kernel	
-	$bootloader->add(%hash)
-
-	# remove a kernel
-	$bootloader->remove(2)
-
-	# set new default
-	$bootloader->set_default(1)
-
-	$bootloader->write($config_file)
-
-
-=head1 DESCRIPTION
-
-This module provides functions for working with LILO configuration files.
-
-	Adding a kernel:
-	- add kernel at start, end, or any index position.
-	- kernel path and title are required.
-	- root, kernel args, initrd are optional.
-	- any options not specified are copied from default.
-	- remove any conflicting kernels if force is specified.
-	
-	Removing a kernel:
-	- remove by index position
-	- or by title/label
-
-
-=head1 FUNCTIONS
-
-Also see L<Linux::Bootloader> for functions available from the base class.
-
-=head2 new()
-
-	Creates a new Linux::Bootloader::Lilo object.
-
-=head2 install()
-
-        Attempts to install bootloader.
-        Takes: nothing.
-        Returns: undef on error.
-
-=head2 boot-once()
-
-        Attempts to set a kernel as default for one boot only.
-        Takes: string.
-        Returns: undef on error.
-
-=cut
-
-
-use strict;
-use warnings;
-
-@Linux::Bootloader::Lilo::ISA = qw(Linux::Bootloader);
-use base 'Linux::Bootloader';
-
-
-use vars qw( $VERSION );
-
-
-sub _set_config_file {
-    my $self=shift;
-    $self->{'config_file'}='/etc/lilo.conf';
-}
-
-
-
-### LILO functions ###
-
-
-# Run command to install bootloader
-
-sub install {
-  my $self=shift;
-
-  system("/sbin/lilo");
-  if ($? != 0) { 
-    warn ("ERROR:  Failed to run lilo.\n") && return undef; 
-  }
-  return 1;
-}
-
-
-# Set kernel to be booted once
-
-sub boot_once {
-  my $self=shift;
-  my $label=shift;
-
-  return undef unless defined $label;
-  
-  if (system("/sbin/lilo","-R","$label")) {
-    warn ("ERROR:  Failed to set boot-once.\n") && return undef; 
-  }
-  return 1;
-}
-
-
-1;
-
-
-=head1 AUTHOR
-
-Open Source Development Labs, Engineering Department <eng@osdl.org>
-
-=head1 COPYRIGHT
-
-Copyright (C) 2006 Open Source Development Labs
-All Rights Reserved.
-
-This script is free software; you can redistribute it and/or modify it
-under the same terms as Perl itself.
-
-=head1 SEE ALSO
-
-L<Linux::Bootloader>
-
-=cut
-
-package Linux::Bootloader::Yaboot;
-
-=head1 NAME
-
-Linux::Bootloader::Yaboot - Parse and modify YABOOT configuration files.
-
-=head1 SYNOPSIS
-
-	
-	my $bootloader = Linux::Bootloader::Yaboot->new();
-	my $config_file='/etc/yaboot.conf';
-
-	$bootloader->read($config_file)
-
-	# add a kernel	
-	$bootloader->add(%hash)
-
-	# remove a kernel
-	$bootloader->remove(2)
-
-	# set new default
-	$bootloader->set_default(1)
-
-	$bootloader->write($config_file)
-
-
-=head1 DESCRIPTION
-
-This module provides functions for working with YABOOT configuration files.
-
-	Adding a kernel:
-	- add kernel at start, end, or any index position.
-	- kernel path and title are required.
-	- root, kernel args, initrd are optional.
-	- any options not specified are copied from default.
-	- remove any conflicting kernels if force is specified.
-	
-	Removing a kernel:
-	- remove by index position
-	- or by title/label
-
-
-=head1 FUNCTIONS
-
-Also see L<Linux::Bootloader> for functions available from the base class.
-
-=head2 new()
-
-	Creates a new Linux::Bootloader::Yaboot object.
-
-=head2 install()
-
-        Attempts to install bootloader.
-        Takes: nothing.
-        Returns: undef on error.
-
-=cut
-
-
-use strict;
-use warnings;
-
-@Linux::Bootloader::Yaboot::ISA = qw(Linux::Bootloader);
-use base 'Linux::Bootloader';
-
-
-use vars qw( $VERSION );
-
-
-sub _set_config_file {
-    my $self=shift;
-    $self->{'config_file'}='/etc/yaboot.conf';
-}
-
-### YABOOT functions ###
-
-
-# Run command to install bootloader
-
-sub install {
-	my $self=shift;
-	my $cmd="";
-	# ybin currently returns an error even when it succeeds, but by
-	# dumb luck ybin -v does the right thing
-	if (-f "/usr/sbin/ybin") {
-		$cmd="/usr/sbin/ybin -v > /dev/null";
-	} elsif (-f "/sbin/ybin") {
-		$cmd="/sbin/ybin -v > /dev/null";
-	} else {
-		print("Not installing bootloader.\n");
-	}
-
-	system($cmd);
-	if ( $? != 0 ) {
-		warn("ERROR:  Failed to run ybin.\n") && return undef;
-	}
-	return 1;
-}
-
-
-1;
-
-
-=head1 AUTHOR
-
-IBM, Linux Technology Centre, Andy Whitcroft <apw@uk.ibm.com>
-
-=head1 COPYRIGHT
-
-Copyright (C) 2006 IBM Corperation
-All Rights Reserved.
-
-This script is free software; you can redistribute it and/or modify it
-under the same terms as Perl itself.
-
-=head1 SEE ALSO
-
-L<Linux::Bootloader>
-
-=cut
-
-package Linux::Bootloader::Zipl;
-
-=head1 NAME
-
-Linux::Bootloader::Zipl - Parse and modify ZIPL configuration files.
-
-=cut
-
-use strict;
-use warnings;
-
-@Linux::Bootloader::Zipl::ISA = qw(Linux::Bootloader);
-use base 'Linux::Bootloader';
-
-
-use vars qw( $VERSION );
-
-
-sub _set_config_file {
-    my $self=shift;
-    $self->{'config_file'}='/etc/zipl.conf';
-}
-
-
-### ZIPL functions ###
-
-# Parse config into array of hashes
-sub _info {
-  my $self=shift;
-
-  return undef unless $self->_check_config();
-
-  my @config=@{$self->{config}};
-  @config=grep(!/^#|^\s*$/, @config);
-
-  my %matches = (
-		  target => '^\s*target\s*=\s*(.*)',
-		  kernel => '^\s*image\s*=\s*(\S+)',
-		  initrd => '^\s*ramdisk\s*=\s*(.*)',
-		  args => '^\s*parameters\s*=\s*"?\s*(.*[^"])"?',
-		);
-
-  my %sect_title;
-  my $menu_name;
-  my $title;
-  my @sections;
-  foreach (@config) {
-    chomp($_);
-
-    # Note the menu and switch mode.
-    if ($_ =~ /^:(menu\S*)/) {
-      $menu_name = $1;
-
-    # An entry starts [name]
-    } elsif ($_ =~ /^\s*\[(\S+)\]/i) {
-      $title = $1;
-      $sect_title{$title}{title} = $title;
-    }
-
-    # Decode the entry fields
-    if (!defined $menu_name) {
-      foreach my $key (keys %matches) {
-	if ($_ =~ /$matches{$key}/i) {
-	  $key .= '2' if exists $sect_title{$title}{$key};
-	  $sect_title{$title}{$key} = $1;
-	}
-      }
-
-    # This is the menu, pull it in
-    } else {
-        # If this is an entry specified copy entry in to the result.
-	if ($_ =~ /^\s+(\d+)\s*=\s*(\S*)/) {
-	  $sections[$1] = $sect_title{$2};
-
-	# record all the other attributes here, pick out the default
-	# if we see it.
-	} else {
-	  if ($_ =~ /^\s+(\S+)\s*=\s*(.*\S)\s*/) {
-	    $sections[0]{$1} = $2;
-	  }
-	}
-     }
-  }
-  $sections[0]{'menu'} = $menu_name;
-  if (defined $sections[0]{'default'}) {
-    $sections[0]{'default'}--;
-  }
-
-  # sometimes config doesn't have a default, so goes to first
-  if (!(defined $sections[0]{'default'})) {
-    $sections[0]{'default'} = '0';
-
-  # if default is label name, we need position
-  } elsif ($sections[0]{'default'} !~ m/^\d+$/) {
-    foreach my $index (1..$#sections) {
-      if ($sections[$index]{'title'} eq $sections[0]{'default'}) {
-        $sections[0]{'default'} = $index-1;
-        last;
-      }
-    }
-    $sections[0]{'default'} = 0 if (!defined $sections[0]{'default'});
-  }
-
-  # return array of hashes
-  return @sections;
-}
-
-# Set new default kernel
-
-sub set_default {
-  my $self=shift;
-  my $newdefault=shift;
-
-  return undef unless defined $newdefault;
-  return undef unless $self->_check_config();
-
-  my @config=@{$self->{config}};
-  my @sections=$self->_info();
-
-  # if not a number, do title lookup
-  if ($newdefault !~ /^\d+$/) {
-    $newdefault = $self->_lookup($newdefault);
-    return undef unless (defined $newdefault);
-  }
-
-  my $kcount = $#sections-1;
-  if (($newdefault < 0) || ($newdefault > $kcount)) {
-    warn "ERROR: Enter a default between 0 and $kcount.\n";
-    return undef;
-  }
-
-  # Look up the actual title of this section.
-  my $title = $sections[$newdefault + 1]{'title'};
-
-  # Look through the config file for the specifier,
-  # note there are two, one the name and one the number
-  # go figure.  Note that ZIPL numbering is 1..N.
-  foreach my $index (0..$#config) {
-    if ($config[$index] =~ /(^\s*default\s*\=*\s*)\d+\s*$/i) {
-      $config[$index] = $1 . ($newdefault + 1) . "\n";
-
-    } elsif ($config[$index] =~ /(^\s*default\s*\=*\s*)/i) {
-      $config[$index] = "$1$title\n";
-    }
-  }
-  @{$self->{config}} = @config;
-}
-
-
-# Add new kernel to config
-sub add {
-  my $self=shift;
-  my %param=@_;
-
-  print ("Adding kernel.\n") if $self->debug()>1;
-
-  if (!defined $param{'add-kernel'} || !defined $param{'title'}) {
-    warn "ERROR:  kernel path (--add-kernel), title (--title) required.\n";
-    return undef;
-  } elsif (!(-f "$param{'add-kernel'}")) {
-    warn "ERROR:  kernel $param{'add-kernel'} not found!\n";
-    return undef;
-  } elsif (defined $param{'initrd'} && !(-f "$param{'initrd'}")) {
-    warn "ERROR:  initrd $param{'initrd'} not found!\n";
-    return undef;
-  }
-
-  return undef unless $self->_check_config();
-
-  my @sections=$self->_info();
-
-  # check if title already exists
-  if (defined $self->_lookup($param{title})) {
-    warn ("WARNING:  Title already exists.\n");
-    if (defined $param{force}) {
-      $self->remove($param{title});
-    } else {
-      return undef;
-    }
-  }
-
-  my @config = @{$self->{config}};
-  @sections=$self->_info();
-
-  # Use default kernel to fill in missing info
-  my $default=$self->get_template();
-  $default++;
-
-  foreach my $p ('args', 'target') {
-    if (! defined $param{$p}) {
-      $param{$p} = $sections[$default]{$p};
-    }
-  }
-
-  # use default entry to determine if path (/boot) should be removed
-  my $bootpath = $sections[$default]{'kernel'};
-  $bootpath =~ s@[^/]*$@@;
-
-  $param{'add-kernel'} =~ s@^/boot/@$bootpath@;
-  $param{'initrd'} =~ s@^/boot/@$bootpath@ unless !defined $param{'initrd'};
-
-  my $line;
-  my @newkernel;
-  push(@newkernel, "[$param{'title'}]\n");
-  push(@newkernel, "\ttarget=$param{'target'}\n") if (defined $param{'target'});
-  push(@newkernel, "\timage=$param{'add-kernel'}\n");
-  push(@newkernel, "\tramdisk=$param{'initrd'}\n") if (defined $param{'initrd'});
-  $line = '';
-  $line .= "root=$param{root} " if (defined $param{'root'});
-  $line .= "$param{args} " if (defined $param{'args'});
-  chop($line);
-  push(@newkernel, "\tparameters=\"$line\"\n");
-
-  push(@newkernel, "\n");
-
-  if (!defined $param{position} || $param{position} !~ /end|\d+/) {
-    $param{position} = 0;
-  }
-
-  my @newconfig;
-  my $index=0;
-  my $menu=0;
-  my @list;
-  foreach (@config) {
-    if ($_ !~ /^\s*\[defaultboot]/i && $_ =~ /^\s*\[(\S+)]/i) {
-      if ($param{'position'} ne 'end' && $index == $param{position}) {
-	push(@newconfig, @newkernel);
-        push(@list, $param{'title'});
-      }
-      $index++;
-      push(@list, $1);
-
-    } elsif (/^:menu\S*/) {
-      if ($param{'position'} eq 'end' || $index < $param{'position'}) {
-	push(@newconfig, @newkernel);
-        push(@list, $param{'title'});
-	$param{position} = $index;
-      }
-      # Rebuild the menu entries.
-      push(@newconfig, $_);
-      for (my $n = 0; $n <= $#list; $n++) {
-        push(@newconfig, "\t" . ($n+1) . "=$list[$n]\n");
-      }
-      $menu = 1;
-      next;
-    }
-    if ($menu) {
-      if (/^\s+\d+=/) {
-	next;
-      } else {
-	$menu = 0;
-      }
-    }
-    push(@newconfig, $_);
-  }
-
-  @{$self->{config}} = @newconfig;
-
-  if (defined $param{'make-default'} || defined $param{'boot-once'}) {
-    $self->set_default($param{position});
-  }
-  print "Added: $param{'title'}.\n";
-}
-
-
-# Remove a kernel from config
-sub remove {
-  my $self=shift;
-  my $position=shift;
-
-  return undef unless defined $position;
-  return undef unless $self->_check_config();
-
-  my @config=@{$self->{config}};
-  my @sections=$self->_info();
-  my $default = $self->get_default();
-
-  if ($position=~/^end$/i) {
-    $position=$#sections-1;
-  } elsif ($position=~/^start$/i) {
-    $position=0;
-  }
-
-  print ("Removing kernel $position.\n") if $self->debug()>1;
-
-  # if not a number, do title lookup
-  if ($position !~ /^\d+$/) {
-    $position = $self->_lookup($position);
-  }
-  if ($position !~ /^\d+$/) {
-    warn "ERROR: $position: should be # or title\n";
-    return undef;
-  }
-
-  my $title = $sections[$position + 1]{'title'};
-
-  my $keep = 1;
-  my @newconfig;
-  my @list;
-  my $index = 0;
-  my $menu;
-  foreach (@config) {
-    if ($_ !~ /^\s*\[defaultboot]/i && $_ =~ /^\s*\[(\S+)]/i) {
-      if ($index == $position) {
-        $keep = 0;
-      } else {
-        push(@list, $1);
-	$keep = 1;
-      }
-      $index++;
-
-    } elsif (/^:menu\S*/) {
-      # Rebuild the menu entries.
-      push(@newconfig, $_);
-      for (my $n = 0; $n <= $#list; $n++) {
-        push(@newconfig, "\t" . ($n+1) . "=$list[$n]\n");
-      }
-      $menu = 1;
-      $keep = 1;
-      next;
-    }
-    if ($menu) {
-      if (/^\s+\d+=/) {
-	next;
-      } else {
-	$menu = 0;
-      }
-    }
-    push(@newconfig, $_) if ($keep);
-  }
-
-  @{$self->{config}} = @newconfig;
-
-  # Update the default.
-  my $new = $default;
-  if ($default == $position) {
-    $new = 0;
-  } elsif ($default > $position) {
-    $new = $default - 1;
-  }
-  if ($default != $new) {
-    $self->set_default($new);
-  }
-
-  print "Removed: $title\n";
-}
-
-
-# Update kernel args
-sub update {
-  my $self=shift;
-  my %params=@_;
-
-  print ("Updating kernel.\n") if $self->debug()>1;
-
-  if (defined $params{'option'} && !defined $params{'update-kernel'}) {
-    return $self->update_main_options(%params);
-  } elsif (!defined $params{'update-kernel'} || (!defined $params{'args'} && !defined $params{'remove-args'} && !defined $params{'option'})) {
-    warn "ERROR:  kernel position or title (--update-kernel) and args (--args or --remove-args) required.\n";
-    return undef;
-  }
-
-  return undef unless $self->_check_config();
-
-#  my @config = @{$self->{config}};
-  my @sections=$self->_info();
-
-  # if not a number, do title lookup
-  if (defined $params{'update-kernel'} and $params{'update-kernel'} !~ /^\d+$/) {
-    $params{'update-kernel'} = $self->_lookup($params{'update-kernel'});
-  }
-
-  my $kcount = $#sections-1;
-  if ($params{'update-kernel'} !~ /^\d+$/ || $params{'update-kernel'} < 0 || $params{'update-kernel'} > $kcount) {
-    warn "ERROR: Enter a default between 0 and $kcount.\n";
-    return undef;
-  }
-
-  # Convert to a title to find the relevant section.
-  my $title = $sections[$params{'update-kernel'} + 1]{'title'};
-
-  my $seen = '';
-  my $config_line = -1;
-  my $line = '';
-  foreach $line (@{$self->{config}}) {
-    $config_line = $config_line + 1;
-    if ($line =~ /^\s*\[(\S+)]/i) {
-      $seen = $1;
-    }
-    if ($title eq $seen) {
-      if (defined $params{'args'} or defined $params{'remove-args'}){
-        if ($line =~ /^\s*parameters="(.*[^"])"/i) {
-	  my $oargs = $1;
-	  my $args = $self->_build_args($oargs, $params{'remove-args'}, $params{'args'});
-          if ($args eq $oargs) {
-            warn "WARNING:  No change made to args.\n";
-            return undef;
-          }
-	  # Note that updating line updates the _real_ lines in @config.
-	  $line = "\tparameters=\"$args\"\n";
-          next;
-        }
-      } elsif (defined $params{'option'}){
-        foreach my $val ( keys %params){
-          if ($line =~ m/^\s*$val.*/i) {
-            splice @{$self->{config}},$config_line,1,"$val $params{$val}\n";
-            delete $params{$val};
-            $config_line += 1;
-          }
-        }
-      }
-    }
-  }
-  # Add any leftover parameters
-  delete $params{'update-kernel'};
-  if (defined $params{'option'}){
-    delete $params{'option'};
-    $config_line -= 1;
-    foreach my $val ( keys %params){
-      splice @{$self->{config}},$config_line,0,"\t$val $params{$val}\n";
-      $config_line += 1;
-    }
-  }
-}
-
-
-# Run command to install bootloader
-sub install {
-  my $self=shift;
-  my $device;
-
-  my @sections=$self->_info();
-
-  warn "ZIPL: needs to run zipl -m $sections[0]{'menu'}\n";
-  system("/sbin/zipl -m $sections[0]{'menu'}");
-  if ($? != 0) {
-    warn ("ERROR:  Failed to run grub-install.\n") && return undef;
-  }
-  return 1;
-}
-
-
-sub update_main_options{
-  # XXX: the main options are probabally those on the menu object.
-  die "ERROR: unable to update main options\n";
-}
-
-
-sub boot_once {
-  warn "ZIPL does not support boot-once\n";
-  return undef;
-}
-
-1;
-
-=head1 AUTHOR
-
-Open Source Development Labs, Engineering Department <eng@osdl.org>
-
-=head1 COPYRIGHT
-
-Copyright (C) 2006 Open Source Development Labs
-All Rights Reserved.
-
-This script is free software; you can redistribute it and/or modify it
-under the same terms as Perl itself.
-
-=head1 SEE ALSO
-
-L<Linux::Bootloader>
-
-=cut
-
-#!/usr/bin/perl -I ../lib
-
-use lib '../lib';
-use Getopt::Long;
-use Pod::Usage;
-
-
-my %params;
-
-GetOptions(
-           \%params,
-           "bootloader-probe",      # Prints the bootloader in use on the system
-           "arch-probe:s",          # Prints the arch of the system
-           "bootloader=s",
-           "config_file=s",
-           "add-kernel=s",
-           "remove-kernel=s",
-           "update-kernel=s",
-           "title=s",
-           "args=s",
-           "remove-args=s",
-           "initrd=s",
-           "root=s",
-           "savedefault=s",
-           "position=s",
-           "info=s",
-           "debug=i",
-           "set-default=s",
-           "make-default",
-           "force",
-           "boot-once",
-           "install",
-	   "module=s@", 
-           "default",
-           "help",
-           "man",
-           "version|V",
-           "xen",
-           ) or pod2usage(-verbose => 1, -exitstatus => 0);
-
-pod2usage(-verbose => 2, -exitstatus => 0) if ($params{man});
-pod2usage(-verbose => 1, -exitstatus => 0) if ($params{help});
-pod2usage(-verbose => 0, -exitstatus => 0) if ! %params;
-
-if ($params{version}) {
-    print "$0 version 1.1\n";
-}
-
-### Bootloader / Arch Detection ###
-
-my $detected_bootloader;
-my $detected_architecture;
-
-if (defined $params{'bootloader-probe'}) {
-  our $opt_bootloader      = 0;
-  $detected_bootloader = Linux::Bootloader::Detect::detect_bootloader()
-    || warn "Could not detect bootloader\n";
-  print "$detected_bootloader\n";
-  exit 0;
-} elsif (defined $params{'arch-probe'}) {
-  our $opt_arch    = 0;
-  $detected_architecture = Linux::Bootloader::Detect::detect_architecture( $params{'arch-probe'} )
-    || warn "Could not detect architecture\n";
-  print "$detected_architecture\n";
-  exit 0;
-} elsif (defined $params{bootloader}) {
-  $detected_bootloader = $params{bootloader};
-} else {
-  #$detected_bootloader = 'grub';
-  $detected_bootloader = Linux::Bootloader::Detect::detect_bootloader()
-    || warn "Could not detect bootloader\n";
-}
-
-
-### Load Module ###
-
-my $bootloader;
-if ($detected_bootloader =~ m/^(grub|elilo|lilo|yaboot|zipl)$/) {
-  my $class = "Linux::Bootloader::" . "\u$detected_bootloader";
-  eval "require $class";
-  $bootloader = eval "new $class(\$params{config_file});";
-
-} else { 
-  die "ERROR: Bootloader $detected_bootloader not recognized!\n";
-}
-
-
-### Check Config ###
-
-if (! -r $bootloader->{config_file}) { die "Can't read config file.\n"; }
-
-if (defined $params{'debug'}) {
-  $bootloader->debug($params{'debug'});
-}
-
-if (defined $params{'install'}) {
-  $bootloader->read();
-  $bootloader->install() unless $detected_bootloader eq 'grub' 
-                             or $detected_bootloader eq 'pxe' ;
-} elsif (defined $params{'add-kernel'}) {
-  $bootloader->read();
-  $bootloader->add(%params);
-  $bootloader->write();
-  $bootloader->install() unless $detected_bootloader eq 'grub';
-
-} elsif (defined $params{'remove-kernel'}) {
-  $bootloader->read();
-  $bootloader->remove($params{'remove-kernel'});
-  $bootloader->write();
-  $bootloader->install() unless $detected_bootloader eq 'grub';
-
-} elsif (defined $params{'update-kernel'}) {
-  $bootloader->read();
-  $bootloader->update(%params);
-  $bootloader->write();
-  $bootloader->install() unless $detected_bootloader eq 'grub';
-
-} elsif (defined $params{info}) {
-  $bootloader->read();
-  $bootloader->print_info($params{info});
-
-} elsif (defined $params{'set-default'}) {
-  $bootloader->read();
-  $bootloader->set_default($params{'set-default'});
-  $bootloader->write();
-  $bootloader->install() unless $detected_bootloader eq 'grub';
-
-} elsif (defined $params{'default'}) {
-  $bootloader->read();
-  print $bootloader->get_default() . "\n";
-
-} elsif (defined $params{'boot-once'} && defined $params{'title'}) {
-  if ($detected_bootloader =~ /^lilo|^elilo|^grub/) {
-    $bootloader->boot_once($params{title});
-  } else {
-    warn "WARNING: $detected_bootloader does not have boot-once support.\n";
-    warn "Setting as default instead.\n";
-    $bootloader->read();
-    $bootloader->set_default($params{'title'});
-    $bootloader->write();
-  } 
-}
-
- 
-__END__
-
-
-=head1 NAME
-
-boottool - tool for modifying bootloader configuration
-
-=head1 SYNOPSIS
-
-boottool [--bootloader-probe] [--arch-probe]
-         [--add-kernel=<kernel_path>] [--title=<kernel_title>] [--position=<#|start|end>]
-         [--root=<root_path>] [--args=<kernel_args>] [--initrd=<initrd_path>]
-         [--make-default] [--force] [--boot-once] [--install]
-         [--bootloader=<grub|lilo|elilo|yaboot|zipl>] [--config-file=</path/to/config>]
-         [--remove-kernel=<#|title|start|end>] [--module=<module>]
-         [--update-kernel=<#|title>] [--remove-args=<args>]
-         [--info=<all|default|#>] [--default]
-         [--help] [--debug=<0..5>] [--set-default=<#>]
-
-=head1 DESCRIPTION
-
-Boottool allows scripted modification of bootloader configuration files.
-Grub, Lilo, Elilo, and Yaboot are currently supported.
-When adding a kernel, any options not specified are copied from default.
-
-=head1 OPTIONS
-
-=head2 GENERAL OPTIONS
-
-These can be used with any of the commands to override defaults or
-autodetection.  They are not typically needed.
-
-=over 8
-
-=item B<--bootloader>=I<string>
-
-Manually specify the bootloader to use.  By default, boottool will
-automatically try to detect the bootloader being used.
-
-=item B<--config_file>=I<string>
-
-Specifies the path and name of the bootloader config file, overriding
-autodetection of this file.
-
-=back
-
-=head2 INFORMATIONAL OPERATIONS
-
-These operations return information about the system, without making
-alterations to any files.
-
-=over 8
-
-=item B<--bootloader-probe>
-
-Prints the bootloader in use on the system and exits.
-
-=item B<--arch-probe>
-
-Prints the arch of the system and exits.
-
-=item B<--info>=I<string>
-
-Display information about the bootloader entry at the given position number.
-Also accepts 'all' or 'default'.
-
-=item B<--default>
-
-Prints the current default kernel for the bootloader.
-
-=back
-
-=head2 KERNEL OPERATIONS
-
-These operations result in modifications to system configuration files.
-Only one of these operations may be called.  See KERNEL MODIFICATION
-PARAMETERS (below) for specifying what the operations should do.
-
-=over 8
-
-=item B<--add-kernel>=I<string>
-
-Adds a new kernel with the given path.
-
-=item B<--update-kernel>=I<string>
-
-Updates an existing kernel with the given position number or title.
-Used with --args or --remove-args.
-
-=item B<--module>=I<string>
-
-This option adds modules to the new kernel. It only works with Grub Bootloader.
-For more module options just add another --module parameter
-
-=item B<--remove-kernel>=I<string>
-
-Removes the bootloader entry with the given position or title.
-Also accepts 'start' or 'end'.
-
-=item B<--set-default>=I<integer>
-
-Updates the bootloader to set the default boot entry to given given
-position or title.
-
-=item B<--boot-once>
-
-Causes the bootloader to boot the kernel specified by --title just one
-time, then fall back to the default.  This option doesn't work
-identically on all architectures.
-
-=back
-
-=head2 KERNEL MODIFICATION PARAMETERS
-
-These parameters can be used with the kernel operations listed above, to 
-specify how the operations should work.
-
-=over 8
-
-=item B<--title>=I<string>
-
-The title or label to use for the bootloader entry.
-
-=item B<--args>=I<string>
-
-Arguments to be passed to the kernel at boot.
-
-=item B<--remove-args>=I<string>
-
-Arguments to be removed from an existing entry.
-Used with --update-kernel.
-
-=item B<--initrd>=I<string>
-
-The initrd image path to use in the bootloader entry.
-
-=item B<--root>=I<string>
-
-The device where the root partition is located.
-
-=item B<--savedefault>=I<string>
-
-The number to use in the savedefault section
-
-=item B<--position>=I<string>
-
-Insert bootloader entry at the given position number, counting from 0.
-Also accepts 'start' or 'end'.  This is only useful when using the
---add-kernel operation.
-
-=item B<--make-default>
-
-Specifies that the bootloader entry being added should be set to the
-default.
-
-=item B<--install>
-
-Causes bootloader to update and re-install the bootloader file.
-
-=back
-
-
-=head2 OTHER OPTIONS
-
-=over 8
-
-=item B<-V, --version>
-
-Prints the version and exits.
-
-=item B<-h, --help>
-
-Prints a brief help message with option summary.
-
-=item B<--man>
-
-Prints a manual page (detailed help).  Same as `perdoc tgen`
-
-=item B<-D, --debug N>
-
-Prints debug messages.  This expects a numerical argument corresponding
-to the debug message verbosity.
-
-=back
-
-=head1 PREREQUISITES
-
-C<Linux::Bootloader>
-
-C<Getopt::Long>
-
-C<Pod::Usage>
-
-=head1 COREQUISITES
-
-boottool works with any bootloader supported by Linux::Bootloader,
-including the following:
-
-C<Lilo>
-
-C<Grub>
-
-C<Yaboot>
-
-C<Elilo>
-
-Obviously, at least one bootloader must be installed for this to be of
-any use.  ;-)
-
-=head1 BUGS
-
-Send bug reports to L<http://sourceforge.net/projects/crucible/>
-
-=head1 VERSION
-
-1.0
-
-=head1 SEE ALSO
-
-L<crucible>, L<WWW::PkgFind>, L<Test::Parser>, L<Linux::Distribution>
-
-=head1 AUTHOR
-
-Jason N.
-
-L<http://www.osdl.org/|http://www.osdl.org/>
-
-=head1 COPYRIGHT
-
-Copyright (C) 2006 Open Source Development Labs
-All Rights Reserved.
-
-This script is free software; you can redistribute it and/or
-modify it under the same terms as Perl itself.
-
-=head1 REVISION
-
-Revision: $Revision: 1.10 $
-
-=cut
diff --git a/client/tools/cd_hash.py b/client/tools/cd_hash.py
deleted file mode 100755
index 3db1e47..0000000
--- a/client/tools/cd_hash.py
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/python
-"""
-Program that calculates several hashes for a given CD image.
-
-@copyright: Red Hat 2008-2009
-"""
-
-import os, sys, optparse, logging
-import common
-from autotest_lib.client.common_lib import logging_manager
-from autotest_lib.client.bin import utils
-from autotest_lib.client.virt import virt_utils
-
-
-if __name__ == "__main__":
-    parser = optparse.OptionParser("usage: %prog [options] [filenames]")
-    options, args = parser.parse_args()
-
-    logging_manager.configure_logging(virt_utils.VirtLoggingConfig())
-
-    if args:
-        filenames = args
-    else:
-        parser.print_help()
-        sys.exit(1)
-
-    for filename in filenames:
-        filename = os.path.abspath(filename)
-
-        file_exists = os.path.isfile(filename)
-        can_read_file = os.access(filename, os.R_OK)
-        if not file_exists:
-            logging.critical("File %s does not exist!", filename)
-            continue
-        if not can_read_file:
-            logging.critical("File %s does not have read permissions!",
-                             filename)
-            continue
-
-        logging.info("Hash values for file %s", os.path.basename(filename))
-        logging.info("md5    (1m): %s", utils.hash_file(filename, 1024*1024,
-                                                        method="md5"))
-        logging.info("sha1   (1m): %s", utils.hash_file(filename, 1024*1024,
-                                                        method="sha1"))
-        logging.info("md5  (full): %s", utils.hash_file(filename, method="md5"))
-        logging.info("sha1 (full): %s", utils.hash_file(filename,
-                                                        method="sha1"))
-        logging.info("")