Merge lp:~smoser/maas-images/trunk.fix-powerpc-mining into lp:maas-images

Proposed by Scott Moser
Status: Merged
Merged at revision: 304
Proposed branch: lp:~smoser/maas-images/trunk.fix-powerpc-mining
Merge into: lp:maas-images
Diff against target: 194 lines (+117/-17)
2 files modified
meph2/netinst.py (+16/-2)
tests/unittests/file_item_data.json (+101/-15)
To merge this branch: bzr merge lp:~smoser/maas-images/trunk.fix-powerpc-mining
Reviewer Review Type Date Requested Status
Andres Rodriguez (community) Approve
Review via email: mp+296705@code.launchpad.net

Commit message

fix mining of d-i kernels for powerpc architecture

Cloud images are built for powerpc architecture, and in that build process
on xenial and yakkety, the build runs maas-images to scrape available d-i
kernel data.

That process was failing as the directory layout for powerpc was slightly
different than other arch. MAAS does not produce powerpc images, but at this
point, the only thing preventing them would be this code. Might as well fix it so that the failure during build does not have to be ignored.

This fixes those issues and adds the paths and expected data to the
file_item_data.json that represents expected data for possible paths.

To post a comment you must log in.
Revision history for this message
Scott Moser (smoser) wrote :

The failure could be reproduced by running:
  ./bin/netboot-mirror --dry-run -vvv --arches=powerpc out.d

Now that command will succeed.

307. By Scott Moser

document FLAVOR_COLLISIONS dictionary a bit.

Revision history for this message
Andres Rodriguez (andreserl) wrote :

