Merge lp:~sergiusens/goget-ubuntu-touch/modprobe into lp:goget-ubuntu-touch

Proposed by Sergio Schvezov
Status: Merged
Approved by: Sergio Schvezov
Approved revision: 207
Merged at revision: 205
Proposed branch: lp:~sergiusens/goget-ubuntu-touch/modprobe
Merge into: lp:goget-ubuntu-touch
Diff against target: 113 lines (+47/-9)
4 files modified
dependencies.tsv (+7/-5)
diskimage/common.go (+6/-2)
diskimage/common_test.go (+2/-2)
ubuntu-device-flash/core.go (+32/-0)
To merge this branch: bzr merge lp:~sergiusens/goget-ubuntu-touch/modprobe
Reviewer Review Type Date Requested Status
Sergio Schvezov Approve
Michael Vogt (community) Approve
Review via email: mp+270545@code.launchpad.net

Commit message

Support parsing modprobe from ubuntu-core

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Looks good, thanks!

review: Approve
Revision history for this message
Snappy Tarmac (snappydevtarmac) wrote :
Download full text (4.3 KiB)

The attempt to merge lp:~sergiusens/goget-ubuntu-touch/modprobe into lp:goget-ubuntu-touch failed. Below is the output from the failed tests.

Checking formatting
Installing godeps
Install golint
Obtaining dependencies
update github.com/blakesmith/ar failed; trying to fetch newer version
update github.com/cheggaaa/pb failed; trying to fetch newer version
github.com/blakesmith/ar now at 8bd4349a67f2533b078dbc524689d15dba0f4659
update github.com/jessevdk/go-flags failed; trying to fetch newer version
github.com/cheggaaa/pb now at da1f27ad1d9509b16f65f52fd9d8138b0f2dc7b2
update github.com/mvo5/uboot-go failed; trying to fetch newer version
github.com/jessevdk/go-flags now at 1acbbaff2f347c412a0c7884873bd72cc9c1f5b4
update gopkg.in/yaml.v2 failed; trying to fetch newer version
github.com/mvo5/uboot-go now at 69978a3e4b05cca9d7cfee489b3453dfed45e72c
update launchpad.net/snappy failed; trying to fetch newer version
gopkg.in/yaml.v2 now at 7ad95dd0798a40da1ccdff6dff35fd177b5edf40
update github.com/gosexy/gettext failed; trying to fetch newer version
launchpad.net/snappy now at <email address hidden>
update github.com/mvo5/goconfigparser failed; trying to fetch newer version
github.com/gosexy/gettext now at 98b7b91596d20b96909e6b60d57411547dd9959c
update launchpad.net/gocheck failed; trying to fetch newer version
github.com/mvo5/goconfigparser now at 26426272dda20cc76aa1fa44286dc743d2972fe8
launchpad.net/gocheck now at <email address hidden>
Building
Running tests from /tmp/tmp.VdgtCpmJWR/src/launchpad.net/goget-ubuntu-touch
? launchpad.net/goget-ubuntu-touch/bootimg [no test files]
? launchpad.net/goget-ubuntu-touch/bootimg/example/abootimg-extract [no test files]
? launchpad.net/goget-ubuntu-touch/devices [no test files]
=== RUN Test

----------------------------------------------------------------------
FAIL: common_test.go:43: CommonTestSuite.TestOemInstallPath

common_test.go:50:
    c.Assert(err, IsNil)
... value *errors.errorString = &errors.errorString{s:"oem package not installed"} ("oem package not installed")

OOPS: 8 passed, 1 FAILED
--- FAIL: Test (0.01 seconds)
FAIL
FAIL launchpad.net/goget-ubuntu-touch/diskimage 0.011s
=== RUN Test
OK: 5 passed
--- PASS: Test (0.00 seconds)
PASS
coverage: 33.3% of statements
ok launchpad.net/goget-ubuntu-touch/sysutils 0.009s coverage: 33.3% of statements
? launchpad.net/goget-ubuntu-touch/ubuntu-device-do [no test files]
? launchpad.net/goget-ubuntu-touch/ubuntu-device-flash [no test files]
=== RUN Test
Using /tmp/gocheck-5577006791947779410/0/out/host/linux-x86/bin/emulator for the emulator runtime
OK: 2 passed
--- PASS: Test (0.00 seconds)
PASS
coverage: 4.4% of statements
ok launchpad.net/goget-ubuntu-touch/ubuntu-emulator 0.022s coverage: 4.4% of statements
=== RUN Test
OK: 14 passed
--- PASS: Test (0.01 seconds)
PASS
coverage: 26.1% of statements
ok launchpad.net/goget-ubuntu-touch/ubuntuimage 0.026s coverage: 26.1% of statements

