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
1=== modified file 'dependencies.tsv'
2--- dependencies.tsv 2015-06-17 12:20:57 +0000
3+++ dependencies.tsv 2015-09-09 16:02:22 +0000
4@@ -1,7 +1,9 @@
5-github.com/blakesmith/ar git c9a977dd0cc1392b023382c7bfa5a22af8d3b730 2013-02-19T04:59:55Z
6-github.com/cheggaaa/pb git e8c7cc515bfde3e267957a3b110080ceed51354e 2014-12-02T07:01:21Z
7-github.com/jessevdk/go-flags git 15347ef417a300349807983f15af9e65cd2e1b3a 2015-01-25T08:53:51Z
8+github.com/blakesmith/ar git 8bd4349a67f2533b078dbc524689d15dba0f4659 2015-03-11T14:59:44Z
9+github.com/cheggaaa/pb git da1f27ad1d9509b16f65f52fd9d8138b0f2dc7b2 2015-08-13T11:06:09Z
10+github.com/gosexy/gettext git 98b7b91596d20b96909e6b60d57411547dd9959c 2013-02-21T11:21:43Z
11+github.com/jessevdk/go-flags git 1acbbaff2f347c412a0c7884873bd72cc9c1f5b4 2015-08-16T10:05:21Z
12 github.com/mvo5/goconfigparser git 26426272dda20cc76aa1fa44286dc743d2972fe8 2015-02-12T09:37:50Z
13-gopkg.in/yaml.v2 git 49c95bdc21843256fb6c4e0d370a05f24a0bf213 2015-02-24T22:57:58Z
14+github.com/mvo5/uboot-go git 69978a3e4b05cca9d7cfee489b3453dfed45e72c 2015-07-23T08:17:10Z
15+gopkg.in/yaml.v2 git 7ad95dd0798a40da1ccdff6dff35fd177b5edf40 2015-06-24T10:29:02Z
16 launchpad.net/gocheck bzr gustavo@niemeyer.net-20140225173054-xu9zlkf9kxhvow02 87
17-launchpad.net/snappy bzr snappy_tarmac-20150617101203-6hsfxqrckt6koobw 512
18+launchpad.net/snappy bzr michael.vogt@ubuntu.com-20150909122953-mo6fen3hh907sh2g 660
19
20=== modified file 'diskimage/common.go'
21--- diskimage/common.go 2015-07-10 17:05:47 +0000
22+++ diskimage/common.go 2015-09-09 16:02:22 +0000
23@@ -121,7 +121,11 @@
24 }
25 } `yaml:"oem,omitempty"`
26
27- Config map[string]interface{} `yaml:"config,omitempty"`
28+ Config struct {
29+ UbuntuCore struct {
30+ Modprobe *string `yaml:"modprobe,omitempty"`
31+ } `yaml:"ubuntu-core,omitempty"`
32+ } `yaml:"config,omitempty"`
33
34 rootDir string
35 }
36@@ -143,7 +147,7 @@
37 }
38
39 func (o OemDescription) InstallPath() (string, error) {
40- glob, err := filepath.Glob(fmt.Sprintf("%s/oem/%s/%s", o.rootDir, o.Name, o.Version))
41+ glob, err := filepath.Glob(fmt.Sprintf("%s/oem/%s/current", o.rootDir, o.Name))
42 if err != nil {
43 return "", err
44 }
45
46=== modified file 'diskimage/common_test.go'
47--- diskimage/common_test.go 2015-06-18 20:43:40 +0000
48+++ diskimage/common_test.go 2015-09-09 16:02:22 +0000
49@@ -41,14 +41,14 @@
50 }
51
52 func (s *CommonTestSuite) TestOemInstallPath(c *C) {
53- err := os.MkdirAll(filepath.Join(s.tmpdir, "oem", s.packageInst, s.oem.Version), 0755)
54+ err := os.MkdirAll(filepath.Join(s.tmpdir, "oem", s.packageInst, "current"), 0755)
55 c.Assert(err, IsNil)
56
57 s.oem.SetRoot(s.tmpdir)
58 installPath, err := s.oem.InstallPath()
59
60 c.Assert(err, IsNil)
61- c.Assert(installPath, Equals, filepath.Join(s.tmpdir, "oem/packagename/42"))
62+ c.Assert(installPath, Equals, filepath.Join(s.tmpdir, "oem/packagename/current"))
63 }
64
65 func (s *CommonTestSuite) TestOemInstallPathNoOem(c *C) {
66
67=== modified file 'ubuntu-device-flash/core.go'
68--- ubuntu-device-flash/core.go 2015-06-17 11:33:28 +0000
69+++ ubuntu-device-flash/core.go 2015-09-09 16:02:22 +0000
70@@ -77,11 +77,43 @@
71
72 if !coreCmd.Deprecated.Cloud {
73 coreCmd.customizationFunc = append(coreCmd.customizationFunc, coreCmd.setupCloudInit)
74+ coreCmd.customizationFunc = append(coreCmd.customizationFunc, coreCmd.setupOemConfigs)
75 }
76
77 return coreCmd.create()
78 }
79
80+// this is a hackish way to get the config in place
81+func (coreCmd *CoreCmd) setupOemConfigs() error {
82+ modprobeDContent := coreCmd.oem.Config.UbuntuCore.Modprobe
83+ if modprobeDContent == nil {
84+ printOut("no modprobe")
85+ return nil
86+ }
87+
88+ fmt.Println("Setting up oem hooks...")
89+
90+ writablePath := coreCmd.img.Writable()
91+
92+ modprobeDir := filepath.Join(writablePath, "system-data", "etc", "modprobe.d")
93+ if err := os.MkdirAll(modprobeDir, 0755); err != nil {
94+ return err
95+ }
96+
97+ modprobeD := filepath.Join(modprobeDir, "ubuntu-core.conf")
98+ modprobeDFile, err := os.Create(modprobeD)
99+ if err != nil {
100+ return err
101+ }
102+ defer modprobeDFile.Close()
103+
104+ if _, err := io.WriteString(modprobeDFile, *modprobeDContent); err != nil {
105+ return err
106+ }
107+
108+ return nil
109+}
110+
111 // this function is a hack and should be part of first boot.
112 func (coreCmd *CoreCmd) setupCloudInit() error {
113 systemPath := coreCmd.img.System()

Subscribers

People subscribed via source and target branches