lgtm!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'meph2/netinst.py'
2--- meph2/netinst.py 2016-05-11 18:41:21 +0000
3+++ meph2/netinst.py 2016-06-07 17:31:34 +0000
4@@ -64,13 +64,23 @@
5 GPG_KEYRING = "/usr/share/keyrings/ubuntu-archive-keyring.gpg"
6 CONTENT_ID = "com.ubuntu.installer:released:netboot"
7
8+# see get_kfile_key for how a file item key is generated.
9+# flavor can be long, but only 3 chars are used for it in the keyname.
10+# This dictionary maintains a static list of flavors that match the first
11+# 3 chars and thus need other representation.
12 FLAVOR_COLLISIONS = {
13+ "e500": "e50",
14+ "e500mc": "e5m",
15+ "generic-lpae": "glp",
16 "omap4": "om4",
17- "generic-lpae": "glp",
18+ "powerpc": "ppc",
19+ "powerpc64": "pp6",
20 }
21
22 KERNEL_FLAVORS = (
23 'armadaxp',
24+ 'e500',
25+ 'e500mc',
26 'generic',
27 'generic-lpae',
28 'highbank',
29@@ -78,6 +88,8 @@
30 'non-pae',
31 'omap',
32 'omap4',
33+ 'powerpc',
34+ 'powerpc64',
35 )
36
37 DTB_TO_FORMAT = {
38@@ -101,6 +113,8 @@
39 "dtb": re.compile(r".dtb$").search,
40 }
41
42+IGNORED_INITRD_FLAVORS = ('xen', 'cdrom', 'gtk', 'hd-media')
43+
44 # #
45 # # Under a path like: MIRROR/precise-updates/main/installer-i386/
46 # # we find a listing of directories like:
47@@ -300,7 +314,7 @@
48
49 # paths with 'xen' or 'cdrom' would be other initrd-flavors
50 # essentially just blacklist paths with these toks
51- other_iflavor_toks = ('xen', 'cdrom', 'gtk')
52+ other_iflavor_toks = IGNORED_INITRD_FLAVORS
53 for other in other_iflavor_toks:
54 if other + "/" in path:
55 return None
56
57=== modified file 'tests/unittests/file_item_data.json'
58--- tests/unittests/file_item_data.json 2016-05-11 18:41:21 +0000
59+++ tests/unittests/file_item_data.json 2016-06-07 17:31:34 +0000
60@@ -133,6 +133,35 @@
61 "kernel-flavor": "generic",
62 "kernel-release": "BASE"
63 },
64+ "e500/netboot/initrd.gz": {
65+ "ftype": "initrd",
66+ "image-format": "default",
67+ "initrd-flavor": "netboot",
68+ "kernel-flavor": "e500",
69+ "kernel-release": "BASE"
70+ },
71+ "e500/netboot/vmlinux": {
72+ "ftype": "kernel",
73+ "image-format": "default",
74+ "initrd-flavor": "netboot",
75+ "kernel-flavor": "e500",
76+ "kernel-release": "BASE"
77+ },
78+ "e500mc/netboot/initrd.gz": {
79+ "ftype": "initrd",
80+ "image-format": "default",
81+ "initrd-flavor": "netboot",
82+ "kernel-flavor": "e500mc",
83+ "kernel-release": "BASE"
84+ },
85+ "e500mc/netboot/vmlinux": {
86+ "ftype": "kernel",
87+ "image-format": "default",
88+ "initrd-flavor": "netboot",
89+ "kernel-flavor": "e500mc",
90+ "kernel-release": "BASE"
91+ },
92+ "e500/cdrom/vmlinux": null,
93 "generic-lpae/netboot/initrd.gz": {
94 "ftype": "initrd",
95 "image-format": "default",
96@@ -635,6 +664,35 @@
97 "kernel-flavor": "omap4",
98 "kernel-release": "BASE"
99 },
100+ "powerpc/hd-media/vmlinux": null,
101+ "powerpc/netboot/initrd.gz": {
102+ "ftype": "initrd",
103+ "image-format": "default",
104+ "initrd-flavor": "netboot",
105+ "kernel-flavor": "powerpc",
106+ "kernel-release": "BASE"
107+ },
108+ "powerpc/netboot/vmlinux": {
109+ "ftype": "kernel",
110+ "image-format": "default",
111+ "initrd-flavor": "netboot",
112+ "kernel-flavor": "powerpc",
113+ "kernel-release": "BASE"
114+ },
115+ "powerpc64/netboot/initrd.gz": {
116+ "ftype": "initrd",
117+ "image-format": "default",
118+ "initrd-flavor": "netboot",
119+ "kernel-flavor": "powerpc64",
120+ "kernel-release": "BASE"
121+ },
122+ "powerpc64/netboot/vmlinux": {
123+ "ftype": "kernel",
124+ "image-format": "default",
125+ "initrd-flavor": "netboot",
126+ "kernel-flavor": "powerpc64",
127+ "kernel-release": "BASE"
128+ },
129 "quantal-netboot-xen/netboot/xen/initrd.gz": null,
130 "quantal-netboot-xen/netboot/xen/vmlinuz": null,
131 "quantal-netboot-xen/netboot/xen/xm-debian.cfg": null,
132@@ -1372,19 +1430,47 @@
133 "kernel-release": "wily"
134 },
135 "wily-netboot/xen/xm-debian.cfg": null,
136- "xenial-generic/netboot/initrd.gz": {
137- "ftype": "initrd",
138- "image-format": "default",
139- "initrd-flavor": "netboot",
140- "kernel-flavor": "generic",
141- "kernel-release": "xenial"
142- },
143- "xenial-generic/netboot/initrd.gz": {
144- "ftype": "initrd",
145- "image-format": "default",
146- "initrd-flavor": "netboot",
147- "kernel-flavor": "generic",
148- "kernel-release": "xenial"
149- },
150- "xenial-netboot/ubuntu-installer/amd64/pxelinux.0": null
151+ "xenial-e500mc/netboot/initrd.gz": {
152+ "ftype": "initrd",
153+ "image-format": "default",
154+ "initrd-flavor": "netboot",
155+ "kernel-flavor": "e500mc",
156+ "kernel-release": "xenial"
157+ },
158+ "xenial-e500mc/netboot/vmlinux": {
159+ "ftype": "kernel",
160+ "image-format": "default",
161+ "initrd-flavor": "netboot",
162+ "kernel-flavor": "e500mc",
163+ "kernel-release": "xenial"
164+ },
165+ "xenial-generic/netboot/initrd.gz": {
166+ "ftype": "initrd",
167+ "image-format": "default",
168+ "initrd-flavor": "netboot",
169+ "kernel-flavor": "generic",
170+ "kernel-release": "xenial"
171+ },
172+ "xenial-generic/netboot/initrd.gz": {
173+ "ftype": "initrd",
174+ "image-format": "default",
175+ "initrd-flavor": "netboot",
176+ "kernel-flavor": "generic",
177+ "kernel-release": "xenial"
178+ },
179+ "xenial-netboot/ubuntu-installer/amd64/pxelinux.0": null,
180+ "xenial-powerpc64/netboot/initrd.gz": {
181+ "ftype": "initrd",
182+ "image-format": "default",
183+ "initrd-flavor": "netboot",
184+ "kernel-flavor": "powerpc64",
185+ "kernel-release": "xenial"
186+ },
187+ "xenial-powerpc64/netboot/vmlinux": {
188+ "ftype": "kernel",
189+ "image-format": "default",
190+ "initrd-flavor": "netboot",
191+ "kernel-flavor": "powerpc64",
192+ "kernel-release": "xenial"
193+ }
194 }

Subscribers

People subscribed via source and target branches