Merge lp:~paride/utah/packaging-fixes into lp:utah

Proposed by Paride Legovini
Status: Merged
Approved by: Joshua Powers
Approved revision: no longer in the source branch.
Merged at revision: 1136
Proposed branch: lp:~paride/utah/packaging-fixes
Merge into: lp:utah
Diff against target: 168 lines (+89/-14)
5 files modified
conf/utah/default-vm-s390x.xml (+41/-0)
debian/changelog (+11/-1)
utah/iso.py (+2/-0)
utah/provisioning/provisioning.py (+12/-2)
utah/provisioning/vm.py (+23/-11)
To merge this branch: bzr merge lp:~paride/utah/packaging-fixes
Reviewer Review Type Date Requested Status
Canonical CI Engineering Pending
Review via email: mp+365038@code.launchpad.net

Commit message

More changes to support s390x:
  * Look for the kernel in boot/kernel.ubuntu on s390x
  * Add an XML file for s390x
  * Support for the s390x sclp console
  * Detect if the initrd is a gzip using the gz magic numbers

To post a comment you must log in.
lp:~paride/utah/packaging-fixes updated
1136. By Joshua Powers

* Look for the kernel in boot/kernel.ubuntu on s390x
* Add an XML file for s390x
* Support for the s390x sclp console
* Detect if the initrd is a gzip using the gz magic numbers
* utah-latecommand: do not assume /dev/ttyS0 exists
* latecommand-wrapper: run with 'set -e'
* utah.postinst: replace 'libvirtd' group with 'libvirt' (LP: #1818670)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'conf/utah/default-vm-s390x.xml'
--- conf/utah/default-vm-s390x.xml 1970-01-01 00:00:00 +0000
+++ conf/utah/default-vm-s390x.xml 2019-03-25 14:51:08 +0000
@@ -0,0 +1,41 @@
1<!--
2 Copyright (C) 2019, Canonical Ltd (http://www.canonical.com/)
3
4 This file is part of utah.
5
6 utah is free software: you can redistribute it
7 and/or modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation, either version 3 of
9 the License, or (at your option) any later version.
10
11 utah is distributed in the hope that it will
12 be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with ubuntu-server-iso-testing. If not, see
18 <http://www.gnu.org/licenses/>.
19-->
20<domain type='kvm'>
21 <name>Utah Example</name>
22 <uuid>00000000-0000-0000-0000-000000000000</uuid>
23 <memory>1048576</memory>
24 <currentMemory>1048576</currentMemory>
25 <vcpu placement='static'>2</vcpu>
26 <os>
27 <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
28 </os>
29 <clock offset='utc'/>
30 <on_poweroff>destroy</on_poweroff>
31 <on_reboot>restart</on_reboot>
32 <on_crash>destroy</on_crash><!-- this could also be 'preserve' -->
33 <devices>
34 <emulator>/usr/bin/kvm</emulator>
35 <interface type='network'>
36 <mac address='00:00:00:00:00:00'/>
37 <source network='default'/>
38 <model type='virtio'/>
39 </interface>
40 </devices>
41</domain>
042
=== modified file 'debian/changelog'
--- debian/changelog 2019-03-06 13:41:11 +0000
+++ debian/changelog 2019-03-25 14:51:08 +0000
@@ -1,10 +1,20 @@
1utah (0.19~bzr1143) UNRELEASED; urgency=medium
2 * Look for the kernel in boot/kernel.ubuntu on s390x
3 * Add an XML file for s390x
4 * Support for the s390x sclp console
5 * Detect if the initrd is a gzip using the gz magic numbers
6 * utah-latecommand: do not assume /dev/ttyS0 exists
7 * latecommand-wrapper: run with 'set -e'
8
9 -- Paride Legovini <paride.legovini@canonical.com> Mon, 25 Mar 2019 15:48:38 +0100
10
1utah (0.19~bzr1138) UNRELEASED; urgency=medium11utah (0.19~bzr1138) UNRELEASED; urgency=medium
212
3 * Set source format: 3.0 (native)13 * Set source format: 3.0 (native)
4 * Remove secureboot dependency for s390x14 * Remove secureboot dependency for s390x
5 * Don't Recommend nonexisting kvm package15 * Don't Recommend nonexisting kvm package
6 * Make 'utah' (bin pkg) Recommend 'make' (LP: #1818686)16 * Make 'utah' (bin pkg) Recommend 'make' (LP: #1818686)
7 * utah.postinst: replace 'libvirtd' group with 'libvirt' (LP: #1818670) 17 * utah.postinst: replace 'libvirtd' group with 'libvirt' (LP: #1818670)
8 * Fix syntax errors in d/changelog18 * Fix syntax errors in d/changelog
919
10 -- Paride Legovini <paride.legovini@canonical.com> Wed, 06 Mar 2019 13:51:19 +010020 -- Paride Legovini <paride.legovini@canonical.com> Wed, 06 Mar 2019 13:51:19 +0100
1121
=== modified file 'utah/iso.py'
--- utah/iso.py 2018-04-25 18:27:09 +0000
+++ utah/iso.py 2019-03-25 14:51:08 +0000
@@ -453,6 +453,8 @@
453 kernelpath = './install/vmlinuz'453 kernelpath = './install/vmlinuz'
454 if self.arch == 'ppc64el':454 if self.arch == 'ppc64el':
455 kernelpath = './install/vmlinux'455 kernelpath = './install/vmlinux'
456 if self.arch == 's390x':
457 kernelpath = './boot/kernel.ubuntu'
456 elif self.installtype == 'mini':458 elif self.installtype == 'mini':
457 self.logger.debug('Getting kernel for mini image')459 self.logger.debug('Getting kernel for mini image')
458 kernelpath = 'linux'460 kernelpath = 'linux'
459461
=== modified file 'utah/provisioning/provisioning.py'
--- utah/provisioning/provisioning.py 2019-03-12 12:44:12 +0000
+++ utah/provisioning/provisioning.py 2019-03-25 14:51:08 +0000
@@ -18,6 +18,7 @@
18Functions here should apply to multiple machine types (VM, bare metal, etc.)18Functions here should apply to multiple machine types (VM, bare metal, etc.)
19"""19"""
2020
21import binascii
21import logging22import logging
22import logging.handlers23import logging.handlers
23import os24import os
@@ -624,7 +625,9 @@
624 if initrd is None:625 if initrd is None:
625 self.logger.info('Unpacking initrd from image')626 self.logger.info('Unpacking initrd from image')
626 initrdpath = './install/initrd.gz'627 initrdpath = './install/initrd.gz'
627 if self.image.installtype == 'mini':628 if self.image.arch == 's390x':
629 initrdpath = './boot/initrd.ubuntu'
630 elif self.image.installtype == 'mini':
628 self.logger.debug('Mini image detected')631 self.logger.debug('Mini image detected')
629 initrdpath = 'initrd.gz'632 initrdpath = 'initrd.gz'
630 elif self.image.installtype == 'desktop':633 elif self.image.installtype == 'desktop':
@@ -658,7 +661,14 @@
658 raise UTAHProvisioningException(661 raise UTAHProvisioningException(
659 'Error using temp directory {}: {}'.format(tmpdir, err))662 'Error using temp directory {}: {}'.format(tmpdir, err))
660 pipe = pipes.Template()663 pipe = pipes.Template()
661 if os.path.splitext(initrd)[1] == '.gz':664
665 with open(initrd, 'rb') as initrd_f:
666 if binascii.hexlify(initrd_f.read(2)) == b'1f8b':
667 initrd_is_gz = True
668 else:
669 initrd_is_gz = False
670
671 if initrd_is_gz:
662 self.logger.debug('Using gzip based on file extension')672 self.logger.debug('Using gzip based on file extension')
663 pipe.prepend('zcat $IN', 'f-')673 pipe.prepend('zcat $IN', 'f-')
664 pipe.append('cpio -ivd 2>/dev/null', '-.')674 pipe.append('cpio -ivd 2>/dev/null', '-.')
665675
=== modified file 'utah/provisioning/vm.py'
--- utah/provisioning/vm.py 2018-09-10 14:37:51 +0000
+++ utah/provisioning/vm.py 2019-03-25 14:51:08 +0000
@@ -385,17 +385,29 @@
385 mac)385 mac)
386 if interface.get('type') == 'bridge':386 if interface.get('type') == 'bridge':
387 interface.find('source').set('bridge', config.bridge)387 interface.find('source').set('bridge', config.bridge)
388 serial = ElementTree.Element('serial')388 if self.image.arch == ('s390x'):
389 serial.set('type', 'file')389 console = ElementTree.Element('console')
390 source = ElementTree.Element('source')390 console.set('type', 'pty')
391 source.set('path', self.syslog)391 log = ElementTree.Element('log')
392 #TODO: reintegrate this when the required qemu version lands392 log.set('file', self.syslog)
393# source.set('append', 'on') # lp#1548499393 log.set('append', 'on')
394 serial.append(source)394 console.append(log)
395 target = ElementTree.Element('target')395 target = ElementTree.Element('target')
396 target.set('port', '0')396 target.set('type', 'sclp')
397 serial.append(target)397 target.set('port', '0')
398 devices.append(serial)398 console.append(target)
399 devices.append(console)
400 else:
401 serial = ElementTree.Element('serial')
402 serial.set('type', 'file')
403 source = ElementTree.Element('source')
404 source.set('path', self.syslog)
405 source.set('append', 'on')
406 serial.append(source)
407 target = ElementTree.Element('target')
408 target.set('port', '0')
409 serial.append(target)
410 devices.append(serial)
399411
400 def _installvm(self, lv=None, tmpdir=None, xml=None):412 def _installvm(self, lv=None, tmpdir=None, xml=None):
401 """Install a VM, then undefine it in libvirt.413 """Install a VM, then undefine it in libvirt.

Subscribers

People subscribed via source and target branches