New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 837018 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 19
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Feature



Sign in to add a comment

Allow building U-Boot et al into the firmware

Project Member Reported by sjg@chromium.org, Apr 25 2018

Issue description

It is useful to be able to boot into U-Boot (and other boot loaders) in firmware. It has a load of features for booting, plus a nice command line and environment system which can be used to mess around with the hardware and try different use cases.

Add a way to build in 'alternative firmware', with a keyboard shortcut to jump to them, a bit like we jump to legacy firmware with Ctrl-L.
 

Comment 1 by vapier@chromium.org, Apr 26 2018

Components: OS>Firmware>BIOS
Labels: OS-Chrome
do we have the space for this other than the legacy slot ?

Comment 2 by sjg@chromium.org, Apr 26 2018

The SPI flash seems to be huge these days so I think it can be made to work.
Project Member

Comment 3 by bugdroid1@chromium.org, May 5 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/board-overlays/+/a378cfd6105e4204e411f791c81dbcb885bf20aa

commit a378cfd6105e4204e411f791c81dbcb885bf20aa
Author: Simon Glass <sjg@chromium.org>
Date: Sat May 05 08:32:38 2018

Drop unused U-Boot ebuild flags

These are not needed anymore as these two boards do not actually build
U-Boot. Also these flags are no-longer supported by the U-Boot ebuild.
Remove them.

BUG= chromium:837018 
TEST=trybot

Change-Id: Ie626edb31978518ed4278f504608637e07935e9b
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1044925
Reviewed-by: Raul E Rangel <rrangel@chromium.org>

[modify] https://crrev.com/a378cfd6105e4204e411f791c81dbcb885bf20aa/overlay-link/profiles/base/package.use
[delete] https://crrev.com/ca8296fcbd7e965ce8ab84f6a5dadc546c5cf8fb/overlay-variant-daisy-spring/profiles/base/package.use

Project Member

Comment 4 by bugdroid1@chromium.org, May 26 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/board-overlays/+/5456087c1f3438ace32568633d48f466419a46fb

commit 5456087c1f3438ace32568633d48f466419a46fb
Author: Simon Glass <sjg@chromium.org>
Date: Sat May 26 07:21:49 2018

Mask the Chrome OS U-Boot build from beaglebone

We don't want to build the build the main Chrome OS U-Boot. Beaglebone
 always uses its own private version. Mask the package in an attempt
to submit this CL:

https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/1044985

BUG= chromium:837018 
TEST=trybot with beaglebone

Change-Id: I4b5f61053d30b1e0822553f6585b05a5d298c8c2
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1072160
Reviewed-by: Raul E Rangel <rrangel@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[add] https://crrev.com/5456087c1f3438ace32568633d48f466419a46fb/overlay-beaglebone/profiles/base/package.mask
[add] https://crrev.com/5456087c1f3438ace32568633d48f466419a46fb/overlay-beaglebone/profiles/base/eapi

Project Member

Comment 5 by bugdroid1@chromium.org, May 31 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/4e18f030d0e15f611a06c3d26b5c3c7d68fad30e

commit 4e18f030d0e15f611a06c3d26b5c3c7d68fad30e
Author: Simon Glass <sjg@chromium.org>
Date: Thu May 31 19:26:10 2018

u-boot: Rename ebuild to 'u-boot'

This ebuild is called chromeos-u-boot for no good reason. It just makes it
longer to type and suggests that Chrome OS uses its own version of U-Boot,
but it is in fact based on upstream.

Rename it to simply 'u-boot'.

BUG= chromium:837018 
TEST=with other changes, see that 'emerge-grunt u-boot' works

Change-Id: I72ea5b669cc513ad8fa5aa68fca91f1db4f433ca
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1044985
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[copy] https://crrev.com/4e18f030d0e15f611a06c3d26b5c3c7d68fad30e/sys-boot/u-boot/u-boot-2017.05-r2253.ebuild
[rename] https://crrev.com/4e18f030d0e15f611a06c3d26b5c3c7d68fad30e/sys-boot/u-boot/u-boot-9999.ebuild
[rename] https://crrev.com/4e18f030d0e15f611a06c3d26b5c3c7d68fad30e/sys-boot/u-boot/chromeos-u-boot-2017.05-r2252.ebuild
[rename] https://crrev.com/4e18f030d0e15f611a06c3d26b5c3c7d68fad30e/sys-boot/u-boot/files/chromeos-version.sh
[rename] https://crrev.com/4e18f030d0e15f611a06c3d26b5c3c7d68fad30e/chromeos/config/env/sys-boot/u-boot
[modify] https://crrev.com/4e18f030d0e15f611a06c3d26b5c3c7d68fad30e/virtual/u-boot/u-boot-1.ebuild

Project Member

Comment 6 by bugdroid1@chromium.org, Jun 2 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/4342042e901f8a0fa929b642b89f2d1b12bbfaee

commit 4342042e901f8a0fa929b642b89f2d1b12bbfaee
Author: Simon Glass <sjg@chromium.org>
Date: Sat Jun 02 00:44:25 2018

u-boot: Allow building on x86

For some reason the license and scripts only build for ARM at present.
There is no reason for this restriction as U-Boot supports x86 devices.

Update the ebuilds accordingly. Also uprev the EAPI while we are here.

BUG= chromium:837018 
TEST=emerge-grunt u-boot-scripts

Change-Id: I0c880a658c19b68f91d2efa8e1f10efff2db3d53
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1044986
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Raul E Rangel <rrangel@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[rename] https://crrev.com/4342042e901f8a0fa929b642b89f2d1b12bbfaee/chromeos-base/u-boot-scripts/u-boot-scripts-0.0.1-r8.ebuild
[modify] https://crrev.com/4342042e901f8a0fa929b642b89f2d1b12bbfaee/chromeos-base/u-boot-license/u-boot-license-0.0.1.ebuild
[modify] https://crrev.com/4342042e901f8a0fa929b642b89f2d1b12bbfaee/chromeos-base/u-boot-scripts/u-boot-scripts-0.0.1.ebuild
[rename] https://crrev.com/4342042e901f8a0fa929b642b89f2d1b12bbfaee/chromeos-base/u-boot-license/u-boot-license-0.0.1-r2.ebuild

Project Member

Comment 7 by bugdroid1@chromium.org, Jun 12 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/c93dbc6b5d324ed5dec11f18ce1a4f69e16e2af3

commit c93dbc6b5d324ed5dec11f18ce1a4f69e16e2af3
Author: Simon Glass <sjg@chromium.org>
Date: Tue Jun 12 00:29:55 2018

u-boot: Add missing 'dev' in IUSE

The ebuild uses this USE flag but it is not declared. Fix this.

BUG= chromium:837018 
TEST=emerge-grunt u-boot

Change-Id: I77068b04cb1e554de1e1b9a53f7e096219964d6e
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1044987
Reviewed-by: Raul E Rangel <rrangel@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/c93dbc6b5d324ed5dec11f18ce1a4f69e16e2af3/sys-boot/u-boot/u-boot-9999.ebuild

Project Member

Comment 8 by bugdroid1@chromium.org, Jul 13

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/3568feae4ebe0394f55e2872f78c704df6b3bc00

commit 3568feae4ebe0394f55e2872f78c704df6b3bc00
Author: Simon Glass <sjg@chromium.org>
Date: Fri Jul 13 18:50:39 2018

u-boot: Drop old ebuild

This old ebuild is not used anymore, and cause a warning. Drop it.

BUG= chromium:837018 
TEST=emerge-grunt u-boot

Change-Id: I8e0b748e888e47c0f4570e1104d77a33c7e2abc3
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1134359
Reviewed-by: Raul E Rangel <rrangel@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[delete] https://crrev.com/39557722d6fb9cc6949cc584b0f8d3fab4ef8197/sys-boot/u-boot/chromeos-u-boot-2017.05-r2252.ebuild

Project Member

Comment 9 by bugdroid1@chromium.org, Jul 16

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/307702ada4495aad936f641abfc00f6222f35d02

commit 307702ada4495aad936f641abfc00f6222f35d02
Author: Simon Glass <sjg@chromium.org>
Date: Mon Jul 16 02:43:46 2018

chromeos-bootimage: Add an option to include U-Boot

U-Boot is a boot loader widely used on ARM devices. It also has support
for some x86 boards. It is useful to be able to include this in a firmware
image, for hardware testing and developer-mode flexibility. Add a USE flag
to install it.

BUG= chromium:837018 
TEST=USE=u_boot emerge-grunt chromeos-bootimage
See that it includes U-Boot:
$ cbfstool  /build/grunt/firmware/image-grunt.serial.bin print -r RW_LEGACY
Name                           Offset     Type           Size   Comp
u-boot                         0x0        simple elf     221535 none
(empty)                        0x361c0    null          7642584 none

Change-Id: I095fe0a330b6ce9424e0f08110c9564072456771
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1010840
Reviewed-by: Raul E Rangel <rrangel@chromium.org>

[modify] https://crrev.com/307702ada4495aad936f641abfc00f6222f35d02/sys-boot/chromeos-bootimage/chromeos-bootimage-0.0.3.ebuild
[rename] https://crrev.com/307702ada4495aad936f641abfc00f6222f35d02/sys-boot/chromeos-bootimage/chromeos-bootimage-0.0.3-r26.ebuild

