Merge lp:~dannf/maas-images/arm64-netinst-restructure into lp:maas-images

Proposed by dann frazier
Status: Merged
Merged at revision: 218
Proposed branch: lp:~dannf/maas-images/arm64-netinst-restructure
Merge into: lp:maas-images
Diff against target: 52 lines (+18/-3)
1 file modified
meph2/netinst.py (+18/-3)
To merge this branch: bzr merge lp:~dannf/maas-images/arm64-netinst-restructure
Reviewer Review Type Date Requested Status
maintainers of maas images Pending
Review via email: mp+250338@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Scott Moser (smoser) wrote :

for reference... here is what I did to verify this is sane.

- added bin/netboot-mirror and README.di-scraping
  these probalby woudl have been helpful for you.. in seeing what is going
  on. and explaining things.

- ran from your proposed merge:
    ./bin/netboot-mirror --no-item-download out-new.d
  and from original:
    ./bin/netboot-mirror --no-item-download out-old.d

  That created out-old.d and out-new.d which contains streams data for the NetbootMirrorReader

- got a list of fields in there, and flattened and sorted output.
  run:
    sstream-query --pretty out-old.d/streams/v1/com.ubuntu.installer:released:netboot.json
  That dumps all fields for each item... looks like:
    {'arch': 'i386',
     'basename': 'linux',
     'content_id': 'com.ubuntu.installer:released:netboot',
     'format': 'products:1.0',
     'ftype': 'kernel',
     'image-format': 'default',
     'item_name': 'ututgenke0.default',
     'item_url': 'out-old.d/files/utopic/i386/20101020ubuntu349/utopic/generic/kernel.default',
     'kernel-flavor': 'generic',
     'kernel-release': 'utopic',
     'md5': '4237d65fc81b909684447bf54fd02ce9',
     'path': 'files/utopic/i386/20101020ubuntu349/utopic/generic/kernel.default',
     'pocket': 'release',
     'product_name': 'com.ubuntu.installer:netboot:14.10:i386',
     'pubdate': 'Fri, 17 Oct 2014 15:53:00 +0000',
     'release': 'utopic',
     'sha256': '479619cc6522efb1ceb591bb425fd85d3735e2306de24a1e4345de01a209017c',
     'size': '6077104',
     'version': '14.10',
     'version_name': '20101020ubuntu349'}

- cleaned up the list of fields i wanted to compare to make sure old and new are similar.
  then, sorted that output and diffed them.

  base="%(product_name)s/%(version_name)s/%(item_name)s"
  extra="%(release)s %(version)s %(pocket)s %(kernel-flavor)s %(ftype)s %(image-format)s %(kernel-release)s %(md5)s %(path)s"
  path=streams/v1/com.ubuntu.installer:released:netboot.json

  sstream-query --output-format="$base $extra" out-old.d/$path | sort > old.list
  sstream-query --output-format="$base $extra" out-new.d/$path | sort > new.list

  Then, just diff them
   http://paste.ubuntu.com/11503207/

  Your new had only new entries, and only in wily... so that seems good.

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 2015-02-12 22:14:06 +0000
3+++ meph2/netinst.py 2015-02-19 15:59:01 +0000
4@@ -61,6 +61,10 @@
5 "generic-lpae": "glp",
6 }
7
8+DTB_TO_FORMAT = {
9+ "apm-mustang.dtb": "xgene"
10+}
11+
12 # #
13 # # Under a path like: MIRROR/precise-updates/main/installer-i386/
14 # # we find a listing of directories like:
15@@ -236,7 +240,7 @@
16 # or a tuple of release-kernel, kernel-flavor, initrd-flavor, filetype
17
18 # at the moment the only 'initrd-flavor' that we're supporting is netboot
19- if path.find("netboot") < 0:
20+ if path.find("netboot") < 0 and path.find("device-tree") < 0:
21 return None
22 iflavor = "netboot"
23
24@@ -255,7 +259,18 @@
25 # generic/xgene/uInitrd is generic flavor,
26 # xgene-uboot or xgene-uboot-mustang image
27 imgfmt = "default"
28- if (len(toks) == 3 and toks[0] == "generic" and
29+ if (len(toks) == 4 and toks[1] == "generic" and (toks[3].startswith('uI'))):
30+ path = "%s-netboot/%s/%s" % (release, toks[1], toks[3])
31+ imgfmt = toks[2]
32+ # xgene-uboot -> xgene
33+ imgfmt = re.sub("-uboot$", "", imgfmt)
34+ elif (len(toks) == 2 and toks[0] == "device-tree" and
35+ toks[1].endswith('dtb')):
36+ path = "%s-netboot/generic/%s" % (release, toks[1])
37+ if toks[1] in DTB_TO_FORMAT:
38+ imgfmt = DTB_TO_FORMAT[toks[1]]
39+ # trusty & utopic used this layout for arm64
40+ elif (len(toks) == 3 and toks[0] == "generic" and
41 (toks[2].startswith('uI') or toks[2].endswith('dtb'))):
42 path = "%s-netboot/%s/%s" % (release, toks[0], toks[2])
43 imgfmt = toks[1]
44@@ -345,7 +360,7 @@
45
46 versions = {}
47
48- regex = re.compile(".*netboot")
49+ regex = re.compile(".*(netboot|device-tree)")
50 for (di_ver, pubdate) in usable:
51 versions[di_ver] = {'items': {}}
52 curp = '/'.join((url, di_ver, 'images',))

Subscribers

People subscribed via source and target branches