# we always run in a fresh dir in tarmac
export GOPATH=$(mktemp -d)
trap 'rm -rf "$GOPATH"' EXIT

# this is a hack, but not sure tarmac is golang friendly
mkdir -p $GOPATH/src/launchpad...

Read more...

207. By Sergio Schvezov

update tests

Revision history for this message
Sergio Schvezov (sergiusens) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'dependencies.tsv'
--- dependencies.tsv 2015-06-17 12:20:57 +0000
+++ dependencies.tsv 2015-09-09 16:02:22 +0000
@@ -1,7 +1,9 @@
1github.com/blakesmith/ar git c9a977dd0cc1392b023382c7bfa5a22af8d3b730 2013-02-19T04:59:55Z1github.com/blakesmith/ar git 8bd4349a67f2533b078dbc524689d15dba0f4659 2015-03-11T14:59:44Z
2github.com/cheggaaa/pb git e8c7cc515bfde3e267957a3b110080ceed51354e 2014-12-02T07:01:21Z2github.com/cheggaaa/pb git da1f27ad1d9509b16f65f52fd9d8138b0f2dc7b2 2015-08-13T11:06:09Z
3github.com/jessevdk/go-flags git 15347ef417a300349807983f15af9e65cd2e1b3a 2015-01-25T08:53:51Z3github.com/gosexy/gettext git 98b7b91596d20b96909e6b60d57411547dd9959c 2013-02-21T11:21:43Z
4github.com/jessevdk/go-flags git 1acbbaff2f347c412a0c7884873bd72cc9c1f5b4 2015-08-16T10:05:21Z
4github.com/mvo5/goconfigparser git 26426272dda20cc76aa1fa44286dc743d2972fe8 2015-02-12T09:37:50Z5github.com/mvo5/goconfigparser git 26426272dda20cc76aa1fa44286dc743d2972fe8 2015-02-12T09:37:50Z
5gopkg.in/yaml.v2 git 49c95bdc21843256fb6c4e0d370a05f24a0bf213 2015-02-24T22:57:58Z6github.com/mvo5/uboot-go git 69978a3e4b05cca9d7cfee489b3453dfed45e72c 2015-07-23T08:17:10Z
7gopkg.in/yaml.v2 git 7ad95dd0798a40da1ccdff6dff35fd177b5edf40 2015-06-24T10:29:02Z
6launchpad.net/gocheck bzr gustavo@niemeyer.net-20140225173054-xu9zlkf9kxhvow02 878launchpad.net/gocheck bzr gustavo@niemeyer.net-20140225173054-xu9zlkf9kxhvow02 87
7launchpad.net/snappy bzr snappy_tarmac-20150617101203-6hsfxqrckt6koobw 5129launchpad.net/snappy bzr michael.vogt@ubuntu.com-20150909122953-mo6fen3hh907sh2g 660
810
=== modified file 'diskimage/common.go'
--- diskimage/common.go 2015-07-10 17:05:47 +0000
+++ diskimage/common.go 2015-09-09 16:02:22 +0000
@@ -121,7 +121,11 @@
121 }121 }
122 } `yaml:"oem,omitempty"`122 } `yaml:"oem,omitempty"`
123123
124 Config map[string]interface{} `yaml:"config,omitempty"`124 Config struct {
125 UbuntuCore struct {
126 Modprobe *string `yaml:"modprobe,omitempty"`
127 } `yaml:"ubuntu-core,omitempty"`
128 } `yaml:"config,omitempty"`
125129
126 rootDir string130 rootDir string
127}131}
@@ -143,7 +147,7 @@
143}147}
144148
145func (o OemDescription) InstallPath() (string, error) {149func (o OemDescription) InstallPath() (string, error) {
146 glob, err := filepath.Glob(fmt.Sprintf("%s/oem/%s/%s", o.rootDir, o.Name, o.Version))150 glob, err := filepath.Glob(fmt.Sprintf("%s/oem/%s/current", o.rootDir, o.Name))
147 if err != nil {151 if err != nil {
148 return "", err152 return "", err
149 }153 }
150154
=== modified file 'diskimage/common_test.go'
--- diskimage/common_test.go 2015-06-18 20:43:40 +0000
+++ diskimage/common_test.go 2015-09-09 16:02:22 +0000
@@ -41,14 +41,14 @@
41}41}
4242
43func (s *CommonTestSuite) TestOemInstallPath(c *C) {43func (s *CommonTestSuite) TestOemInstallPath(c *C) {
44 err := os.MkdirAll(filepath.Join(s.tmpdir, "oem", s.packageInst, s.oem.Version), 0755)44 err := os.MkdirAll(filepath.Join(s.tmpdir, "oem", s.packageInst, "current"), 0755)
45 c.Assert(err, IsNil)45 c.Assert(err, IsNil)
4646
47 s.oem.SetRoot(s.tmpdir)47 s.oem.SetRoot(s.tmpdir)
48 installPath, err := s.oem.InstallPath()48 installPath, err := s.oem.InstallPath()
4949
50 c.Assert(err, IsNil)50 c.Assert(err, IsNil)
51 c.Assert(installPath, Equals, filepath.Join(s.tmpdir, "oem/packagename/42"))51 c.Assert(installPath, Equals, filepath.Join(s.tmpdir, "oem/packagename/current"))
52}52}
5353
54func (s *CommonTestSuite) TestOemInstallPathNoOem(c *C) {54func (s *CommonTestSuite) TestOemInstallPathNoOem(c *C) {
5555
=== modified file 'ubuntu-device-flash/core.go'
--- ubuntu-device-flash/core.go 2015-06-17 11:33:28 +0000
+++ ubuntu-device-flash/core.go 2015-09-09 16:02:22 +0000
@@ -77,11 +77,43 @@
7777
78 if !coreCmd.Deprecated.Cloud {78 if !coreCmd.Deprecated.Cloud {
79 coreCmd.customizationFunc = append(coreCmd.customizationFunc, coreCmd.setupCloudInit)79 coreCmd.customizationFunc = append(coreCmd.customizationFunc, coreCmd.setupCloudInit)
80 coreCmd.customizationFunc = append(coreCmd.customizationFunc, coreCmd.setupOemConfigs)
80 }81 }
8182
82 return coreCmd.create()83 return coreCmd.create()
83}84}
8485
86// this is a hackish way to get the config in place
87func (coreCmd *CoreCmd) setupOemConfigs() error {
88 modprobeDContent := coreCmd.oem.Config.UbuntuCore.Modprobe
89 if modprobeDContent == nil {
90 printOut("no modprobe")
91 return nil
92 }
93
94 fmt.Println("Setting up oem hooks...")
95
96 writablePath := coreCmd.img.Writable()
97
98 modprobeDir := filepath.Join(writablePath, "system-data", "etc", "modprobe.d")
99 if err := os.MkdirAll(modprobeDir, 0755); err != nil {
100 return err
101 }
102
103 modprobeD := filepath.Join(modprobeDir, "ubuntu-core.conf")
104 modprobeDFile, err := os.Create(modprobeD)
105 if err != nil {
106 return err
107 }
108 defer modprobeDFile.Close()
109
110 if _, err := io.WriteString(modprobeDFile, *modprobeDContent); err != nil {
111 return err
112 }
113
114 return nil
115}
116
85// this function is a hack and should be part of first boot.117// this function is a hack and should be part of first boot.
86func (coreCmd *CoreCmd) setupCloudInit() error {118func (coreCmd *CoreCmd) setupCloudInit() error {
87 systemPath := coreCmd.img.System()119 systemPath := coreCmd.img.System()

Subscribers

People subscribed via source and target branches