Status: Assigned (was: Untriaged)
This bug has an owner, thus, it's been triaged. Changing status to "assigned".
Project Member

Comment 11 by bugdroid1@chromium.org, Sep 5

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/depthcharge/+/370d8acb6cc989cd0b111774144e59fb2f6f2e79

commit 370d8acb6cc989cd0b111774144e59fb2f6f2e79
Author: Simon Glass <sjg@chromium.org>
Date: Tue Sep 04 23:53:48 2018

Split out code from legacy bootloader support

We want to support loading different boot loaders from a specified area.
Move the code into a new payload.c file, and generalise it to support
a given payload name, rather than just "payload". Also allow the area to
be specified.

BUG= chromium:837018 
BRANCH=none
TEST=manually check that Ctrl-L still boots into a legacy payload

Change-Id: If6b1349f277e831f22aaee42a5a644ad3c8a1b9e
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1159386

[add] https://crrev.com/370d8acb6cc989cd0b111774144e59fb2f6f2e79/src/boot/payload.c
[add] https://crrev.com/370d8acb6cc989cd0b111774144e59fb2f6f2e79/src/boot/payload.h
[modify] https://crrev.com/370d8acb6cc989cd0b111774144e59fb2f6f2e79/src/vboot/callbacks/legacy.c
[modify] https://crrev.com/370d8acb6cc989cd0b111774144e59fb2f6f2e79/src/boot/Makefile.inc

Description: Show this description
Summary: Allow building U-Boot et al into the firmware (was: Allow building U-Boot into the firmware)
Project Member

Comment 14 by bugdroid1@chromium.org, Sep 26

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/d59f1d8f3b4141ee3ec230eccf094bfd4db25471

commit d59f1d8f3b4141ee3ec230eccf094bfd4db25471
Author: Simon Glass <sjg@chromium.org>
Date: Wed Sep 26 03:41:00 2018

chromeos-bootimage: Build support for alternative boot loaders

At present we support a single boot loader in the RW_LEGACY section.
Expand this (with USE=altfw) to support muultiple boot loaders, with the
first one being U-Boot. The existing USE=u-boot flag is now used to
indicate that U-Boot should be *one of* the available options.

BUG= chromium:837018 
BRANCH=grunt
TEST=USE="altfw u-boot -cb_legacy_tianocore em100-mode" emerge-grunt \
	--nodeps u-boot depthcharge chromeos-bootimage
With other changes, manually test booting into U-Boot on Grunt by
pressing '1'

Change-Id: Ia75f000b61113b72f5c79186725ccec1f3c76f1e
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1231856
Reviewed-by: Julius Werner <jwerner@chromium.org>

[modify] https://crrev.com/d59f1d8f3b4141ee3ec230eccf094bfd4db25471/sys-boot/chromeos-bootimage/chromeos-bootimage-0.0.3.ebuild
[rename] https://crrev.com/d59f1d8f3b4141ee3ec230eccf094bfd4db25471/sys-boot/chromeos-bootimage/chromeos-bootimage-0.0.3-r34.ebuild

Project Member

Comment 15 by bugdroid1@chromium.org, Sep 26

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/depthcharge/+/a15c1475696c7334bd5f31063ac5291094c61e49

commit a15c1475696c7334bd5f31063ac5291094c61e49
Author: Simon Glass <sjg@chromium.org>
Date: Wed Sep 26 21:59:54 2018

Add support for jumping into alternative firmware

Allow selection of the boot loader to boot with VbExLegacy(). This uses
a file which lists the available boot loaders.

Later work will update Ctrl-L to present a menu of available options. For
now it just boots the backup "payload".

CQ-DEPEND=CL:1060854
BUG= chromium:837018 
BRANCH=grunt
TEST=emerge-grunt --nodeps depthcharge
With other changes, manually test booting into U-Boot on Grunt by
pressing '1'

Change-Id: Ied700de4976740d2ae457cf7a3a31d2d835ce00b
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1228875
Reviewed-by: Julius Werner <jwerner@chromium.org>

[modify] https://crrev.com/a15c1475696c7334bd5f31063ac5291094c61e49/src/drivers/flash/cbfs.h
[modify] https://crrev.com/a15c1475696c7334bd5f31063ac5291094c61e49/src/boot/payload.c
[modify] https://crrev.com/a15c1475696c7334bd5f31063ac5291094c61e49/src/boot/payload.h
[modify] https://crrev.com/a15c1475696c7334bd5f31063ac5291094c61e49/src/drivers/flash/cbfs.c
[modify] https://crrev.com/a15c1475696c7334bd5f31063ac5291094c61e49/src/vboot/callbacks/legacy.c

Project Member

Comment 16 by bugdroid1@chromium.org, Sep 26

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/89a517730f0207dbef9b3ff219d360904dca456e

commit 89a517730f0207dbef9b3ff219d360904dca456e
Author: Simon Glass <sjg@chromium.org>
Date: Wed Sep 26 21:59:54 2018

Add support for booting into alternative boot loaders

Add a generic way of selecting an alternative bootloader to run from the
developer-mode menu. This enables keys 1-9 to select a particular numbered
bootloader.

Adjust VbExLegacy() to take a numeric parameter to signal which boot
loader to run.

CQ-DEPEND=CL:1228875
BUG= chromium:837018 
BRANCH=none
TEST=FEATURES=test emerge-grunt --nodeps vboot_reference

Change-Id: I02eab1b87e21a6401ec42317c4c1fa1bd2767b53
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1060854
Reviewed-by: Julius Werner <jwerner@chromium.org>

[modify] https://crrev.com/89a517730f0207dbef9b3ff219d360904dca456e/tests/vboot_detach_menu_tests.c
[modify] https://crrev.com/89a517730f0207dbef9b3ff219d360904dca456e/firmware/lib/vboot_ui_menu.c
[modify] https://crrev.com/89a517730f0207dbef9b3ff219d360904dca456e/firmware/lib/vboot_ui.c
[modify] https://crrev.com/89a517730f0207dbef9b3ff219d360904dca456e/firmware/include/vboot_api.h
[modify] https://crrev.com/89a517730f0207dbef9b3ff219d360904dca456e/tests/vboot_api_kernel2_tests.c
[modify] https://crrev.com/89a517730f0207dbef9b3ff219d360904dca456e/firmware/stub/vboot_api_stub.c

Project Member

Comment 17 by bugdroid1@chromium.org, Sep 29

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/7f8087276c9fb6e7d98029aa6e1a4e2f5a025a80

commit 7f8087276c9fb6e7d98029aa6e1a4e2f5a025a80
Author: Simon Glass <sjg@chromium.org>
Date: Sat Sep 29 07:27:22 2018

edk2: Install the tianocore image

At present we only install CBFS (Coreboot Filesystem) image in /firmware.
Install the actual tianocore image as well so that we can use this with
the altfw (alternative firmware) feature.

At some point we may wish to remove the CBFS option, but leave it for now.

BUG= chromium:837018 
BRANCH=grunt
TEST=emerge-grunt edk2
$ ls /build/grunt/firmware/tianocore
UEFIPAYLOAD.fd

Change-Id: I85023bbe2759c54336d1954cb0aa5fb0564b91f7
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1251881
Reviewed-by: Julius Werner <jwerner@chromium.org>

[modify] https://crrev.com/7f8087276c9fb6e7d98029aa6e1a4e2f5a025a80/sys-boot/edk2/edk2-9999.ebuild

Project Member

Comment 18 by bugdroid1@chromium.org, Sep 29

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/2a93c68d2c8834141c3a9bf2bcdd5620a20c3933

commit 2a93c68d2c8834141c3a9bf2bcdd5620a20c3933
Author: Simon Glass <sjg@chromium.org>
Date: Sat Sep 29 07:27:23 2018

chromeos-bootimage: Add support for tianocore in altfw

At present we only support U-Boot as alternative firmware. Add tiancore
too.

BUG= chromium:837018 
BRANCH=grunt
TEST=USE="altfw u-boot tianofcore -cb_legacy_tianocore em100-mode" \
	emerge-grunt --nodeps u-boot edk2 chromeos-bootimage
Manually test booting into tianocore on Grunt by pressing '2'

Change-Id: I80831ebb3f79d5b3c589a90e06d7b76fc09e6aa2
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1251882
Reviewed-by: Julius Werner <jwerner@chromium.org>

[modify] https://crrev.com/2a93c68d2c8834141c3a9bf2bcdd5620a20c3933/sys-boot/chromeos-bootimage/chromeos-bootimage-0.0.3.ebuild
[rename] https://crrev.com/2a93c68d2c8834141c3a9bf2bcdd5620a20c3933/sys-boot/chromeos-bootimage/chromeos-bootimage-0.0.3-r35.ebuild

While these modifications are being submitted, is it expected that beaglebone-release builder fails when building u-boot? E.g. http://cros-goldeneye/chromeos/healthmonitoring/buildDetails?buildbucketId=8933846308747506608

