Merge lp:~mvo/snappy/experimental-simplify-the-upgrader-script into lp:~snappy-dev/snappy/snappy-moved-to-github

Proposed by Michael Vogt
Status: Superseded
Proposed branch: lp:~mvo/snappy/experimental-simplify-the-upgrader-script
Merge into: lp:~snappy-dev/snappy/snappy-moved-to-github
Prerequisite: lp:~mvo/snappy/si-progress
Diff against target: 43 lines (+4/-11)
1 file modified
snappy/systemimage.go (+4/-11)
To merge this branch: bzr merge lp:~mvo/snappy/experimental-simplify-the-upgrader-script
Reviewer Review Type Date Requested Status
Michael Vogt Pending
Review via email: mp+247950@code.launchpad.net

This proposal supersedes a proposal from 2015-01-29.

This proposal has been superseded by a proposal from 2015-01-29.

Description of the change

This branch might be interessting to simplfy the way that ubuntu-core-upgrader
works. The idea is that the DownloadUpdate() call is run with the other
partition mounted RW (DownloadUpdate will also apply the update so its
probably a good idea to update the name to reflect this fact).

This should in turn make the ubuntu-core-upgrader much simpler and allow
us to remove all the mount/unmount logic in there as this is hanlded by
snappy already and it move the responsibility of all this into a single
component (partition.go). We still need to ensure that "sync_partition()"
is called of course in ubuntu-core-upgrader (that is done in _cmd_mount()
right now AFAICS).

To post a comment you must log in.
132. By Michael Vogt

merged lp:snappy and resolved conflicts

Unmerged revisions

132. By Michael Vogt

merged lp:snappy and resolved conflicts

131. By Michael Vogt

Run "DownloadUpdate()" with the other partition mounted RW. This should
allow us to simplify the ubuntu-core-upgrader script significantly by
removing all the mount/umount logic there (making _cmd_mount/_cmd_umount
no-ops). The only catch is that the empty-parititon detection needs to
be done still of course.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'snappy/systemimage.go'
2--- snappy/systemimage.go 2015-01-29 16:31:39 +0000
3+++ snappy/systemimage.go 2015-01-29 16:31:39 +0000
4@@ -136,7 +136,10 @@
5 return err
6 }
7
8- err = s.proxy.DownloadUpdate()
9+ err = s.partition.RunWithOther(partition.RW, func(o string) (err error) {
10+ err = s.proxy.DownloadUpdate()
11+ return
12+ })
13 if err != nil {
14 return err
15 }
16@@ -358,13 +361,8 @@
17 // system-image-dbus daemon caches its configuration file,
18 // so once the D-Bus call completes, it no longer cares
19 // about configFile.
20-<<<<<<< TREE
21 return s.partition.RunWithOther(partition.RO, func(otherRoot string) (err error) {
22- configFile := otherRoot + systemImageClientConfig
23-=======
24- return s.partition.RunWithOther(false, func(otherRoot string) (err error) {
25 configFile := path.Join(otherRoot, systemImageClientConfig)
26->>>>>>> MERGE-SOURCE
27 // FIXME: replace with FileExists() call once it's in a utility
28 // package.
29 _, err = os.Stat(configFile)
30@@ -474,13 +472,8 @@
31 // Returns the part associated with the other rootfs (if any)
32 func (s *SystemImageRepository) otherPart() Part {
33 var part Part
34-<<<<<<< TREE
35 s.partition.RunWithOther(partition.RO, func(otherRoot string) (err error) {
36 configFile := s.myroot + otherRoot + systemImageChannelConfig
37-=======
38- s.partition.RunWithOther(false, func(otherRoot string) (err error) {
39- configFile := path.Join(s.myroot, otherRoot, systemImageChannelConfig)
40->>>>>>> MERGE-SOURCE
41 part, err = s.makePartFromSystemImageConfigFile(configFile, false)
42 if err != nil {
43 log.Printf("Can not make system-image part for %s: %s", configFile, err)

Subscribers

People subscribed via source and target branches