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
1=== added file 'conf/utah/default-vm-s390x.xml'
2--- conf/utah/default-vm-s390x.xml 1970-01-01 00:00:00 +0000
3+++ conf/utah/default-vm-s390x.xml 2019-03-25 14:51:08 +0000
4@@ -0,0 +1,41 @@
5+<!--
6+ Copyright (C) 2019, Canonical Ltd (http://www.canonical.com/)
7+
8+ This file is part of utah.
9+
10+ utah is free software: you can redistribute it
11+ and/or modify it under the terms of the GNU General Public License
12+ as published by the Free Software Foundation, either version 3 of
13+ the License, or (at your option) any later version.
14+
15+ utah is distributed in the hope that it will
16+ be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
17+ of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+ GNU General Public License for more details.
19+
20+ You should have received a copy of the GNU General Public License
21+ along with ubuntu-server-iso-testing. If not, see
22+ <http://www.gnu.org/licenses/>.
23+-->
24+<domain type='kvm'>
25+ <name>Utah Example</name>
26+ <uuid>00000000-0000-0000-0000-000000000000</uuid>
27+ <memory>1048576</memory>
28+ <currentMemory>1048576</currentMemory>
29+ <vcpu placement='static'>2</vcpu>
30+ <os>
31+ <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
32+ </os>
33+ <clock offset='utc'/>
34+ <on_poweroff>destroy</on_poweroff>
35+ <on_reboot>restart</on_reboot>
36+ <on_crash>destroy</on_crash><!-- this could also be 'preserve' -->
37+ <devices>
38+ <emulator>/usr/bin/kvm</emulator>
39+ <interface type='network'>
40+ <mac address='00:00:00:00:00:00'/>
41+ <source network='default'/>
42+ <model type='virtio'/>
43+ </interface>
44+ </devices>
45+</domain>
46
47=== modified file 'debian/changelog'
48--- debian/changelog 2019-03-06 13:41:11 +0000
49+++ debian/changelog 2019-03-25 14:51:08 +0000
50@@ -1,10 +1,20 @@
51+utah (0.19~bzr1143) UNRELEASED; urgency=medium
52+ * Look for the kernel in boot/kernel.ubuntu on s390x
53+ * Add an XML file for s390x
54+ * Support for the s390x sclp console
55+ * Detect if the initrd is a gzip using the gz magic numbers
56+ * utah-latecommand: do not assume /dev/ttyS0 exists
57+ * latecommand-wrapper: run with 'set -e'
58+
59+ -- Paride Legovini <paride.legovini@canonical.com> Mon, 25 Mar 2019 15:48:38 +0100
60+
61 utah (0.19~bzr1138) UNRELEASED; urgency=medium
62
63 * Set source format: 3.0 (native)
64 * Remove secureboot dependency for s390x
65 * Don't Recommend nonexisting kvm package
66 * Make 'utah' (bin pkg) Recommend 'make' (LP: #1818686)
67- * utah.postinst: replace 'libvirtd' group with 'libvirt' (LP: #1818670)
68+ * utah.postinst: replace 'libvirtd' group with 'libvirt' (LP: #1818670)
69 * Fix syntax errors in d/changelog
70
71 -- Paride Legovini <paride.legovini@canonical.com> Wed, 06 Mar 2019 13:51:19 +0100
72
73=== modified file 'utah/iso.py'
74--- utah/iso.py 2018-04-25 18:27:09 +0000
75+++ utah/iso.py 2019-03-25 14:51:08 +0000
76@@ -453,6 +453,8 @@
77 kernelpath = './install/vmlinuz'
78 if self.arch == 'ppc64el':
79 kernelpath = './install/vmlinux'
80+ if self.arch == 's390x':
81+ kernelpath = './boot/kernel.ubuntu'
82 elif self.installtype == 'mini':
83 self.logger.debug('Getting kernel for mini image')
84 kernelpath = 'linux'
85
86=== modified file 'utah/provisioning/provisioning.py'
87--- utah/provisioning/provisioning.py 2019-03-12 12:44:12 +0000
88+++ utah/provisioning/provisioning.py 2019-03-25 14:51:08 +0000
89@@ -18,6 +18,7 @@
90 Functions here should apply to multiple machine types (VM, bare metal, etc.)
91 """
92
93+import binascii
94 import logging
95 import logging.handlers
96 import os
97@@ -624,7 +625,9 @@
98 if initrd is None:
99 self.logger.info('Unpacking initrd from image')
100 initrdpath = './install/initrd.gz'
101- if self.image.installtype == 'mini':
102+ if self.image.arch == 's390x':
103+ initrdpath = './boot/initrd.ubuntu'
104+ elif self.image.installtype == 'mini':
105 self.logger.debug('Mini image detected')
106 initrdpath = 'initrd.gz'
107 elif self.image.installtype == 'desktop':
108@@ -658,7 +661,14 @@
109 raise UTAHProvisioningException(
110 'Error using temp directory {}: {}'.format(tmpdir, err))
111 pipe = pipes.Template()
112- if os.path.splitext(initrd)[1] == '.gz':
113+
114+ with open(initrd, 'rb') as initrd_f:
115+ if binascii.hexlify(initrd_f.read(2)) == b'1f8b':
116+ initrd_is_gz = True
117+ else:
118+ initrd_is_gz = False
119+
120+ if initrd_is_gz:
121 self.logger.debug('Using gzip based on file extension')
122 pipe.prepend('zcat $IN', 'f-')
123 pipe.append('cpio -ivd 2>/dev/null', '-.')
124
125=== modified file 'utah/provisioning/vm.py'
126--- utah/provisioning/vm.py 2018-09-10 14:37:51 +0000
127+++ utah/provisioning/vm.py 2019-03-25 14:51:08 +0000
128@@ -385,17 +385,29 @@
129 mac)
130 if interface.get('type') == 'bridge':
131 interface.find('source').set('bridge', config.bridge)
132- serial = ElementTree.Element('serial')
133- serial.set('type', 'file')
134- source = ElementTree.Element('source')
135- source.set('path', self.syslog)
136- #TODO: reintegrate this when the required qemu version lands
137-# source.set('append', 'on') # lp#1548499
138- serial.append(source)
139- target = ElementTree.Element('target')
140- target.set('port', '0')
141- serial.append(target)
142- devices.append(serial)
143+ if self.image.arch == ('s390x'):
144+ console = ElementTree.Element('console')
145+ console.set('type', 'pty')
146+ log = ElementTree.Element('log')
147+ log.set('file', self.syslog)
148+ log.set('append', 'on')
149+ console.append(log)
150+ target = ElementTree.Element('target')
151+ target.set('type', 'sclp')
152+ target.set('port', '0')
153+ console.append(target)
154+ devices.append(console)
155+ else:
156+ serial = ElementTree.Element('serial')
157+ serial.set('type', 'file')
158+ source = ElementTree.Element('source')
159+ source.set('path', self.syslog)
160+ source.set('append', 'on')
161+ serial.append(source)
162+ target = ElementTree.Element('target')
163+ target.set('port', '0')
164+ serial.append(target)
165+ devices.append(serial)
166
167 def _installvm(self, lv=None, tmpdir=None, xml=None):
168 """Install a VM, then undefine it in libvirt.

Subscribers

People subscribed via source and target branches