Merge lp://staging/~morphis/goget-ubuntu-touch/add-turbo-bootstrap-support into lp://staging/goget-ubuntu-touch

Proposed by Simon Fels
Status: Merged
Approved by: Ɓukasz Zemczak
Approved revision: 239
Merged at revision: 229
Proposed branch: lp://staging/~morphis/goget-ubuntu-touch/add-turbo-bootstrap-support
Merge into: lp://staging/goget-ubuntu-touch
Diff against target: 129 lines (+74/-9)
2 files modified
devices/fastboot.go (+7/-0)
ubuntu-device-flash/touch.go (+67/-9)
To merge this branch: bzr merge lp://staging/~morphis/goget-ubuntu-touch/add-turbo-bootstrap-support
Reviewer Review Type Date Requested Status
Alfonso Sanchez-Beato Approve
Sergio Schvezov Approve
Alex Tu (community) Needs Fixing
Review via email: mp+291583@code.staging.launchpad.net

Commit message

Add bootstrap support for turbo/frieza/cooler devices

The bootloader on turbo/frieza/cooler does not have support for fastboot format <partition> or fastboot boot <image>. Therefor we have to workaround this by using a OEM specific bootloader command to reboot into recovery and adjusting the cleanup of the /cache partition before we push any files.

Also this adds an alias for turbo which is named "smdk" from the bootloader which can't be changed anymore on our production devices.

Description of the change

Corresponding MP for turbo to add the new "format cache" command can be found at https://code.launchpad.net/~morphis/zhongshan/+git/platform_bootable_recovery/+merge/291582

Opened this for a first discussion if we want to add device specific quirks this way.

To post a comment you must log in.
Revision history for this message
Alex Tu (alextu) wrote :

verified the prebuilt one [1] and it works fine on latest engineer mode recovery which enabled adb[2] by command:
$ ubuntu-device-flash touch --channel ubuntu-touch/rc-proposed/meizu.en --recovery-image=${the-recovery[2]}.img --bootstrap --device turbo

[1] https://private-fileshare.canonical.com/~morphis/ubuntu-device-flash
[2] https://git.launchpad.net/~device-release/turbo/+git/recovery/plain/recovery.img

Revision history for this message
Alex Tu (alextu) wrote :

LGTM.

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

Thanks for your contribution, interesting to see what happened when bootloaders are not taken care of early ;-)

The only thing that worries me here is the fact that we only really format cache because there could be files from a failed "flash" there, by wiping we make sure there is enough space. Maybe a message about this when using turbo would be good and make for an easier troubleshoot.

Revision history for this message
Alex Tu (alextu) :
review: Needs Fixing
Revision history for this message
Alex Tu (alextu) wrote :

refer the conversation on irc, we might need to do some more operations to simulate fastboot -w then do update, so the proposed way might be 1. reboot recovery to erase data and cache partition 2. reboot recovery again to do update.

<ondra> alextu as for MP for recovery, so I still believe format cache is needed, but it should do proper cache format, or at least delete all from cache, not skip files under /cache/recovery
<ondra> alextu to fix cases when cache is running out of space and there are some old hanging files
<alextu> ondra, hmm ... agree, it seems no reason to keep updates which in /cache/recovery .
* alextu going to upload another mp for that.
<ondra> alextu problem is that then it's not gonna solve problem morphis|off is addressing with that change, when he wants to emulate fastboot -w
<ondra> alextu which should format userdata and cache
<ondra> alextu but then we wipe tarballs which we need to do install update, so it's kinda broken
<ondra> alextu only thing I can think of is to a) move format chache to the end, so it's formatted at the end of update, so it's safe to wipe it all, or we will need two runs, something like "format cache and userdata and reboot back to recovery" so u-d-f can start pushing files
<alextu> ondra, hmm ... sounds option b) is more like what we want to simulate
<ondra> alextu yep
<alextu> ondra, option a) will also remove cache/device-build which is the version of device tarball which updated by u-d-f
<ondra> alextu true

Revision history for this message
Bin Li (binli) wrote :

After talked with abeato and morphis, we prepare to add 'rm -rf /cache/*' in u-d-f.

Revision history for this message
Bin Li (binli) wrote :

And I read the code, I found the u-d-f will download the tarballs first, then fastboot.format /cache, and reboot into recovery, then call bitPusher to push these tarballs, and before push it will rm previous tarball like below. After that u-d-f push the tarballs into recovery.

adb.Shell("rm -rf /cache/recovery/*.xz /cache/recovery/*.xz.asc")

So for simple I think we just change above line. Is it ok? Thanks!

adb.Shell("rm -rf /cache/*")

Revision history for this message
Bin Li (binli) wrote :
Revision history for this message
Sergio Schvezov (sergiusens) :
review: Approve
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

Sam behaviour has been observed in frieza and cooler. Can we simply try the "rm -rf /cache/*" if format cache has failed?

review: Needs Fixing
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

Tested on cooler now, works fine.

review: Approve
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

Tested on frieza too. Worked as expected.

Revision history for this message
Snappy Tarmac (snappydevtarmac) wrote :

The attempt to merge lp:~morphis/goget-ubuntu-touch/add-turbo-bootstrap-support into lp:goget-ubuntu-touch failed. Below is the output from the failed tests.

Checking formatting
Formatting wrong in following files
ubuntu-device-flash/touch.go

# 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.net/goget-ubuntu-touch
cp -a . $GOPATH/src/launchpad.net/goget-ubuntu-touch
cd $GOPATH/src/launchpad.net/goget-ubuntu-touch

./run-checks

Revision history for this message
Snappy Tarmac (snappydevtarmac) wrote :

The attempt to merge lp:~morphis/goget-ubuntu-touch/add-turbo-bootstrap-support into lp:goget-ubuntu-touch failed. Below is the output from the failed tests.

Checking formatting
Formatting wrong in following files
ubuntu-device-flash/touch.go

# 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.net/goget-ubuntu-touch
cp -a . $GOPATH/src/launchpad.net/goget-ubuntu-touch
cd $GOPATH/src/launchpad.net/goget-ubuntu-touch

./run-checks

239. By Simon Fels

Correct formatting

Revision history for this message
Robert Bruce Park (robru) wrote :

This MP was released through bileto, but then tarmac merged it prematurely, confusing bileto. If you intend to continue using goget-ubuntu-touch in bileto you need to disable tarmac.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches