1# dir on remote host to hold git repo 2repodir = '/tmp/kvm' 3 4# git url to clone 5giturl = 'git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm.git' 6 7# web url to check remote version to determine whether or not to 'git pull' 8weburl = 'http://git.kernel.org/?p=linux/kernel/git/avi/kvm.git' 9 10# CHANGEME - kernel config 11kconfig = 'http://git.kernel.org/?p=virt/kvm/kvm-userspace.git;a=blob_plain;f=kernel/x86_64.config;hb=HEAD' 12 13# CHANGEME 14myhostname = 'myhost' 15 16# init the git kernel 17kernel = git_kernel.GitKernel(repodir, giturl, weburl) 18 19# ssh to remote host 20h = hosts.create_host(myhostname) 21 22# acquire git repo, make sure it is up-to-date, clone repo into tmp dir 23kernel.get(h) 24 25# display local repo version 26print kernel.get_local_head(h) 27 28# configure, build, and install on remote host 29kernel.configure(kconfig) 30kernel.build(h) 31kernel.install(h) 32 33# add kernel to remote host bootloader, set up next boot entry 34h.bootloader.boot_once('autotest') 35 36# reboot and check that everything worked 37h.reboot() 38h.wait_up() 39print h.run("uname -a").stdout 40