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

Proposed by Celso Providelo
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 Pending
Review via email: mp+260531@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

175. By Joe Talbott

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

174. By Joe Talbott

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
=== modified file 'ubuntu-device-flash/common.go'
--- ubuntu-device-flash/common.go 2015-03-30 03:28:28 +0000
+++ ubuntu-device-flash/common.go 2015-05-28 22:28:04 +0000
@@ -84,6 +84,11 @@
84 return strings.Contains(path, "device")84 return strings.Contains(path, "device")
85}85}
8686
87// isImagePart checks if the file corresponds to the image part.
88func isImagePart(path string) bool {
89 return strings.Contains(path, "ubuntu-")
90}
91
87// isCustomPart checks if the file corresponds to the custom part.92// isCustomPart checks if the file corresponds to the custom part.
88func isCustomPart(path string) bool {93func isCustomPart(path string) bool {
89 return strings.Contains(path, "custom")94 return strings.Contains(path, "custom")
9095
=== modified file 'ubuntu-device-flash/core.go'
--- ubuntu-device-flash/core.go 2015-05-01 13:31:58 +0000
+++ ubuntu-device-flash/core.go 2015-05-28 22:28:04 +0000
@@ -60,6 +60,7 @@
6060
61 Development struct {61 Development struct {
62 DevicePart string `long:"device-part" description:"Specify a local device part to override the one from the server"`62 DevicePart string `long:"device-part" description:"Specify a local device part to override the one from the server"`
63 ImagePart string `long:"image-part" description:"Specify a local image part to override the one from the server"`
63 DeveloperMode bool `long:"developer-mode" description:"Finds the latest public key in your ~/.ssh and sets it up using cloud-init"`64 DeveloperMode bool `long:"developer-mode" description:"Finds the latest public key in your ~/.ssh and sets it up using cloud-init"`
64 EnableSsh bool `long:"enable-ssh" description:"Enable ssh on the image through cloud-init(not needed with developer mode)"`65 EnableSsh bool `long:"enable-ssh" description:"Enable ssh on the image through cloud-init(not needed with developer mode)"`
65 } `group:"Development"`66 } `group:"Development"`
@@ -111,6 +112,16 @@
111 devicePart = p112 devicePart = p
112 }113 }
113114
115 var imagePart string
116 if coreCmd.Development.ImagePart != "" {
117 p, err := expandFile(coreCmd.Development.ImagePart)
118 if err != nil {
119 return err
120 }
121
122 imagePart = p
123 }
124
114 fmt.Println("Determining oem configuration")125 fmt.Println("Determining oem configuration")
115 if err := coreCmd.extractOem(coreCmd.Oem); err != nil {126 if err := coreCmd.extractOem(coreCmd.Oem); err != nil {
116 return err127 return err
@@ -180,7 +191,7 @@
180 devicePart = f.FilePath191 devicePart = f.FilePath
181192
182 if hardware, err := extractHWDescription(f.FilePath); err != nil {193 if hardware, err := extractHWDescription(f.FilePath); err != nil {
183 fmt.Println("Failed to read harware.yaml from device part, provisioning may fail:", err)194 fmt.Println("Failed to read hardware.yaml from device part, provisioning may fail:", err)
184 } else {195 } else {
185 hwChan <- hardware196 hwChan <- hardware
186 }197 }
@@ -196,7 +207,10 @@
196 if devicePart != "" && isDevicePart(f.Path) {207 if devicePart != "" && isDevicePart(f.Path) {
197 printOut("Using a custom device tarball")208 printOut("Using a custom device tarball")
198 filesChan <- Files{FilePath: devicePart}209 filesChan <- Files{FilePath: devicePart}
199 } else {210 } else if imagePart != "" && isImagePart(f.Path) {
211 printOut("Using a custom image tarball")
212 filesChan <- Files{FilePath: imagePart}
213 }else {
200 go bitDownloader(f, filesChan, globalArgs.Server, cacheDir)214 go bitDownloader(f, filesChan, globalArgs.Server, cacheDir)
201 }215 }
202 }216 }
@@ -427,7 +441,7 @@
427 for _, snap := range packageQueue {441 for _, snap := range packageQueue {
428 fmt.Println("Installing", snap)442 fmt.Println("Installing", snap)
429443
430 pb := progress.NewTextProgress(snap)444 pb := progress.NewTextProgress()
431 if _, err := snappy.Install(snap, flags, pb); err != nil {445 if _, err := snappy.Install(snap, flags, pb); err != nil {
432 return err446 return err
433 }447 }
@@ -557,7 +571,7 @@
557 })571 })
558572
559 flags := coreCmd.installFlags()573 flags := coreCmd.installFlags()
560 pb := progress.NewTextProgress(oemPackage)574 pb := progress.NewTextProgress()
561 if _, err := snappy.Install(oemPackage, flags, pb); err != nil {575 if _, err := snappy.Install(oemPackage, flags, pb); err != nil {
562 return err576 return err
563 }577 }

Subscribers

People subscribed via source and target branches