'Install a kernel on the remote host.
This will also invoke the guest\'s bootloader to set this
kernel as the default kernel if default=True.
Args:
host: the host on which to install the kernel
[kwargs]: remaining keyword arguments will be passed
to Bootloader.add_kernel()
Raises:
AutoservError: no package has yet been obtained. Call
RPMKernel.get() with a .rpm package.'

def install(self, host, label='autotest', default=False, kernel_args='', install_vmlinux=True):

    if (len(label) > 15):
        raise error.AutoservError(('label    for    kernel    is    too    long                                                    (>    15    chars):    %s' % label))
    if (self.source_material is None):
        raise error.AutoservError('A    kernel    must    first    be                                                    specified    via    get()')
    rpm = self.source_material
    remote_tmpdir = host.get_tmp_dir()
    remote_rpm = os.path.join(remote_tmpdir, os.path.basename(rpm))
    rpm_package = utils.run(('/usr/bin/rpm    -q    -p    %s' % rpm)).stdout
    vmlinuz = self.get_image_name()
    host.send_file(rpm, remote_rpm)
    host.run(('rpm    -e    ' + rpm_package), ignore_status=True)
    host.run(('rpm    --force    -i    ' + remote_rpm))
    if install_vmlinux:
        vmlinux = self.get_vmlinux_name()
        host.run(('cd    /;rpm2cpio    %s    |    cpio    -imuv    .%s' % (remote_rpm, vmlinux)))
        host.run(('ls    ' + vmlinux))
    host.bootloader.remove_kernel(label)
    host.bootloader.add_kernel(vmlinuz, label, args=kernel_args, default=default)
    if kernel_args:
        host.bootloader.add_args(label, kernel_args)
    if (not default):
        host.bootloader.boot_once(label)