u-boot-2013.07-r10: /usr/include/libfdt_env.h:71:30: error: conflicting types for 'fdt64_t'
u-boot-2013.07-r10:  typedef uint64_t FDT_BITWISE fdt64_t;
u-boot-2013.07-r10:                               ^
u-boot-2013.07-r10: In file included from <command-line>:0:0:
u-boot-2013.07-r10: /build/beaglebone/tmp/portage/sys-boot/u-boot-2013.07-r10/work/u-boot-2013.07/include/libfdt_env.h:31:16: note: previous declaration of 'fdt64_t' was here
u-boot-2013.07-r10:  typedef __be64 fdt64_t;
u-boot-2013.07-r10:                 ^
u-boot-2013.07-r10: In file included from /build/beaglebone/tmp/portage/sys-boot/u-boot-2013.07-r10/work/u-boot-2013.07/include/libfdt_env.h:24:0,
u-boot-2013.07-r10:                  from <command-line>:0:
... etc ...
u-boot-2013.07-r10:  * ERROR: sys-boot/u-boot-2013.07-r10::beaglebone failed (compile phase):
u-boot-2013.07-r10:  *   emake failed

Wow that is a really old U-Boot. Is there not a CQ builder for it?

But yes it is possible. we might need a hack to fix it.
Cc: sjg@chromium.org
 Issue 891103  has been merged into this issue.
