Merge lp:~sergiusens/phablet-tools/image_updates into lp:phablet-tools

Proposed by Sergio Schvezov
Status: Merged
Approved by: Sergio Schvezov
Approved revision: 141
Merged at revision: 139
Proposed branch: lp:~sergiusens/phablet-tools/image_updates
Merge into: lp:phablet-tools
Diff against target: 80 lines (+26/-10)
3 files modified
phablet-flash (+6/-4)
phabletutils/downloads.py (+2/-1)
phabletutils/ubuntuimage.py (+18/-5)
To merge this branch: bzr merge lp:~sergiusens/phablet-tools/image_updates
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Stéphane Graber Approve
Ubuntu Phablet Team Pending
Review via email: mp+175960@code.launchpad.net

Commit message

Added image signing and master download and copy to device

To post a comment you must log in.
140. By Sergio Schvezov

Uncomment the downloader.download statement

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
141. By Sergio Schvezov

Downloading the right files.

Revision history for this message
Stéphane Graber (stgraber) wrote :

Looks good to me.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'phablet-flash'
--- phablet-flash 2013-07-19 01:33:58 +0000
+++ phablet-flash 2013-07-19 22:57:26 +0000
@@ -357,7 +357,8 @@
357 str(json_latest['version'])))357 str(json_latest['version'])))
358 setup_download_directory(download_dir)358 setup_download_directory(download_dir)
359 files = ubuntuimage.download_images(download_dir, json_latest)359 files = ubuntuimage.download_images(download_dir, json_latest)
360 ubuntu_command_path = create_ubuntu_command_file(download_dir, files)360 ubuntu_command_path = create_ubuntu_command_file(download_dir,
361 files['updates'])
361 return files, ubuntu_command_path362 return files, ubuntu_command_path
362363
363364
@@ -365,9 +366,10 @@
365 ubuntu_command_path):366 ubuntu_command_path):
366 adb.reboot(recovery=True)367 adb.reboot(recovery=True)
367 wipe_device(adb)368 wipe_device(adb)
368 for entry in files:369 for key in files:
369 adb.push(entry['filename'], '/cache/recovery/')370 for entry in files[key]:
370 adb.push(entry['signame'], '/cache/recovery/')371 adb.push(entry['filename'], '/cache/recovery/')
372 adb.push(entry['signame'], '/cache/recovery/')
371 adb.push(ubuntu_command_path, '/cache/recovery/ubuntu_command')373 adb.push(ubuntu_command_path, '/cache/recovery/ubuntu_command')
372 adb.reboot(bootloader=True)374 adb.reboot(bootloader=True)
373 fastboot.flash('recovery', recovery_img)375 fastboot.flash('recovery', recovery_img)
374376
=== modified file 'phabletutils/downloads.py'
--- phabletutils/downloads.py 2013-07-11 03:26:21 +0000
+++ phabletutils/downloads.py 2013-07-19 22:57:26 +0000
@@ -25,7 +25,8 @@
25def download(uri, target):25def download(uri, target):
26 '''Downloads an artifact into target.'''26 '''Downloads an artifact into target.'''
27 log.info('Downloading %s' % uri)27 log.info('Downloading %s' % uri)
28 if uri.startswith('http://cdimage.ubuntu.com'):28 if uri.startswith('http://cdimage.ubuntu.com') or \
29 uri.startswith('https://system-image.ubuntu.com'):
29 subprocess.check_call(['wget', '-c', uri, '-O', target])30 subprocess.check_call(['wget', '-c', uri, '-O', target])
30 else:31 else:
31 subprocess.check_call(['curl', '-L', '-C', '-', uri, '-o', target])32 subprocess.check_call(['curl', '-L', '-C', '-', uri, '-o', target])
3233
=== modified file 'phabletutils/ubuntuimage.py'
--- phabletutils/ubuntuimage.py 2013-07-19 01:32:59 +0000
+++ phabletutils/ubuntuimage.py 2013-07-19 22:57:26 +0000
@@ -33,7 +33,8 @@
3333
3434
35def download_images(download_dir, json_list):35def download_images(download_dir, json_list):
36 files = []36 files = {}
37 files['updates'] = []
37 for entry in sorted(json_list['files'], key=lambda entry: entry['order']):38 for entry in sorted(json_list['files'], key=lambda entry: entry['order']):
38 filename = entry['path'].split("/")[-1]39 filename = entry['path'].split("/")[-1]
39 signame = entry['signature'].split("/")[-1]40 signame = entry['signature'].split("/")[-1]
@@ -41,8 +42,20 @@
41 signame_path = os.path.join(download_dir, signame)42 signame_path = os.path.join(download_dir, signame)
42 filename_uri = '%s/%s' % (settings.system_image_uri, entry['path'])43 filename_uri = '%s/%s' % (settings.system_image_uri, entry['path'])
43 signame_uri = '%s/%s' % (settings.system_image_uri, entry['signature'])44 signame_uri = '%s/%s' % (settings.system_image_uri, entry['signature'])
4445 downloads.download(filename_uri, filename_path)
45 downloads.download(filename_uri, filename_path)46 downloads.download(signame_uri, signame_path)
46 downloads.download(signame_uri, signame_path)47 files['updates'].append({'filename': filename_path,
47 files.append({'filename': filename_path, 'signame': signame_path})48 'signame': signame_path})
49 files['base'] = []
50 for keyring in ('image-master', 'image-signing'):
51 filename = '%s.tar.xz' % keyring
52 signame = '%s.asc' % filename
53 filename_path = os.path.join(download_dir, filename)
54 signame_path = os.path.join(download_dir, signame)
55 filename_uri = '%s/gpg/%s' % (settings.system_image_uri, filename)
56 signame_uri = '%s.asc' % filename_uri
57 downloads.download(filename_uri, filename_path)
58 downloads.download(signame_uri, signame_path)
59 files['base'].append({'filename': filename_path,
60 'signame': signame_path})
48 return files61 return files

Subscribers

People subscribed via source and target branches