Merge lp:~zyga/snappy-hub/fix-1464275 into lp:~snappy-dev/snappy-hub/snappy-systems

Proposed by Zygmunt Krynicki
Status: Merged
Approved by: Oliver Grawert
Approved revision: 3
Merged at revision: 4
Proposed branch: lp:~zyga/snappy-hub/fix-1464275
Merge into: lp:~snappy-dev/snappy-hub/snappy-systems
Diff against target: 10 lines (+2/-1)
1 file modified
beagleblack/uEnv.txt (+2/-1)
To merge this branch: bzr merge lp:~zyga/snappy-hub/fix-1464275
Reviewer Review Type Date Requested Status
Oliver Grawert Approve
Leo Arias (community) Approve
Paul Larson (community) Approve
Review via email: mp+261833@code.launchpad.net

Commit message

Allow booting on a beagle bone black that has erased eMMC.

Description of the change

This branch fixes booting on a beagle bone black that has erased eMMC.

The defaults in uboot are hardwired to load configuration from eMMC first (1:2) and that only works if the pre-installed debian that many boards seem to ship with is still intact. We should direct snappy to boot from the SD card unconditionally and ignore anything that may or may not be present on eMMC.

To post a comment you must log in.
Revision history for this message
Loïc Minier (lool) wrote :

this will work, but it's still unclear how this issue remains; if you boot once with this setting, then remove it, you'll notice the board keeps booting from 0:1 and doesn't revert back to 0:2...

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

The issue is caused by bad defaults baked in to our uboot. The defaults _boot_from_the_emmc_. This makes uboot load configs from emmc if it exists (so at this point, all bets are off and emmc can re-define the boot process).

This patch changes the default that we ship. I don't know if we can ship this in uboot but my gut feeling is that it should be per-device (board).

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

(and to make it explicit, currently snappy boots on beagle bone black _just because_ emmc that element 14 devices ship with happens to have a particular setting. Not because our images instruct it do that.

Revision history for this message
Paul Larson (pwlars) wrote :

I'm not sure why you want it to boot from 0:2, but this works for me. Combined with the other image changes for uboot that I'm using on my emmc image, I can reliably boot into the emmc when s2 is not held down, and boot to the sd card when it is held down. +1 from my perspective!

review: Approve
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Ah, sorry, I'm confused, yes, for me the system-boot is 0:1. I also don't understand why Loic wants to boot from 0:2.

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

IIUC, this change will be implemented as part of the beagleblack oem snap? If so, is it possible for me to do this on a live system until this is available in the store?

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Yes.

You can rebuild the snap locally (snappy build) and then rebuild a
clean image with this local version of the snap with:

(help me out, I cannot find it in my bash history)

$ sudo ubuntu-device-flash core 15.04 --device-part
beagleblack_1.7_all.snap --developer-mode -o /tmp/sd-image.bin

Then just transfer that image onto your SD card.

On Mon, Jun 15, 2015 at 8:00 PM, Jamie Strandboge <email address hidden> wrote:
> IIUC, this change will be implemented as part of the beagleblack oem snap? If so, is it possible for me to do this on a live system until this is available in the store?
> --
> https://code.launchpad.net/~zyga/snappy-hub/fix-1464275/+merge/261833
> You are the owner of lp:~zyga/snappy-hub/fix-1464275.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

And you can obviously just add the only relevant line to system-boot/uEnv.txt

On Mon, Jun 15, 2015 at 8:37 PM, Zygmunt Krynicki
<email address hidden> wrote:
> Yes.
>
> You can rebuild the snap locally (snappy build) and then rebuild a
> clean image with this local version of the snap with:
>
> (help me out, I cannot find it in my bash history)
>
> $ sudo ubuntu-device-flash core 15.04 --device-part
> beagleblack_1.7_all.snap --developer-mode -o /tmp/sd-image.bin
>
> Then just transfer that image onto your SD card.
>
> On Mon, Jun 15, 2015 at 8:00 PM, Jamie Strandboge <email address hidden> wrote:
>> IIUC, this change will be implemented as part of the beagleblack oem snap? If so, is it possible for me to do this on a live system until this is available in the store?
>> --
>> https://code.launchpad.net/~zyga/snappy-hub/fix-1464275/+merge/261833
>> You are the owner of lp:~zyga/snappy-hub/fix-1464275.

Revision history for this message
Leo Arias (elopio) wrote :

This test seems to leave the things working as before. I tested install, update, rollback and update to a failed boot: http://pad.ubuntu.com/elopio-snappy-20150615-bug1464275

Now when I boot with or without the boot button pressed, I will end up in the snappy installed on the sdcard.

This makes me wonder if we should offer an option to boot to eMMC. Previously, I could boot to debian by pressing the button, presumably by mistake. Now I have no way to boot to debian.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Booting to Debian will happen if you remove the SD card. The button
doesn't change much here actually. It does change boot order from EMMC
-> SD to SD -> EMMC but in reality, either boot device (if it has
uboot) can boot either system. The problem is that uboot (regardless
of which one we load) will read its environment data from _both_
devices. When it reads environment from our SD card with my patch it
will simply continue to boot from the SD card all the time. If Debian
is supposed to boot reliably then it should ignore environment data on
the SD card but that's beyond the scope of what we need to provide.

IMHO current situation is unacceptable as any intentional or
accidental data on eMMC can break our boot process _even if the SD
button is held pressed_.

On Wed, Jun 17, 2015 at 8:23 AM, Leo Arias <email address hidden> wrote:
> This test seems to leave the things working as before. I tested install, update, rollback and update to a failed boot: http://pad.ubuntu.com/elopio-snappy-20150615-bug1464275
>
> Now when I boot with or without the boot button pressed, I will end up in the snappy installed on the sdcard.
>
> This makes me wonder if we should offer an option to boot to eMMC. Previously, I could boot to debian by pressing the button, presumably by mistake. Now I have no way to boot to debian.
> --
> https://code.launchpad.net/~zyga/snappy-hub/fix-1464275/+merge/261833
> You are the owner of lp:~zyga/snappy-hub/fix-1464275.

Revision history for this message
Leo Arias (elopio) wrote :

Right, so we keep a way to boot to the emmc, then this is good for me.
I think it would be better if we could keep the bbb behaviour of booting to emmc by default and booting to sdcard if the button is pressed, but that would mean to boot to debian by default and we don't want that.
It would be nice to explore how to install snappy to the emmc, and then we could get back to the normal bbb behaviour.

Lets look for an older snappy dev to give the top approve.

review: Approve
Revision history for this message
Oliver Grawert (ogra) wrote :

approved :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'beagleblack/uEnv.txt'
2--- beagleblack/uEnv.txt 2015-04-22 15:46:27 +0000
3+++ beagleblack/uEnv.txt 2015-06-12 10:24:20 +0000
4@@ -2,4 +2,5 @@
5 initrd_addr=0x88080000
6 # load Snappy environment and call into Snappy boot after processing this file
7 uenvcmd=load mmc ${bootpart} ${loadaddr} snappy-system.txt; env import -t $loadaddr $filesize; run snappy_boot
8-
9+# boot from SD, ignoring eMMC (LP: #1464275)
10+bootpart=0:1

Subscribers

People subscribed via source and target branches