beaglebone-paladin works fine. Only beaglebone_release and beaglebone_servo-release consistently fail since the builds of 2018-09-29 03:18/03:31. 
(E.g. https://cros-goldeneye.corp.google.com/chromeos/legoland/builderHistory?buildConfig=beaglebone-release&buildBranch=master)
Hm, and similar issues are seen on romer, cobblepot, capri-zfpga, this time on CQ builders. Are those related to beaglebone?

loonix-u-boot-2017.05: /usr/include/libfdt_env.h:71:30: error: typedef redefinition with different
loonix-u-boot-2017.05:       types ('uint64_t' (aka 'unsigned long') vs '__be64' (aka
loonix-u-boot-2017.05:       'unsigned long long'))
loonix-u-boot-2017.05: typedef uint64_t FDT_BITWISE fdt64_t;
loonix-u-boot-2017.05:                              ^
loonix-u-boot-2017.05: /build/romer/tmp/portage/sys-boot/loonix-u-boot-2017.05/work/u-boot-2017.05/include/libfdt_env.h:19:16: note: 
loonix-u-boot-2017.05:       previous definition is here
loonix-u-boot-2017.05: typedef __be64 fdt64_t;
loonix-u-boot-2017.05:                ^

...

Packages failed:
	sys-boot/loonix-u-boot-2017.05
The problem isn't just with beaglebone. The problem is likely with anyone using an old u-boot and the new dtc headers. Let's reopen  bug 891103  to target that specifically, if it's having widespread problems.
I suspect it makes sense to de-dup  issue 891103  and track fixing it there.
Project Member

Comment 26 by bugdroid1@chromium.org, Oct 4

Project Member

Comment 27 by bugdroid1@chromium.org, Oct 5

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/manifest/+/27caa4e69d84d99b72ccb893f3b74f039c5f689f

commit 27caa4e69d84d99b72ccb893f3b74f039c5f689f
Author: Simon Glass <sjg@chromium.org>
Date: Fri Oct 05 22:43:24 2018

u-boot: Switch to 2018.09

Use the newer U-Boot so it can boot on Grunt.

BUG= chromium:837018 
TEST=did not actually test this except by diffing against internal
manifest

Change-Id: If5e183cdc830f01b0d5490d60327a86f8f854a3d
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1260052
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/27caa4e69d84d99b72ccb893f3b74f039c5f689f/full.xml

Project Member

Comment 28 by bugdroid1@chromium.org, Oct 8

The following revision refers to this bug:
  https://chrome-internal.googlesource.com/chromeos/manifest-internal/+/65e20ec1fdf7cb344ce1634d86a20c8369e3998c

commit 65e20ec1fdf7cb344ce1634d86a20c8369e3998c
Author: Simon Glass <sjg@chromium.org>
Date: Mon Oct 08 13:22:04 2018

Project Member

Comment 29 by bugdroid1@chromium.org, Oct 11

Labels: merge-merged-chromeos-v2018.09
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/u-boot/+/c8c41554f803a2b55f144d53c7b8c3774713e74d

commit c8c41554f803a2b55f144d53c7b8c3774713e74d
Author: Simon Glass <sjg@chromium.org>
Date: Thu Oct 11 04:33:38 2018

grunt: Adjust serial config

Adjust the coreboot serial config so that grunt works correctly. Since
grunt is the only board supporting U-Boot we can do this globally for now.

BUG= chromium:837018 
BRANCH=grunt
TEST=FW_NAME=grunt USE="altfw u-boot tianocore -cb_legacy_tianocore em100-mode" \
	emerge-grunt --nodeps -q u-boot depthcharge chromeos-bootimage
See that we can boot into U-Boot from the menu and the display and UART
work.

Change-Id: I2cd3e79e22c94fa2e61927272e71ff17125708f7
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1273930
Reviewed-by: Raul E Rangel <rrangel@chromium.org>

[modify] https://crrev.com/c8c41554f803a2b55f144d53c7b8c3774713e74d/arch/x86/dts/serial.dtsi
[modify] https://crrev.com/c8c41554f803a2b55f144d53c7b8c3774713e74d/include/configs/x86-common.h

Project Member

Comment 30 by bugdroid1@chromium.org, Oct 11

Labels: merge-merged-firmware-grunt-11031.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/depthcharge/+/59b2223134c508d097afef4334012bd420dd26f7

commit 59b2223134c508d097afef4334012bd420dd26f7
Author: Simon Glass <sjg@chromium.org>
Date: Thu Oct 11 18:20:53 2018

Split out code from legacy bootloader support

We want to support loading different boot loaders from a specified area.
Move the code into a new payload.c file, and generalise it to support
a given payload name, rather than just "payload". Also allow the area to
be specified.

BUG= chromium:837018 
BRANCH=none
TEST=manually check that Ctrl-L still boots into a legacy payload

Change-Id: If6b1349f277e831f22aaee42a5a644ad3c8a1b9e
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1159386
(cherry picked from commit 370d8acb6cc989cd0b111774144e59fb2f6f2e79)
Reviewed-on: https://chromium-review.googlesource.com/c/1277305
Reviewed-by: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>

[add] https://crrev.com/59b2223134c508d097afef4334012bd420dd26f7/src/boot/payload.c
[add] https://crrev.com/59b2223134c508d097afef4334012bd420dd26f7/src/boot/payload.h
[modify] https://crrev.com/59b2223134c508d097afef4334012bd420dd26f7/src/vboot/callbacks/legacy.c
[modify] https://crrev.com/59b2223134c508d097afef4334012bd420dd26f7/src/boot/Makefile.inc

Project Member

Comment 31 by bugdroid1@chromium.org, Oct 11

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/depthcharge/+/f072d4e43920c9c74db8ea4a0cd4c8151ab3407d

commit f072d4e43920c9c74db8ea4a0cd4c8151ab3407d
Author: Simon Glass <sjg@chromium.org>
Date: Thu Oct 11 18:22:55 2018

Add support for jumping into alternative firmware

Allow selection of the boot loader to boot with VbExLegacy(). This uses
a file which lists the available boot loaders.

Later work will update Ctrl-L to present a menu of available options. For
now it just boots the backup "payload".

CQ-DEPEND=CL:1060854
BUG= chromium:837018 
BRANCH=grunt
TEST=emerge-grunt --nodeps depthcharge
With other changes, manually test booting into U-Boot on Grunt by
pressing '1'

Change-Id: Ied700de4976740d2ae457cf7a3a31d2d835ce00b
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1228875
Reviewed-by: Julius Werner <jwerner@chromium.org>
(cherry picked from commit a15c1475696c7334bd5f31063ac5291094c61e49)
Reviewed-on: https://chromium-review.googlesource.com/c/1277193
Reviewed-by: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>

[modify] https://crrev.com/f072d4e43920c9c74db8ea4a0cd4c8151ab3407d/src/drivers/flash/cbfs.h
[modify] https://crrev.com/f072d4e43920c9c74db8ea4a0cd4c8151ab3407d/src/boot/payload.c
[modify] https://crrev.com/f072d4e43920c9c74db8ea4a0cd4c8151ab3407d/src/boot/payload.h
[modify] https://crrev.com/f072d4e43920c9c74db8ea4a0cd4c8151ab3407d/src/drivers/flash/cbfs.c
[modify] https://crrev.com/f072d4e43920c9c74db8ea4a0cd4c8151ab3407d/src/vboot/callbacks/legacy.c

Project Member

Comment 32 by bugdroid1@chromium.org, Oct 11

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/61511927b9b2415fba167b2ec3a7a7d6d746b82c

commit 61511927b9b2415fba167b2ec3a7a7d6d746b82c
Author: Simon Glass <sjg@chromium.org>
Date: Thu Oct 11 18:30:34 2018

Add support for booting into alternative boot loaders

Add a generic way of selecting an alternative bootloader to run from the
developer-mode menu. This enables keys 1-9 to select a particular numbered
bootloader.

Adjust VbExLegacy() to take a numeric parameter to signal which boot
loader to run.

CQ-DEPEND=CL:1228875
BUG= chromium:837018 
BRANCH=none
TEST=FEATURES=test emerge-grunt --nodeps vboot_reference

Change-Id: I02eab1b87e21a6401ec42317c4c1fa1bd2767b53
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1060854
Reviewed-by: Julius Werner <jwerner@chromium.org>
(cherry picked from commit 89a517730f0207dbef9b3ff219d360904dca456e)
Reviewed-on: https://chromium-review.googlesource.com/c/1277325
Reviewed-by: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>

[modify] https://crrev.com/61511927b9b2415fba167b2ec3a7a7d6d746b82c/tests/vboot_detach_menu_tests.c
[modify] https://crrev.com/61511927b9b2415fba167b2ec3a7a7d6d746b82c/firmware/lib/vboot_ui_menu.c
[modify] https://crrev.com/61511927b9b2415fba167b2ec3a7a7d6d746b82c/firmware/lib/vboot_ui.c
[modify] https://crrev.com/61511927b9b2415fba167b2ec3a7a7d6d746b82c/firmware/include/vboot_api.h
[modify] https://crrev.com/61511927b9b2415fba167b2ec3a7a7d6d746b82c/tests/vboot_api_kernel2_tests.c
[modify] https://crrev.com/61511927b9b2415fba167b2ec3a7a7d6d746b82c/firmware/stub/vboot_api_stub.c

Project Member

Comment 33 by bugdroid1@chromium.org, Oct 11

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/0dd49c0f4a6ccb9134e3c8f59c99bdd8b0cf8b21

commit 0dd49c0f4a6ccb9134e3c8f59c99bdd8b0cf8b21
Author: Simon Glass <sjg@chromium.org>
Date: Thu Oct 11 18:31:04 2018

chromeos-bootimage: Build support for alternative boot loaders

At present we support a single boot loader in the RW_LEGACY section.
Expand this (with USE=altfw) to support muultiple boot loaders, with the
first one being U-Boot. The existing USE=u-boot flag is now used to
indicate that U-Boot should be *one of* the available options.

BUG= chromium:837018 
BRANCH=grunt
TEST=USE="altfw u-boot -cb_legacy_tianocore em100-mode" emerge-grunt \
	--nodeps u-boot depthcharge chromeos-bootimage
With other changes, manually test booting into U-Boot on Grunt by
pressing '1'

Change-Id: Ia75f000b61113b72f5c79186725ccec1f3c76f1e
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1231856
Reviewed-by: Julius Werner <jwerner@chromium.org>
(cherry picked from commit d59f1d8f3b4141ee3ec230eccf094bfd4db25471)
Reviewed-on: https://chromium-review.googlesource.com/c/1277205
Reviewed-by: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>

[modify] https://crrev.com/0dd49c0f4a6ccb9134e3c8f59c99bdd8b0cf8b21/sys-boot/chromeos-bootimage/chromeos-bootimage-0.0.3.ebuild
[rename] https://crrev.com/0dd49c0f4a6ccb9134e3c8f59c99bdd8b0cf8b21/sys-boot/chromeos-bootimage/chromeos-bootimage-0.0.3-r34.ebuild

Project Member

Comment 34 by bugdroid1@chromium.org, Oct 11

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/7d4d025aa9450ff45aa3a14d8dc050d8e7d572da

commit 7d4d025aa9450ff45aa3a14d8dc050d8e7d572da
Author: Simon Glass <sjg@chromium.org>
Date: Thu Oct 11 18:31:21 2018

edk2: Install the tianocore image

At present we only install CBFS (Coreboot Filesystem) image in /firmware.
Install the actual tianocore image as well so that we can use this with
the altfw (alternative firmware) feature.

At some point we may wish to remove the CBFS option, but leave it for now.

BUG= chromium:837018 
BRANCH=grunt
TEST=emerge-grunt edk2
$ ls /build/grunt/firmware/tianocore
UEFIPAYLOAD.fd

Change-Id: I85023bbe2759c54336d1954cb0aa5fb0564b91f7
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1251881
Reviewed-by: Julius Werner <jwerner@chromium.org>
(cherry picked from commit 7f8087276c9fb6e7d98029aa6e1a4e2f5a025a80)
Reviewed-on: https://chromium-review.googlesource.com/c/1277206
Reviewed-by: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>

[modify] https://crrev.com/7d4d025aa9450ff45aa3a14d8dc050d8e7d572da/sys-boot/edk2/edk2-9999.ebuild

Project Member

Comment 35 by bugdroid1@chromium.org, Oct 14

Project Member

Comment 36 by bugdroid1@chromium.org, Oct 14

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/1f3eabe444bd863691a581b95a4bde8c4b1fb155

commit 1f3eabe444bd863691a581b95a4bde8c4b1fb155
Author: Simon Glass <sjg@chromium.org>
Date: Sun Oct 14 23:52:56 2018

chromeos-bootimage: Add support for tianocore in altfw

At present we only support U-Boot as alternative firmware. Add tiancore
too.

BUG= chromium:837018 
BRANCH=grunt
TEST=USE="altfw u-boot tianofcore -cb_legacy_tianocore em100-mode" \
	emerge-grunt --nodeps u-boot edk2 chromeos-bootimage
Manually test booting into tianocore on Grunt by pressing '2'

Change-Id: I80831ebb3f79d5b3c589a90e06d7b76fc09e6aa2
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1251882
Reviewed-by: Julius Werner <jwerner@chromium.org>
(cherry picked from commit 2a93c68d2c8834141c3a9bf2bcdd5620a20c3933)
Reviewed-on: https://chromium-review.googlesource.com/c/1277805
Reviewed-by: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>

[modify] https://crrev.com/1f3eabe444bd863691a581b95a4bde8c4b1fb155/sys-boot/chromeos-bootimage/chromeos-bootimage-0.0.3.ebuild
[rename] https://crrev.com/1f3eabe444bd863691a581b95a4bde8c4b1fb155/sys-boot/chromeos-bootimage/chromeos-bootimage-0.0.3-r35.ebuild

Project Member

Comment 37 by bugdroid1@chromium.org, Oct 18

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/d07dab0a90c34a303664c6182aa74745a6119267

commit d07dab0a90c34a303664c6182aa74745a6119267
Author: Simon Glass <sjg@chromium.org>
Date: Thu Oct 18 21:53:46 2018

chromeos-bootimage: Use tianocore as the default for legacy

With altfw we currently don't define a default bootloader. For now let's
use Tianocore for that, if it is available.

BUG= chromium:837018 
BRANCH=grunt
TEST=FW_NAME=grunt USE="altfw u-boot tianocore -cb_legacy_tianocore em100-mode" \
	emerge-grunt --nodeps -q chromeos-bootimage
See that '0' shows up as an option, and boots TianoCore

Change-Id: I7b300d81ebb6d52b6e3a65c0921762d0681b2559
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1274165
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>

[modify] https://crrev.com/d07dab0a90c34a303664c6182aa74745a6119267/sys-boot/chromeos-bootimage/chromeos-bootimage-0.0.3.ebuild
[rename] https://crrev.com/d07dab0a90c34a303664c6182aa74745a6119267/sys-boot/chromeos-bootimage/chromeos-bootimage-0.0.3-r36.ebuild

Project Member

Comment 38 by bugdroid1@chromium.org, Oct 19

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/c61d34f02b9210f5b42cc072bbdcbadd19058d88

commit c61d34f02b9210f5b42cc072bbdcbadd19058d88
Author: Simon Glass <sjg@chromium.org>
Date: Fri Oct 19 02:01:10 2018

Move developer menu code higher in the file

We want to reuse this code for the altfw feature. Move it up in the file
to permit this without needing forward declarations.

BUG= chromium:837018 
BRANCH=none
TEST=FEATURES=test emerge-grunt --nodeps vboot_reference

Change-Id: I02e6cdfb1ea7d5b48e272a778976cdaf50378235
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1286217
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Randall Spangler <rspangler@chromium.org>

[modify] https://crrev.com/c61d34f02b9210f5b42cc072bbdcbadd19058d88/firmware/lib/vboot_ui_menu.c

Project Member

Comment 39 by bugdroid1@chromium.org, Oct 19

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/ebd087a925e3b3c62c5b6ba98f951848844ffdf3

commit ebd087a925e3b3c62c5b6ba98f951848844ffdf3
Author: Simon Glass <sjg@chromium.org>
Date: Fri Oct 19 02:01:10 2018

Add a variable for allowing alternative firmware

At present the condition for this is checked in one place in
boot_legacy_action(). We need to be able to check it in more than one
place, so put it in a variable when entering developer mode. This matches
how the keyboard UI works.

BUG= chromium:837018 
BRANCH=none
TEST=FEATURES=test emerge-grunt --nodeps vboot_reference

Change-Id: Iaf01b827095b0a1139a36af6834eba4dbf7fb150
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1286218
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Randall Spangler <rspangler@chromium.org>

[modify] https://crrev.com/ebd087a925e3b3c62c5b6ba98f951848844ffdf3/firmware/lib/vboot_ui_menu.c

Project Member

Comment 40 by bugdroid1@chromium.org, Oct 19

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/7fb621f3f8432dd3f171c9477f8940574142c76b

commit 7fb621f3f8432dd3f171c9477f8940574142c76b
Author: Simon Glass <sjg@chromium.org>
Date: Fri Oct 19 15:58:00 2018

Split out functions which handle alternative firmware

At present we have all the logic for this feature in VbTryLegacy(). In
preparation for adding a new menu for alternative firmware, split the
logic into two pieces: preparing to start alternative firware, and
cleaning up afterwards if nothing booted.

Also export these functions so that they can be used by the detachable
UI.

BUG= chromium:837018 
BRANCH=none
TEST=FEATURES=test emerge-grunt --nodeps vboot_reference

Change-Id: I560634ebb03a7f02a488defa32b83e51001d018e
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1286219
Reviewed-by: Randall Spangler <rspangler@chromium.org>

[modify] https://crrev.com/7fb621f3f8432dd3f171c9477f8940574142c76b/firmware/lib/include/vboot_kernel.h
[modify] https://crrev.com/7fb621f3f8432dd3f171c9477f8940574142c76b/firmware/lib/vboot_ui.c

Project Member

Comment 41 by bugdroid1@chromium.org, Oct 19

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/25e898ff2f7e52e81d07f6849ff9a9227d81066a

commit 25e898ff2f7e52e81d07f6849ff9a9227d81066a
Author: Simon Glass <sjg@chromium.org>
Date: Fri Oct 19 15:58:00 2018

Export vb2_error_beep()

This code is used in both the keyboard and detachable UIs. Make it into a
common function and export it.

BUG= chromium:837018 
BRANCH=none
TEST=FEATURES=test emerge-grunt --nodeps vboot_reference

Change-Id: I1e2cf67ec3fce9bc78ad412ddcc34e0eaecab5eb
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1286220
Reviewed-by: Randall Spangler <rspangler@chromium.org>

[modify] https://crrev.com/25e898ff2f7e52e81d07f6849ff9a9227d81066a/firmware/lib/include/vboot_kernel.h
[modify] https://crrev.com/25e898ff2f7e52e81d07f6849ff9a9227d81066a/firmware/lib/vboot_ui_menu.c
[modify] https://crrev.com/25e898ff2f7e52e81d07f6849ff9a9227d81066a/firmware/lib/vboot_ui.c

Project Member

Comment 42 by bugdroid1@chromium.org, Oct 19

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/4d4c36e9df592548ae169cf6f145ecc9399a7963

commit 4d4c36e9df592548ae169cf6f145ecc9399a7963
Author: Simon Glass <sjg@chromium.org>
Date: Fri Oct 19 15:58:01 2018

Add a constant for the escape key

We use this in a few places, so add a constant.

BUG= chromium:837018 
BRANCH=none
TEST=FEATURES=test emerge-grunt --nodeps vboot_reference

Change-Id: I7182d0ac52c23c01397de08683ad83b818486f91
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1286221
Reviewed-by: Randall Spangler <rspangler@chromium.org>

[modify] https://crrev.com/4d4c36e9df592548ae169cf6f145ecc9399a7963/tests/vboot_api_kernel2_tests.c
[modify] https://crrev.com/4d4c36e9df592548ae169cf6f145ecc9399a7963/firmware/include/vboot_api.h
[modify] https://crrev.com/4d4c36e9df592548ae169cf6f145ecc9399a7963/firmware/lib/vboot_ui.c

Project Member

Comment 43 by bugdroid1@chromium.org, Oct 19

Project Member

Comment 44 by bugdroid1@chromium.org, Oct 19

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/0a8457d7e239ca6b4031c459662b6402988f3598

commit 0a8457d7e239ca6b4031c459662b6402988f3598
Author: Simon Glass <sjg@chromium.org>
Date: Fri Oct 19 18:34:07 2018

chromeos-bootimage: Use tianocore as the default for legacy

With altfw we currently don't define a default bootloader. For now let's
use Tianocore for that, if it is available.

BUG= chromium:837018 
BRANCH=grunt
TEST=FW_NAME=grunt USE="altfw u-boot tianocore -cb_legacy_tianocore em100-mode" \
	emerge-grunt --nodeps -q chromeos-bootimage
See that '0' shows up as an option, and boots TianoCore

Change-Id: I7b300d81ebb6d52b6e3a65c0921762d0681b2559
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/1289772
Reviewed-by: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>

[modify] https://crrev.com/0a8457d7e239ca6b4031c459662b6402988f3598/sys-boot/chromeos-bootimage/chromeos-bootimage-0.0.3.ebuild
[rename] https://crrev.com/0a8457d7e239ca6b4031c459662b6402988f3598/sys-boot/chromeos-bootimage/chromeos-bootimage-0.0.3-r36.ebuild

Project Member

Comment 45 by bugdroid1@chromium.org, Oct 20

Project Member

Comment 46 by bugdroid1@chromium.org, Oct 23

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/71d798dce54e34ba836e7187e7d526396dce52e0

commit 71d798dce54e34ba836e7187e7d526396dce52e0
Author: Simon Glass <sjg@chromium.org>
Date: Tue Oct 23 22:34:00 2018

Move developer menu code higher in the file

We want to reuse this code for the altfw feature. Move it up in the file
to permit this without needing forward declarations.

BUG= chromium:837018 
BRANCH=none
TEST=FEATURES=test emerge-grunt --nodeps vboot_reference

Change-Id: I02e6cdfb1ea7d5b48e272a778976cdaf50378235
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1286217
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/1297019
Reviewed-by: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>

[modify] https://crrev.com/71d798dce54e34ba836e7187e7d526396dce52e0/firmware/lib/vboot_ui_menu.c

Project Member

Comment 47 by bugdroid1@chromium.org, Oct 23

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/81c0742458dbfb94226ff4616eba9e1cbeaa902d

commit 81c0742458dbfb94226ff4616eba9e1cbeaa902d
Author: Simon Glass <sjg@chromium.org>
Date: Tue Oct 23 22:34:20 2018

Add a variable for allowing alternative firmware

At present the condition for this is checked in one place in
boot_legacy_action(). We need to be able to check it in more than one
place, so put it in a variable when entering developer mode. This matches
how the keyboard UI works.

BUG= chromium:837018 
BRANCH=none
TEST=FEATURES=test emerge-grunt --nodeps vboot_reference

Change-Id: Iaf01b827095b0a1139a36af6834eba4dbf7fb150
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1286218
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/1297020
Reviewed-by: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>

[modify] https://crrev.com/81c0742458dbfb94226ff4616eba9e1cbeaa902d/firmware/lib/vboot_ui_menu.c

Project Member

Comment 48 by bugdroid1@chromium.org, Oct 23

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/4ffc10efe7eab8b2fbd5ba8e442a49a8b802ad6b

commit 4ffc10efe7eab8b2fbd5ba8e442a49a8b802ad6b
Author: Simon Glass <sjg@chromium.org>
Date: Tue Oct 23 22:34:47 2018

Split out functions which handle alternative firmware

At present we have all the logic for this feature in VbTryLegacy(). In
preparation for adding a new menu for alternative firmware, split the
logic into two pieces: preparing to start alternative firware, and
cleaning up afterwards if nothing booted.

Also export these functions so that they can be used by the detachable
UI.

BUG= chromium:837018 
BRANCH=none
TEST=FEATURES=test emerge-grunt --nodeps vboot_reference

Change-Id: I560634ebb03a7f02a488defa32b83e51001d018e
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1286219
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/1297021
Reviewed-by: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>

[modify] https://crrev.com/4ffc10efe7eab8b2fbd5ba8e442a49a8b802ad6b/firmware/lib/include/vboot_kernel.h
[modify] https://crrev.com/4ffc10efe7eab8b2fbd5ba8e442a49a8b802ad6b/firmware/lib/vboot_ui.c

Project Member

Comment 49 by bugdroid1@chromium.org, Oct 23

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/4a71d293dbf200396b90e502825165b5c7bd494c

commit 4a71d293dbf200396b90e502825165b5c7bd494c
Author: Simon Glass <sjg@chromium.org>
Date: Tue Oct 23 22:34:59 2018

Export vb2_error_beep()

This code is used in both the keyboard and detachable UIs. Make it into a
common function and export it.

BUG= chromium:837018 
BRANCH=none
TEST=FEATURES=test emerge-grunt --nodeps vboot_reference

Change-Id: I1e2cf67ec3fce9bc78ad412ddcc34e0eaecab5eb
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1286220
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/1297022
Reviewed-by: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>

[modify] https://crrev.com/4a71d293dbf200396b90e502825165b5c7bd494c/firmware/lib/include/vboot_kernel.h
[modify] https://crrev.com/4a71d293dbf200396b90e502825165b5c7bd494c/firmware/lib/vboot_ui_menu.c
[modify] https://crrev.com/4a71d293dbf200396b90e502825165b5c7bd494c/firmware/lib/vboot_ui.c

Project Member

Comment 50 by bugdroid1@chromium.org, Oct 25

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/be12758e72ee4b87c6ef1585549fab2f1acd91f6

commit be12758e72ee4b87c6ef1585549fab2f1acd91f6
Author: Simon Glass <sjg@chromium.org>
Date: Thu Oct 25 03:07:17 2018

amd64: Use alternative firmware

Adjust all 64-bit boards to use the alffw feature to provide a menu of
bootloaders to run.

BUG= chromium:837018 
TEST=USE=seabios emerge-coral chromeos-bootimage
See that altfw is enabled and provides a menu now.
(also tested on grunt)

Change-Id: Ibda781cd2d044caa9d045b43add6fa2edff46276
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1274167
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>

[modify] https://crrev.com/be12758e72ee4b87c6ef1585549fab2f1acd91f6/profiles/default/linux/amd64/10.0/chromeos/package.use

Project Member

Comment 51 by bugdroid1@chromium.org, Oct 25

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/b31ac271da5c41b27f854f866dd31d3238544a43

commit b31ac271da5c41b27f854f866dd31d3238544a43
Author: Simon Glass <sjg@chromium.org>
Date: Thu Oct 25 19:06:20 2018

Add a constant for the escape key

We use this in a few places, so add a constant.

BUG= chromium:837018 
BRANCH=none
TEST=FEATURES=test emerge-grunt --nodeps vboot_reference

Change-Id: I7182d0ac52c23c01397de08683ad83b818486f91
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1286221
Reviewed-by: Randall Spangler <rspangler@chromium.org>
(cherry picked from commit 4d4c36e9df592548ae169cf6f145ecc9399a7963)
Reviewed-on: https://chromium-review.googlesource.com/c/1299607
Reviewed-by: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>

[modify] https://crrev.com/b31ac271da5c41b27f854f866dd31d3238544a43/tests/vboot_api_kernel2_tests.c
[modify] https://crrev.com/b31ac271da5c41b27f854f866dd31d3238544a43/firmware/include/vboot_api.h
[modify] https://crrev.com/b31ac271da5c41b27f854f866dd31d3238544a43/firmware/lib/vboot_ui.c

Project Member

Comment 52 by bugdroid1@chromium.org, Oct 27

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/e156d3a3ec014d148009a1fe4e2fe97d5560d66e

commit e156d3a3ec014d148009a1fe4e2fe97d5560d66e
Author: Simon Glass <sjg@chromium.org>
Date: Sat Oct 27 00:19:12 2018

Add a parameter to vb2_error_beep()

We have two different types of beep each with its own meaning:

   - two high beeps:   not allowed
   - single low beep:  allowed but it failed

Add an enum to cover this and update all callers. In VbTryUsb() there is a
delay after the beep but that does not seem to be needed, so drop it.

BUG= chromium:837018 
BRANCH=none
TEST=FEATURES=test emerge-grunt --nodeps vboot_reference

Change-Id: I824d088d1a51aeb5a35b5978a05533e8eabcf8f6
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1292246
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>

[modify] https://crrev.com/e156d3a3ec014d148009a1fe4e2fe97d5560d66e/firmware/lib/include/vboot_kernel.h
[modify] https://crrev.com/e156d3a3ec014d148009a1fe4e2fe97d5560d66e/firmware/lib/vboot_ui_menu.c
[modify] https://crrev.com/e156d3a3ec014d148009a1fe4e2fe97d5560d66e/firmware/lib/vboot_ui.c

Project Member

Comment 53 by bugdroid1@chromium.org, Oct 30

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/0d10f5726bf27fdd74da4e87ebea44276f1c4982

commit 0d10f5726bf27fdd74da4e87ebea44276f1c4982
Author: Simon Glass <sjg@chromium.org>
Date: Tue Oct 30 22:09:26 2018

Add a parameter to vb2_error_beep()

We have two different types of beep each with its own meaning:

   - two high beeps:   not allowed
   - single low beep:  allowed but it failed

Add an enum to cover this and update all callers. In VbTryUsb() there is a
delay after the beep but that does not seem to be needed, so drop it.

BUG= chromium:837018 
BRANCH=none
TEST=FEATURES=test emerge-grunt --nodeps vboot_reference

Change-Id: I824d088d1a51aeb5a35b5978a05533e8eabcf8f6
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1292246
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
(cherry picked from commit e156d3a3ec014d148009a1fe4e2fe97d5560d66e)
Reviewed-on: https://chromium-review.googlesource.com/c/1308605
Reviewed-by: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>

[modify] https://crrev.com/0d10f5726bf27fdd74da4e87ebea44276f1c4982/firmware/lib/include/vboot_kernel.h
[modify] https://crrev.com/0d10f5726bf27fdd74da4e87ebea44276f1c4982/firmware/lib/vboot_ui_menu.c
[modify] https://crrev.com/0d10f5726bf27fdd74da4e87ebea44276f1c4982/firmware/lib/vboot_ui.c

Project Member

Comment 54 by bugdroid1@chromium.org, Nov 1

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/90407e9bc1f77de570aad2d45beb73db5ee8382b

commit 90407e9bc1f77de570aad2d45beb73db5ee8382b
Author: Simon Glass <sjg@chromium.org>
Date: Thu Nov 01 09:17:43 2018

Unify the rest of the beeps

In some cases we use a a single high beep to signal an error. It does not
seem important to distinguish this from any other kind of error, so just
use the existing case.

All beeping now goes through vb2_error_beep(), except for one beep in
vboot_audio.c.

We could move vb2_error_beep() to vboot_audio.c, but the beeps seem to be
a part of the UI rather than the audio system. Of course,
vb2_audio_looping() arguable is also...

BUG= chromium:837018 
BRANCH=none
TEST=FEATURES=test emerge-grunt --nodeps vboot_reference

Change-Id: I55807b4548987a621e8bbced97e7710d6cd6d5fb
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1292247
Reviewed-by: Julius Werner <jwerner@chromium.org>

[modify] https://crrev.com/90407e9bc1f77de570aad2d45beb73db5ee8382b/firmware/lib/vboot_ui.c

Project Member

Comment 55 by bugdroid1@chromium.org, Nov 1

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/0a29eb399a35c4d8e9e0473a448bbe3837e7d89b

commit 0a29eb399a35c4d8e9e0473a448bbe3837e7d89b
Author: Simon Glass <sjg@chromium.org>
Date: Thu Nov 01 09:17:44 2018

Pass all calls to VBExLegacy() through a single function

It is important that we lock the TPM before calling this function. We have
several places where the function is called. Reduce the risk that the TPM
is no locked by running all calls through a single point. Drop the
vb2_exit_altfw() function as it is not needed now.

We rely on being able to call RollbackKernelLock() multiple times since it
ignores subsequent calls and does not attempt to lock the TPM twice.

With the menu UI this causes a small change in behaviour: when starting
legacy firmware fails the screen flashes AFTER the beep instead of before.
Hopefully this difference is not important.

Future work will unify the two UI more.

BUG= chromium:837018 
BRANCH=none
TEST=FEATURES=test emerge-grunt --nodeps vboot_reference

Change-Id: I0ee0b52eb57c30c1e1bb4a7e60e11d060025ab17
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1292248
Reviewed-by: Julius Werner <jwerner@chromium.org>

[modify] https://crrev.com/0a29eb399a35c4d8e9e0473a448bbe3837e7d89b/firmware/lib/vboot_ui_common.c
[modify] https://crrev.com/0a29eb399a35c4d8e9e0473a448bbe3837e7d89b/firmware/lib/include/vboot_kernel.h
[modify] https://crrev.com/0a29eb399a35c4d8e9e0473a448bbe3837e7d89b/firmware/lib/vboot_ui_menu.c
[modify] https://crrev.com/0a29eb399a35c4d8e9e0473a448bbe3837e7d89b/firmware/lib/include/vboot_ui_common.h
[modify] https://crrev.com/0a29eb399a35c4d8e9e0473a448bbe3837e7d89b/firmware/lib/vboot_ui.c

Project Member

Comment 56 by bugdroid1@chromium.org, Nov 1

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/8ed28879229b62f3860286b2b1985af713d3e05a

commit 8ed28879229b62f3860286b2b1985af713d3e05a
Author: Simon Glass <sjg@chromium.org>
Date: Thu Nov 01 09:17:43 2018

Create a new file for common vboot UI functions

Rather than having vboot_ui be the common file between that and
vboot_ui_menu, create a new file.

For now just move over vb2_error_beep(). The other common functions are
being removed in future CLs.

BUG= chromium:837018 
BRANCH=none
TEST=FEATURES=test emerge-grunt --nodeps vboot_reference

Change-Id: Iff6917642ff79ea0b5cce60b383876b6f7174d20
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1310794
Reviewed-by: Julius Werner <jwerner@chromium.org>

[modify] https://crrev.com/8ed28879229b62f3860286b2b1985af713d3e05a/firmware/lib/vboot_ui_menu.c
[modify] https://crrev.com/8ed28879229b62f3860286b2b1985af713d3e05a/firmware/lib/vboot_ui.c
[modify] https://crrev.com/8ed28879229b62f3860286b2b1985af713d3e05a/Makefile
[modify] https://crrev.com/8ed28879229b62f3860286b2b1985af713d3e05a/firmware/lib/include/vboot_kernel.h
[add] https://crrev.com/8ed28879229b62f3860286b2b1985af713d3e05a/firmware/lib/include/vboot_ui_common.h
[add] https://crrev.com/8ed28879229b62f3860286b2b1985af713d3e05a/firmware/lib/vboot_ui_common.c

Project Member

Comment 57 by bugdroid1@chromium.org, Nov 14

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/09df2b1ff13025617b737073ee3db5e5bfc4a6b5

commit 09df2b1ff13025617b737073ee3db5e5bfc4a6b5
Author: Simon Glass <sjg@chromium.org>
Date: Wed Nov 14 18:57:27 2018

Unify the rest of the beeps

In some cases we use a a single high beep to signal an error. It does not
seem important to distinguish this from any other kind of error, so just
use the existing case.

All beeping now goes through vb2_error_beep(), except for one beep in
vboot_audio.c.

We could move vb2_error_beep() to vboot_audio.c, but the beeps seem to be
a part of the UI rather than the audio system. Of course,
vb2_audio_looping() arguable is also...

BUG= chromium:837018 
BRANCH=none
TEST=FEATURES=test emerge-grunt --nodeps vboot_reference

Change-Id: I55807b4548987a621e8bbced97e7710d6cd6d5fb
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1292247
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/1335658
Reviewed-by: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>

[modify] https://crrev.com/09df2b1ff13025617b737073ee3db5e5bfc4a6b5/firmware/lib/vboot_ui.c

Project Member

Comment 58 by bugdroid1@chromium.org, Nov 14

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/12f278d1fc26efa3da2fe594a9300720b0e30578

commit 12f278d1fc26efa3da2fe594a9300720b0e30578
Author: Simon Glass <sjg@chromium.org>
Date: Wed Nov 14 18:57:34 2018

Create a new file for common vboot UI functions

Rather than having vboot_ui be the common file between that and
vboot_ui_menu, create a new file.

For now just move over vb2_error_beep(). The other common functions are
being removed in future CLs.

BUG= chromium:837018 
BRANCH=none
TEST=FEATURES=test emerge-grunt --nodeps vboot_reference

Change-Id: Iff6917642ff79ea0b5cce60b383876b6f7174d20
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1310794
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/1335659
Reviewed-by: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>

[modify] https://crrev.com/12f278d1fc26efa3da2fe594a9300720b0e30578/firmware/lib/vboot_ui_menu.c
[modify] https://crrev.com/12f278d1fc26efa3da2fe594a9300720b0e30578/firmware/lib/vboot_ui.c
[modify] https://crrev.com/12f278d1fc26efa3da2fe594a9300720b0e30578/Makefile
[modify] https://crrev.com/12f278d1fc26efa3da2fe594a9300720b0e30578/firmware/lib/include/vboot_kernel.h
[add] https://crrev.com/12f278d1fc26efa3da2fe594a9300720b0e30578/firmware/lib/include/vboot_ui_common.h
[add] https://crrev.com/12f278d1fc26efa3da2fe594a9300720b0e30578/firmware/lib/vboot_ui_common.c

Project Member

Comment 59 by bugdroid1@chromium.org, Nov 14

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/4a9b54b2fbe0f0cbb7982f0b7430984c5e2c94ab

commit 4a9b54b2fbe0f0cbb7982f0b7430984c5e2c94ab
Author: Simon Glass <sjg@chromium.org>
Date: Wed Nov 14 18:57:42 2018

Pass all calls to VBExLegacy() through a single function

It is important that we lock the TPM before calling this function. We have
several places where the function is called. Reduce the risk that the TPM
is no locked by running all calls through a single point. Drop the
vb2_exit_altfw() function as it is not needed now.

We rely on being able to call RollbackKernelLock() multiple times since it
ignores subsequent calls and does not attempt to lock the TPM twice.

With the menu UI this causes a small change in behaviour: when starting
legacy firmware fails the screen flashes AFTER the beep instead of before.
Hopefully this difference is not important.

Future work will unify the two UI more.

BUG= chromium:837018 
BRANCH=none
TEST=FEATURES=test emerge-grunt --nodeps vboot_reference

Change-Id: I0ee0b52eb57c30c1e1bb4a7e60e11d060025ab17
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1292248
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/1335660
Reviewed-by: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>

[modify] https://crrev.com/4a9b54b2fbe0f0cbb7982f0b7430984c5e2c94ab/firmware/lib/vboot_ui_common.c
[modify] https://crrev.com/4a9b54b2fbe0f0cbb7982f0b7430984c5e2c94ab/firmware/lib/include/vboot_kernel.h
[modify] https://crrev.com/4a9b54b2fbe0f0cbb7982f0b7430984c5e2c94ab/firmware/lib/vboot_ui_menu.c
[modify] https://crrev.com/4a9b54b2fbe0f0cbb7982f0b7430984c5e2c94ab/firmware/lib/include/vboot_ui_common.h
[modify] https://crrev.com/4a9b54b2fbe0f0cbb7982f0b7430984c5e2c94ab/firmware/lib/vboot_ui.c

Project Member

Comment 60 by bugdroid1@chromium.org, Nov 16

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/depthcharge/+/03bea468a1c550ccd0bf4c0370e80932e486a631

commit 03bea468a1c550ccd0bf4c0370e80932e486a631
Author: Simon Glass <sjg@chromium.org>
Date: Fri Nov 16 13:01:45 2018

Implement the menu screen for alternative firmware

Show a new screen with a list of bootloaders which can be selected using
the number keys. The list is displayed by depthcharge, in English only.

Item 0 is the default but always exists as a separation option, so don't
show it in the menu.

Also adjust the list adding algorithm, so that items remain in the order
set by chromeos-bootimage.

CQ-DEPEND=CL:1273268
BUG= chromium:837018 
BRANCH=grunt
TEST=emerge-grunt --nodeps depthcharge
With other changes, show the menu with Ctrl-L, exit with Esc and select
a bootloader with keys 0, 1 or 2

Change-Id: I2ce95c6d6a873934978074b7bca665c82e31871d
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1273269
Reviewed-by: Julius Werner <jwerner@chromium.org>

[modify] https://crrev.com/03bea468a1c550ccd0bf4c0370e80932e486a631/src/vboot/callbacks/display.c
[modify] https://crrev.com/03bea468a1c550ccd0bf4c0370e80932e486a631/src/vboot/screens.h
[modify] https://crrev.com/03bea468a1c550ccd0bf4c0370e80932e486a631/src/vboot/screens.c
[modify] https://crrev.com/03bea468a1c550ccd0bf4c0370e80932e486a631/src/boot/payload.h
[modify] https://crrev.com/03bea468a1c550ccd0bf4c0370e80932e486a631/src/vboot/callbacks/legacy.c
[modify] https://crrev.com/03bea468a1c550ccd0bf4c0370e80932e486a631/src/boot/payload.c

Project Member

Comment 61 by bugdroid1@chromium.org, Nov 16

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/a0ae31871275b389ea0f8b99ee4de359970b7db6

commit a0ae31871275b389ea0f8b99ee4de359970b7db6
Author: Simon Glass <sjg@chromium.org>
Date: Fri Nov 16 13:01:45 2018

Add a screen showing a menu for alternative firmware

At present we allow the user to press a keypad number to boot into another
bootloader but there is no indication which one is which.

Add a new screen for this. It is entered via Ctrl-L and shows the
available bootloaders, along with the number to press for each. The
contents of the screen is rendered by the bootloader, as usual.

This is supported by two new screens, one for the keyboard UI and one for
the menu UI. Also a new function, VbExGetAltFwIdxMask(), is added to find
out what bootloaders are available.

Note: This CL combines changes for both UIs. The changes may be easier to
review separately.

CQ-DEPEND=CL:1273269
BUG= chromium:837018 
BRANCH=none
TEST=FEATURES=test emerge-grunt --nodeps vboot_reference

Change-Id: Ib3227545dc677c8f9587944753e32f3b49647360
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1273268
Reviewed-by: Julius Werner <jwerner@chromium.org>

[modify] https://crrev.com/a0ae31871275b389ea0f8b99ee4de359970b7db6/tests/vboot_detach_menu_tests.c
[modify] https://crrev.com/a0ae31871275b389ea0f8b99ee4de359970b7db6/tests/vboot_display_tests.c
[modify] https://crrev.com/a0ae31871275b389ea0f8b99ee4de359970b7db6/firmware/lib/vboot_ui_menu.c
[modify] https://crrev.com/a0ae31871275b389ea0f8b99ee4de359970b7db6/firmware/lib/vboot_ui.c
[modify] https://crrev.com/a0ae31871275b389ea0f8b99ee4de359970b7db6/firmware/lib/vboot_display.c
[modify] https://crrev.com/a0ae31871275b389ea0f8b99ee4de359970b7db6/firmware/include/vboot_api.h
[modify] https://crrev.com/a0ae31871275b389ea0f8b99ee4de359970b7db6/tests/vboot_api_kernel2_tests.c
[modify] https://crrev.com/a0ae31871275b389ea0f8b99ee4de359970b7db6/firmware/lib/include/vboot_ui_common.h
[modify] https://crrev.com/a0ae31871275b389ea0f8b99ee4de359970b7db6/firmware/lib/vboot_ui_common.c
[modify] https://crrev.com/a0ae31871275b389ea0f8b99ee4de359970b7db6/firmware/lib/include/vboot_ui_menu_private.h

Project Member

Comment 62 by bugdroid1@chromium.org, Nov 18

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/b1e26df828b01bd7a148cee7a2b2d6ddcd821774

commit b1e26df828b01bd7a148cee7a2b2d6ddcd821774
Author: Simon Glass <sjg@chromium.org>
Date: Sun Nov 18 00:41:38 2018

chromeos-bootimage: Add support for seabios in altfw

At present we only support U-Boot and TianoCore as alternative firmware.
Add SeaBIOS too.

BUG= chromium:837018 
BRANCH=grunt
TEST=USE="altfw seabios em100-mode" \
	emerge-grunt --nodeps chromeos-seabios chromeos-bootimage
Manually test booting into tianocore on Grunt by pressing '3'

Change-Id: I7ab6c64fc4bb6f5fc825cc08051ed29796bfa08d
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1292992
Commit-Ready: Duncan Laurie <dlaurie@google.com>

[modify] https://crrev.com/b1e26df828b01bd7a148cee7a2b2d6ddcd821774/sys-boot/chromeos-bootimage/chromeos-bootimage-0.0.3.ebuild
[modify] https://crrev.com/b1e26df828b01bd7a148cee7a2b2d6ddcd821774/sys-boot/chromeos-seabios/chromeos-seabios-9999.ebuild
[rename] https://crrev.com/b1e26df828b01bd7a148cee7a2b2d6ddcd821774/sys-boot/chromeos-bootimage/chromeos-bootimage-0.0.3-r43.ebuild

Status: Fixed (was: Assigned)
The basic feature is in now so I'm closing this.

Will file other bugs for new features, e.g. crbug.com/903833
Project Member

Comment 64 by bugdroid1@chromium.org, Nov 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/ffd8d4aaab33fa04c429159d222b42750dbe23e4

commit ffd8d4aaab33fa04c429159d222b42750dbe23e4
Author: Joel Kitching <kitching@google.com>
Date: Tue Nov 20 13:52:34 2018

chromeos-bootimage: add altfw payload hashing

Under certain circumstances, we would like to allow booting
only Google-issued RW_LEGACY firmware.  In order to allow for
the option to verify the payload being booted, we calculate
and store SHA-256 hashes of each payload in AP-RW CBFS, which
is signed and rollback-protected already as part of AP-RW.

A hash of each payload will be stored in the file:

  altfw_hash/<name>.sha256

Originally written prior to altfw as CL:1169027.

BUG=b:110721285,b:111577108,b:119384389,b:118786884, chromium:837018 
TEST=USE="altfw tianocore" emerge-eve chromeos-bootimage
     cbfstool image.bin print -r FW_MAIN_A
     check for altfw_hash/tianocore.sha256
CQ-DEPEND=CL:1341364

Change-Id: I5f20543e245fe7c5e0b142f81346275cf1623fd6
Reviewed-on: https://chromium-review.googlesource.com/1331272
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

[modify] https://crrev.com/ffd8d4aaab33fa04c429159d222b42750dbe23e4/sys-boot/chromeos-bootimage/chromeos-bootimage-0.0.3.ebuild

Project Member

Comment 65 by bugdroid1@chromium.org, Nov 27

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/depthcharge/+/cc8309b3076e16b757197b6ad2615fc41ad41465

commit cc8309b3076e16b757197b6ad2615fc41ad41465
Author: Simon Glass <sjg@chromium.org>
Date: Tue Nov 27 23:15:31 2018

Implement the menu screen for alternative firmware

Show a new screen with a list of bootloaders which can be selected using
the number keys. The list is displayed by depthcharge, in English only.

Item 0 is the default but always exists as a separation option, so don't
show it in the menu.

Also adjust the list adding algorithm, so that items remain in the order
set by chromeos-bootimage.

CQ-DEPEND=CL:1273268
BUG= chromium:837018 
BRANCH=grunt
TEST=emerge-grunt --nodeps depthcharge
With other changes, show the menu with Ctrl-L, exit with Esc and select
a bootloader with keys 0, 1 or 2

Change-Id: I2ce95c6d6a873934978074b7bca665c82e31871d
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1273269
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/1351843
Reviewed-by: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>

[modify] https://crrev.com/cc8309b3076e16b757197b6ad2615fc41ad41465/src/vboot/callbacks/display.c
[modify] https://crrev.com/cc8309b3076e16b757197b6ad2615fc41ad41465/src/vboot/screens.h
[modify] https://crrev.com/cc8309b3076e16b757197b6ad2615fc41ad41465/src/vboot/screens.c
[modify] https://crrev.com/cc8309b3076e16b757197b6ad2615fc41ad41465/src/boot/payload.h
[modify] https://crrev.com/cc8309b3076e16b757197b6ad2615fc41ad41465/src/vboot/callbacks/legacy.c
[modify] https://crrev.com/cc8309b3076e16b757197b6ad2615fc41ad41465/src/boot/payload.c

Project Member

Comment 66 by bugdroid1@chromium.org, Nov 27

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/c15147f0b5a819dbc58bf9771a400b02c85df4fb

commit c15147f0b5a819dbc58bf9771a400b02c85df4fb
Author: Simon Glass <sjg@chromium.org>
Date: Tue Nov 27 23:18:28 2018

Add a screen showing a menu for alternative firmware

At present we allow the user to press a keypad number to boot into another
bootloader but there is no indication which one is which.

Add a new screen for this. It is entered via Ctrl-L and shows the
available bootloaders, along with the number to press for each. The
contents of the screen is rendered by the bootloader, as usual.

This is supported by two new screens, one for the keyboard UI and one for
the menu UI. Also a new function, VbExGetAltFwIdxMask(), is added to find
out what bootloaders are available.

Note: This CL combines changes for both UIs. The changes may be easier to
review separately.

CQ-DEPEND=CL:1273269
BUG= chromium:837018 
BRANCH=none
TEST=FEATURES=test emerge-grunt --nodeps vboot_reference

Change-Id: Ib3227545dc677c8f9587944753e32f3b49647360
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1273268
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/1351848
Reviewed-by: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>

[modify] https://crrev.com/c15147f0b5a819dbc58bf9771a400b02c85df4fb/tests/vboot_detach_menu_tests.c
[modify] https://crrev.com/c15147f0b5a819dbc58bf9771a400b02c85df4fb/tests/vboot_display_tests.c
[modify] https://crrev.com/c15147f0b5a819dbc58bf9771a400b02c85df4fb/firmware/lib/vboot_ui_menu.c
[modify] https://crrev.com/c15147f0b5a819dbc58bf9771a400b02c85df4fb/firmware/lib/vboot_ui.c
[modify] https://crrev.com/c15147f0b5a819dbc58bf9771a400b02c85df4fb/firmware/lib/vboot_display.c
[modify] https://crrev.com/c15147f0b5a819dbc58bf9771a400b02c85df4fb/firmware/include/vboot_api.h
[modify] https://crrev.com/c15147f0b5a819dbc58bf9771a400b02c85df4fb/tests/vboot_api_kernel2_tests.c
[modify] https://crrev.com/c15147f0b5a819dbc58bf9771a400b02c85df4fb/firmware/lib/include/vboot_ui_common.h
[modify] https://crrev.com/c15147f0b5a819dbc58bf9771a400b02c85df4fb/firmware/lib/vboot_ui_common.c
[modify] https://crrev.com/c15147f0b5a819dbc58bf9771a400b02c85df4fb/firmware/lib/include/vboot_ui_menu_private.h

Project Member

Comment 67 by bugdroid1@chromium.org, Nov 28

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/7f1a3249763923b151ead43e811b09ea5be374a0

commit 7f1a3249763923b151ead43e811b09ea5be374a0
Author: Simon Glass <sjg@chromium.org>
Date: Wed Nov 28 00:01:45 2018

chromeos-bootimage: Add support for seabios in altfw

At present we only support U-Boot and TianoCore as alternative firmware.
Add SeaBIOS too.

BUG= chromium:837018 
BRANCH=grunt
TEST=USE="altfw seabios em100-mode" \
	emerge-grunt --nodeps chromeos-seabios chromeos-bootimage
Manually test booting into tianocore on Grunt by pressing '3'

Change-Id: I7ab6c64fc4bb6f5fc825cc08051ed29796bfa08d
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1292992
Commit-Ready: Duncan Laurie <dlaurie@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/1352637
Reviewed-by: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>

[modify] https://crrev.com/7f1a3249763923b151ead43e811b09ea5be374a0/sys-boot/chromeos-bootimage/chromeos-bootimage-0.0.3.ebuild
[modify] https://crrev.com/7f1a3249763923b151ead43e811b09ea5be374a0/sys-boot/chromeos-seabios/chromeos-seabios-9999.ebuild
[rename] https://crrev.com/7f1a3249763923b151ead43e811b09ea5be374a0/sys-boot/chromeos-bootimage/chromeos-bootimage-0.0.3-r43.ebuild

Project Member

Comment 68 by bugdroid1@chromium.org, Nov 28

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/19055dd41ccc374b2b79a16a03e68ba6015cffc5

commit 19055dd41ccc374b2b79a16a03e68ba6015cffc5
Author: Joel Kitching <kitching@google.com>
Date: Wed Nov 28 00:02:44 2018

chromeos-bootimage: add altfw payload hashing

Under certain circumstances, we would like to allow booting
only Google-issued RW_LEGACY firmware.  In order to allow for
the option to verify the payload being booted, we calculate
and store SHA-256 hashes of each payload in AP-RW CBFS, which
is signed and rollback-protected already as part of AP-RW.

A hash of each payload will be stored in the file:

  altfw_hash/<name>.sha256

Originally written prior to altfw as CL:1169027.

BUG=b:110721285,b:111577108,b:119384389,b:118786884, chromium:837018 
TEST=USE="altfw tianocore" emerge-eve chromeos-bootimage
     cbfstool image.bin print -r FW_MAIN_A
     check for altfw_hash/tianocore.sha256
CQ-DEPEND=CL:1341364

Change-Id: I5f20543e245fe7c5e0b142f81346275cf1623fd6
Reviewed-on: https://chromium-review.googlesource.com/1331272
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/1352644
Reviewed-by: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>

[modify] https://crrev.com/19055dd41ccc374b2b79a16a03e68ba6015cffc5/sys-boot/chromeos-bootimage/chromeos-bootimage-0.0.3.ebuild

Sign in to add a comment