Fixes for Unbuntu 16.04/Xenial

- add xenial
- partx returns an error (warn rather than fail)
- remove dnsmasq build.py dependency (not really needed, side effects)
This commit is contained in:
Bob Lantz
2016-08-02 15:27:53 -07:00
parent 5714495f8c
commit 76c8afde8a
+18 -4
View File
@@ -80,6 +80,12 @@ isoURLs = {
'wily64server': 'wily64server':
'http://mirrors.kernel.org/ubuntu-releases/15.10/' 'http://mirrors.kernel.org/ubuntu-releases/15.10/'
'ubuntu-15.10-server-amd64.iso', 'ubuntu-15.10-server-amd64.iso',
'xenial32server':
'http://mirrors.kernel.org/ubuntu-releases/16.04/'
'ubuntu-16.04.1-server-i386.iso',
'xenial64server':
'http://mirrors.kernel.org/ubuntu-releases/16.04/'
'ubuntu-16.04.1-server-amd64.iso',
} }
@@ -149,7 +155,7 @@ def depend():
run( 'sudo apt-get -qy update' ) run( 'sudo apt-get -qy update' )
run( 'sudo apt-get -qy install' run( 'sudo apt-get -qy install'
' kvm cloud-utils genisoimage qemu-kvm qemu-utils' ' kvm cloud-utils genisoimage qemu-kvm qemu-utils'
' e2fsprogs dnsmasq curl' ' e2fsprogs curl'
' python-setuptools mtools zip' ) ' python-setuptools mtools zip' )
run( 'sudo easy_install pexpect' ) run( 'sudo easy_install pexpect' )
@@ -222,7 +228,10 @@ def extractKernel( image, flavor, imageDir=VMImageDir ):
return kernel, initrd return kernel, initrd
log( '* Extracting kernel to', kernel ) log( '* Extracting kernel to', kernel )
nbd = attachNBD( image, flags='-r' ) nbd = attachNBD( image, flags='-r' )
print( srun( 'partx ' + nbd ) ) try:
print( srun( 'partx ' + nbd ) )
except:
log( 'Warning - partx failed with error' )
# Assume kernel is in partition 1/boot/vmlinuz*generic for now # Assume kernel is in partition 1/boot/vmlinuz*generic for now
part = nbd + 'p1' part = nbd + 'p1'
mnt = mkdtemp() mnt = mkdtemp()
@@ -246,8 +255,9 @@ def findBaseImage( flavor, size='8G' ):
# Detect race condition with multiple builds # Detect race condition with multiple builds
perms = stat( image )[ ST_MODE ] & 0777 perms = stat( image )[ ST_MODE ] & 0777
if perms != 0444: if perms != 0444:
raise Exception( 'Error - %s is writable ' % image + raise Exception( 'Error - base image %s is writable.' % image +
'; are multiple builds running?' ) ' Are multiple builds running? if not,'
' remove %s and try again.' % image )
else: else:
# We create VMImageDir here since we are called first # We create VMImageDir here since we are called first
run( 'mkdir -p %s' % VMImageDir ) run( 'mkdir -p %s' % VMImageDir )
@@ -379,6 +389,10 @@ def installUbuntu( iso, image, logfilename='install.log', memory=1024 ):
accel = 'tcg' accel = 'tcg'
else: else:
accel = 'kvm' accel = 'kvm'
try:
run( 'kvm-ok' )
except:
raise Exception( 'kvm-ok failed; try using --nokvm' )
cmd = [ 'sudo', kvm, cmd = [ 'sudo', kvm,
'-machine', 'accel=%s' % accel, '-machine', 'accel=%s' % accel,
'-nographic', '-nographic',