Merge lp:~canonical-ci-engineering/goget-ubuntu-touch/local_image into lp:goget-ubuntu-touch

Proposed by Celso Providelo on 2015-05-28
Status: Work in progress
Proposed branch: lp:~canonical-ci-engineering/goget-ubuntu-touch/local_image
Merge into: lp:goget-ubuntu-touch
Diff against target: 83 lines (+23/-4)
2 files modified
ubuntu-device-flash/common.go (+5/-0)
ubuntu-device-flash/core.go (+18/-4)
To merge this branch: bzr merge lp:~canonical-ci-engineering/goget-ubuntu-touch/local_image
Reviewer Review Type Date Requested Status
Ubuntu Phablet Team 2015-05-28 Pending
Review via email: mp+260531@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

175. By Joe Talbott on 2015-05-15

u-d-f - Actually use the local image part.

174. By Joe Talbott on 2015-05-15

u-d-f - Add --image-part option for local rootfs image.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntu-device-flash/common.go'
2--- ubuntu-device-flash/common.go 2015-03-30 03:28:28 +0000
3+++ ubuntu-device-flash/common.go 2015-05-28 22:28:04 +0000
4@@ -84,6 +84,11 @@
5 return strings.Contains(path, "device")
6 }
7
8+// isImagePart checks if the file corresponds to the image part.
9+func isImagePart(path string) bool {
10+ return strings.Contains(path, "ubuntu-")
11+}
12+
13 // isCustomPart checks if the file corresponds to the custom part.
14 func isCustomPart(path string) bool {
15 return strings.Contains(path, "custom")
16
17=== modified file 'ubuntu-device-flash/core.go'
18--- ubuntu-device-flash/core.go 2015-05-01 13:31:58 +0000
19+++ ubuntu-device-flash/core.go 2015-05-28 22:28:04 +0000
20@@ -60,6 +60,7 @@
21
22 Development struct {
23 DevicePart string `long:"device-part" description:"Specify a local device part to override the one from the server"`
24+ ImagePart string `long:"image-part" description:"Specify a local image part to override the one from the server"`
25 DeveloperMode bool `long:"developer-mode" description:"Finds the latest public key in your ~/.ssh and sets it up using cloud-init"`
26 EnableSsh bool `long:"enable-ssh" description:"Enable ssh on the image through cloud-init(not needed with developer mode)"`
27 } `group:"Development"`
28@@ -111,6 +112,16 @@
29 devicePart = p
30 }
31
32+ var imagePart string
33+ if coreCmd.Development.ImagePart != "" {
34+ p, err := expandFile(coreCmd.Development.ImagePart)
35+ if err != nil {
36+ return err
37+ }
38+
39+ imagePart = p
40+ }
41+
42 fmt.Println("Determining oem configuration")
43 if err := coreCmd.extractOem(coreCmd.Oem); err != nil {
44 return err
45@@ -180,7 +191,7 @@
46 devicePart = f.FilePath
47
48 if hardware, err := extractHWDescription(f.FilePath); err != nil {
49- fmt.Println("Failed to read harware.yaml from device part, provisioning may fail:", err)
50+ fmt.Println("Failed to read hardware.yaml from device part, provisioning may fail:", err)
51 } else {
52 hwChan <- hardware
53 }
54@@ -196,7 +207,10 @@
55 if devicePart != "" && isDevicePart(f.Path) {
56 printOut("Using a custom device tarball")
57 filesChan <- Files{FilePath: devicePart}
58- } else {
59+ } else if imagePart != "" && isImagePart(f.Path) {
60+ printOut("Using a custom image tarball")
61+ filesChan <- Files{FilePath: imagePart}
62+ }else {
63 go bitDownloader(f, filesChan, globalArgs.Server, cacheDir)
64 }
65 }
66@@ -427,7 +441,7 @@
67 for _, snap := range packageQueue {
68 fmt.Println("Installing", snap)
69
70- pb := progress.NewTextProgress(snap)
71+ pb := progress.NewTextProgress()
72 if _, err := snappy.Install(snap, flags, pb); err != nil {
73 return err
74 }
75@@ -557,7 +571,7 @@
76 })
77
78 flags := coreCmd.installFlags()
79- pb := progress.NewTextProgress(oemPackage)
80+ pb := progress.NewTextProgress()
81 if _, err := snappy.Install(oemPackage, flags, pb); err != nil {
82 return err
83 }

Subscribers

People subscribed via source and target branches