New issue
Advanced search Search tips

Issue 690573 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature

Blocked on:
issue 695904
issue 732538

Blocking:
issue 680153



Sign in to add a comment

Support unified builds with chromeos-firmwareupdate

Project Member Reported by sjg@chromium.org, Feb 9 2017

Issue description

This packages needs to be enhanced to support unified builds

Design proposal is here:

https://docs.google.com/document/d/1XG8motvGyn-yevrzkskhUuhynWi3o86VjrlGs9p94fw/edit#bookmark=id.8uzb4srchddo


 
Showing comments 22 - 121 of 121 Older
Project Member

Comment 22 by bugdroid1@chromium.org, Mar 8 2017

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

commit c77296df3eb12f9835f05cd605e0d12312c75653
Author: Simon Glass <sjg@chromium.org>
Date: Wed Mar 08 00:18:20 2017

pack_firmware.py: Correct arguments to vbutil_firmware

These arguments are incorrect so the tool fails. Fix it.

BUG= chromium:690573 
TEST=run on trybot again; previous failure was here:
https://uberchromegw.corp.google.com/i/chromiumos.tryserver/builders/no_vmtest_pre_cq/builds/12122/steps/steps/logs/stdio

Change-Id: Ib2c8e56e7fdfce63d95e75fad624208310f691a5
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/450891
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/c77296df3eb12f9835f05cd605e0d12312c75653/pack_firmware.py

Project Member

Comment 23 by bugdroid1@chromium.org, Mar 8 2017

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

commit e400297ba10ba431c780f42aa2724dca1f9db0f8
Author: Simon Glass <sjg@chromium.org>
Date: Wed Mar 08 02:07:31 2017

cros-firmware: Run tests when enabled

This runs the unit tests and will also run the upcoming functional test
and any other tests we create.

BUG= chromium:690573 
TEST=FEATURES=test emerge-reef --nodeps  chromeos-firmware-reef
See that it runs the tests correctly. Adjust the tests to fails and see
that this is reported.

Change-Id: I5342d62b9d7952f43e345311469a58505e1f20f1
Reviewed-on: https://chromium-review.googlesource.com/450824
Commit-Ready: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/e400297ba10ba431c780f42aa2724dca1f9db0f8/eclass/cros-firmware.eclass

Project Member

Comment 24 by bugdroid1@chromium.org, Mar 8 2017

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

commit c16df400ef6fe2531aad7d06a7fffcc74b69a298
Author: Simon Glass <sjg@chromium.org>
Date: Wed Mar 08 19:27:43 2017

Adjust make_exec_temp to remount only when running as root

When running the firmware update from a functional test on a host machine
we cannot remount /tmp. Nor do we need to as it has execution permission
already.

Adjust the script to do the remount only when running as root.

BUG= chromium:690573 
TEST=Run firmware update script as root on reef; check that it completes
correctly:
$ sh chromeos-firmwareupdate --debug
bind and remount for allowing execution ...
Start running script: ./updater4.sh --debug
...

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

[modify] https://crrev.com/c16df400ef6fe2531aad7d06a7fffcc74b69a298/pack_stub

Project Member

Comment 25 by bugdroid1@chromium.org, Mar 8 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/36f4a0cbe29126cf82b5cb8bfddcb3bcae99622f

commit 36f4a0cbe29126cf82b5cb8bfddcb3bcae99622f
Author: Simon Glass <sjg@chromium.org>
Date: Wed Mar 08 21:23:08 2017

Add a functional test for firmware update

The existing unit test is useful for finding simple problems. But there is
value in having an larger test which actually runs the firmware update to
make sure it behaves as expected.

To make this work we need a firmware image. We also need to mock out some
of the tools:

- crossystem - used to display info about the system we are running on
- flashrom - used to access the SPI firmware
- vpd - used to access the VPD area of firmware

BUG= chromium:690573 
TEST=FEATURES=test emerge-reef --nodeps  chromeos-firmware-reef
Outside chroot:
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: I16ad520573302a8f9a713dab2ba8400690ff03c7
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/450855
Reviewed-by: Dan Erat <derat@chromium.org>

[add] https://crrev.com/36f4a0cbe29126cf82b5cb8bfddcb3bcae99622f/functest/crossystem
[add] https://crrev.com/36f4a0cbe29126cf82b5cb8bfddcb3bcae99622f/functest/flashrom
[add] https://crrev.com/36f4a0cbe29126cf82b5cb8bfddcb3bcae99622f/pack_firmware_functest.py
[add] https://crrev.com/36f4a0cbe29126cf82b5cb8bfddcb3bcae99622f/functest/vpd
[add] https://crrev.com/36f4a0cbe29126cf82b5cb8bfddcb3bcae99622f/functest/Reef.9042.50.0.tbz2

Project Member

Comment 26 by bugdroid1@chromium.org, Mar 10 2017

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

commit daf3e1177a98e9865ec5a05b44a35aad952ac13d
Author: Simon Glass <sjg@chromium.org>
Date: Fri Mar 10 06:18:42 2017

pack_firmware_unittest: Break out common flags

Some of the flags are useful in multiple tests, so break them out into
a common variable.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: If1c64aa608d455f665f667447fa1bcb806b432b6
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/452779
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/daf3e1177a98e9865ec5a05b44a35aad952ac13d/pack_firmware_unittest.py

Project Member

Comment 27 by bugdroid1@chromium.org, Mar 10 2017

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

commit bae4cdcbb9605a56674ad23d3bf3fdf156a58a56
Author: Simon Glass <sjg@chromium.org>
Date: Fri Mar 10 21:05:12 2017

pack_firmware.sh: Don't embed the temporary directory name in VERSION

When RW firmware is created from RO firmware, the shellball does not
produce the same output each time, since the name of the temporary
directory ends up in the VERSION file. Fix this by replacing it with a
constant string.

BUG= chromium:690573 
TEST=emerge-whirlwind --nodeps chromeos-firmware-whirlwind
with https://chromium-review.googlesource.com/c/442790/ applied
With other changes, this passes.

Change-Id: Iba70fb40b7c06e965be37dbf5b4cc6b406ec1673
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/452777
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/bae4cdcbb9605a56674ad23d3bf3fdf156a58a56/pack_firmware.sh

Project Member

Comment 28 by bugdroid1@chromium.org, Mar 10 2017

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

commit b51153c6d9dbe470ec5a831c2f24520e890b505a
Author: Simon Glass <sjg@chromium.org>
Date: Fri Mar 10 21:05:12 2017

pack_firmware.sh: Use a known timestamp for created RW firmware

When creating RW firmware from RO firmware, use the same timestamp. This
allows us to get the same output each time the script is run.

BUG= chromium:690573 
TEST=emerge-whirlwind --nodeps chromeos-firmware-whirlwind
with https://chromium-review.googlesource.com/c/442790/ applied
With other changes, this passes.

Change-Id: Ie13a76e31dbd0f728d2769e7014c2f5d36d1359c
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/452778
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/b51153c6d9dbe470ec5a831c2f24520e890b505a/pack_firmware.sh

Project Member

Comment 29 by bugdroid1@chromium.org, Mar 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/30ee245a953d909cb9597300ddfb31e005d7aade

commit 30ee245a953d909cb9597300ddfb31e005d7aade
Author: Simon Glass <sjg@chromium.org>
Date: Fri Mar 10 21:05:12 2017

pack_firmware_unittest: Separate out the resigning helper

Allow this helper to be called from other tests by putting it at the class
level. Also change the copy2() to copy() since the script does not preserve
timestamps.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: I0c1bb08573b2af76991ef8a56da73210543c0000
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/452780
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/30ee245a953d909cb9597300ddfb31e005d7aade/pack_firmware_unittest.py

Project Member

Comment 30 by bugdroid1@chromium.org, Mar 10 2017

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

commit 8c35fae437a96ad14c53ab32e354c3a6ef46906d
Author: Simon Glass <sjg@chromium.org>
Date: Fri Mar 10 21:05:13 2017

pack_firmware.py: Use a known timestamp for created RW firmware

When creating RW firmware from RO firmware, use the same timestamp. This
allows us to get the same output each time the script is run.

Add a test for this as well. To make this work, provide a test-only option
to keep the temporary directories around.

BUG= chromium:690573 
TEST=emerge-whirlwind --nodeps chromeos-firmware-whirlwind
with https://chromium-review.googlesource.com/c/442790/ applied
With other changes, this passes.

Change-Id: Ib985b62a4715c33296404f473d9e384489287067
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/452781
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/8c35fae437a96ad14c53ab32e354c3a6ef46906d/pack_firmware_unittest.py
[modify] https://crrev.com/8c35fae437a96ad14c53ab32e354c3a6ef46906d/pack_firmware.py

Project Member

Comment 31 by bugdroid1@chromium.org, Mar 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/95523cd1ff47794e3d7ac2955733b603d99db08f

commit 95523cd1ff47794e3d7ac2955733b603d99db08f
Author: Simon Glass <sjg@chromium.org>
Date: Fri Mar 10 21:05:13 2017

pack_firmware.py: Correct logic in _CheckRwFirmware()

The logic for checking for an RW image is actually inverted. Fix it. Also
update the function comment which is silent on this.

Use a mock to handle the testing since we don't want to have two separate
versions of the real image just for testing.

BUG= chromium:690573 
TEST=emerge-whirlwind --nodeps chromeos-firmware-whirlwind
with https://chromium-review.googlesource.com/c/442790/ applied
With other changes, this passes.

Change-Id: I84d91442c1aad1fef55743a34cf7f2e324813682
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/452782
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/95523cd1ff47794e3d7ac2955733b603d99db08f/pack_firmware_unittest.py
[modify] https://crrev.com/95523cd1ff47794e3d7ac2955733b603d99db08f/pack_firmware.py

Project Member

Comment 32 by bugdroid1@chromium.org, Mar 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/54295ff3b0ce1a87175c5d3bc61d6ae9b85779e1

commit 54295ff3b0ce1a87175c5d3bc61d6ae9b85779e1
Author: Simon Glass <sjg@chromium.org>
Date: Fri Mar 10 21:05:13 2017

pack_firmware.py: Use the correct RW firmware filename

At present we use the filename provided to the script for the RO firmware.
If we create new RW firmware, this filename is incorrect and we add
version information about the wrong file. Fix it.

BUG= chromium:690573 
TEST=emerge-whirlwind --nodeps chromeos-firmware-whirlwind
with https://chromium-review.googlesource.com/c/442790/ applied
With other changes, this passes.

Change-Id: I19d03c039943695d6d60f4bf42815fab7f1def39
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/452783
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/54295ff3b0ce1a87175c5d3bc61d6ae9b85779e1/pack_firmware_unittest.py
[modify] https://crrev.com/54295ff3b0ce1a87175c5d3bc61d6ae9b85779e1/pack_firmware.py

Project Member

Comment 33 by bugdroid1@chromium.org, Mar 10 2017

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

commit df5dd5745d5ed13a21b26c28584e462d56e2a250
Author: Simon Glass <sjg@chromium.org>
Date: Fri Mar 10 21:05:13 2017

pack_firmware.py: Allow EC firmware version to be 'IGNORE'

The old pack_firmware.sh script produces a version of IGNORE if there is
no EC firmware and no EC firmware version is provided on the command line.
Adjust the new script to do the same.

BUG= chromium:690573 
TEST=emerge-whirlwind --nodeps chromeos-firmware-whirlwind
with https://chromium-review.googlesource.com/c/442790/ applied
With other changes, this passes.

Change-Id: I56c57dd34110a674f57871901a5b0a7641df0c61
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/452784
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/df5dd5745d5ed13a21b26c28584e462d56e2a250/pack_firmware_functest.py
[modify] https://crrev.com/df5dd5745d5ed13a21b26c28584e462d56e2a250/pack_firmware.py
[modify] https://crrev.com/df5dd5745d5ed13a21b26c28584e462d56e2a250/pack_firmware_unittest.py

Project Member

Comment 34 by bugdroid1@chromium.org, Mar 10 2017

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

commit d20560170238cec7ea95e3736db97292917270f8
Author: Simon Glass <sjg@chromium.org>
Date: Fri Mar 10 21:05:13 2017

pack_firmware.py: Don't embed the temporary directory name in VERSION

When RW firmware is created from RO firmware, the shellball does not
produce the same output each time, since the name of the temporary
directory ends up in the VERSION file. Fix this by replacing it with a
constant string.

BUG= chromium:690573 
TEST=emerge-whirlwind --nodeps chromeos-firmware-whirlwind
with https://chromium-review.googlesource.com/c/442790/ applied
With other changes, this passes.

Change-Id: Ib7c2fac53f6420d705f6cb06bc1f17c6006e2902
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/452785
Reviewed-by: Hung-Te Lin <hungte@chromium.org>

[modify] https://crrev.com/d20560170238cec7ea95e3736db97292917270f8/pack_firmware_unittest.py
[modify] https://crrev.com/d20560170238cec7ea95e3736db97292917270f8/pack_firmware.py

Project Member

Comment 35 by bugdroid1@chromium.org, Mar 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/6994ed8bea69faa8dc068ad0867f3ba2106c86de

commit 6994ed8bea69faa8dc068ad0867f3ba2106c86de
Author: Simon Glass <sjg@chromium.org>
Date: Fri Mar 10 21:05:13 2017

pack_firmware.py: Enforce minimum spacing in VERSIONS

Match the spacing with the old script now that the spacing is not adjusted
by pack_stub. I am not sure it is worth adding tests for this.

BUG= chromium:690573 
TEST=emerge-whirlwind --nodeps chromeos-firmware-whirlwind
with https://chromium-review.googlesource.com/c/442790/ applied
With other changes, this passes.

Change-Id: Ie58b9ed2e9e6b3919de8a4438401fac5dfa4949d
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/452787
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/6994ed8bea69faa8dc068ad0867f3ba2106c86de/pack_firmware.py

Project Member

Comment 36 by bugdroid1@chromium.org, Mar 14 2017

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

commit 8e302f204eeee0f7e31ff6201ba3c7d41b2b5753
Author: Simon Glass <sjg@chromium.org>
Date: Tue Mar 14 02:58:55 2017

pack_firmware.py: Add special handling of IGNORE for mario

x86-mario expects the firmware version to come through as IGNORE. Add
a few special cases for this.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py
Also: emerge-x86-mario --nodeps chromeos-firmware-mario
with https://chromium-review.googlesource.com/c/442790/ applied

Change-Id: If9a4f0ab8fe16b5f55eda8bb1087a2200e0ad515
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/453301
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/8e302f204eeee0f7e31ff6201ba3c7d41b2b5753/pack_firmware_unittest.py
[modify] https://crrev.com/8e302f204eeee0f7e31ff6201ba3c7d41b2b5753/pack_firmware.py

Comment 37 by sjg@chromium.org, Mar 14 2017

Python rewrite is complete, but I have a few failing builds (where we generate a different file). Still working through that.

Unified build CLs are mostly up, but there are a few missing tests which I'm still working on.
Project Member

Comment 38 by bugdroid1@chromium.org, Mar 14 2017

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

commit 89a38bb7b622c4dd8543cc312047d8049f8fb31f
Author: Simon Glass <sjg@chromium.org>
Date: Tue Mar 14 22:06:00 2017

pack_firmware.py: Correct handling of EC/PD RW merging

There is a typo in the CBFS section name which causes this to produce an
empty version. Correct this and expand the test to catch it.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py
Change-Id: I8a368873bba52c4ad79ef0954249d556b1a7c15a
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/452968
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/89a38bb7b622c4dd8543cc312047d8049f8fb31f/pack_firmware_unittest.py
[modify] https://crrev.com/89a38bb7b622c4dd8543cc312047d8049f8fb31f/pack_firmware.py
[modify] https://crrev.com/89a38bb7b622c4dd8543cc312047d8049f8fb31f/test/RW_FRID

Project Member

Comment 39 by bugdroid1@chromium.org, Mar 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/6121fa563b2fff8bbd7e010c03d7826e22a5c768

commit 6121fa563b2fff8bbd7e010c03d7826e22a5c768
Author: Simon Glass <sjg@chromium.org>
Date: Tue Mar 14 22:06:00 2017

pack_firmware.py: Break functions out of _BuildShellball()

With unified firmware we need to call the various copying functions
multiple times, once for each model. In preparation for this change, move
the functions to the top level of the class.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: I5e01fd9fcb60bae70bb8fdb0ea7db36ab56a9749
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/452969
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/6121fa563b2fff8bbd7e010c03d7826e22a5c768/pack_firmware.py

Project Member

Comment 40 by bugdroid1@chromium.org, Mar 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/42a855069404cbb0af1431d3ee2216bcabeb7f9b

commit 42a855069404cbb0af1431d3ee2216bcabeb7f9b
Author: Simon Glass <sjg@chromium.org>
Date: Tue Mar 14 22:06:00 2017

pack_stub: Add a UNIBUILD variable

The firmware update script with unified builds need to cope with selecting
the correct images based on the model name of the device we are running
on. It is no-longer enough to have a single image of each type (BIOS, EC),
so the variables at the top of pack_stub are not useful. Instead, those
variables need to be set in separate scripts, one for each model.

As a first step, define a UNIBUILD variable at the top of the script, and
avoid setting the existing variables if that is enabled.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: Iae9b0426bc59db3c9c149cb88d174fbc8dc5ae0e
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/452970
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/42a855069404cbb0af1431d3ee2216bcabeb7f9b/pack_firmware_unittest.py
[modify] https://crrev.com/42a855069404cbb0af1431d3ee2216bcabeb7f9b/pack_stub
[modify] https://crrev.com/42a855069404cbb0af1431d3ee2216bcabeb7f9b/pack_firmware_functest.py

Project Member

Comment 41 by bugdroid1@chromium.org, Mar 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/612c815f396a291dd7fa67eae659512873c49ffe

commit 612c815f396a291dd7fa67eae659512873c49ffe
Author: Simon Glass <sjg@chromium.org>
Date: Thu Mar 16 16:24:51 2017

pack_firmware.py: Use a local variable for arguments

Before adding a lot more uses of arguments here, use a local variable to
shorten and simplify the code.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: I8894965fbff1e9a82e0de7a8181580a429080044
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/452972
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/612c815f396a291dd7fa67eae659512873c49ffe/pack_firmware.py

Project Member

Comment 42 by bugdroid1@chromium.org, Mar 16 2017

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

commit fc269dd48942da22df5f810634c7e55ea1bf5045
Author: Simon Glass <sjg@chromium.org>
Date: Thu Mar 16 16:26:06 2017

pack_firmware.py: Pass tool_base as a parameter

Instead of reading this directly from the arguments in each function that
needs it, pass it as a parameter. This clears the way for it to become a
model-specific value in a later CL.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: Ibf42f71d67e46441a1993748aec4a72ff28b8a3b
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/452973
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/fc269dd48942da22df5f810634c7e55ea1bf5045/pack_firmware_unittest.py
[modify] https://crrev.com/fc269dd48942da22df5f810634c7e55ea1bf5045/pack_firmware.py

Project Member

Comment 43 by bugdroid1@chromium.org, Mar 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/37260139765177459f8f1ab5c5e2df78ff73bf15

commit 37260139765177459f8f1ab5c5e2df78ff73bf15
Author: Simon Glass <sjg@chromium.org>
Date: Thu Mar 16 16:31:07 2017

pack_firmware.py: Pass tools as a parameter

Instead of reading this directly from the arguments in _CopyBaseFiles(),
pass it as a parameter. This clears the way for it to become a
model-specific value in a later CL.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: I2222feb6b8c3f0a88196a6bab3b8e7afd3a373a0
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/452974
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/37260139765177459f8f1ab5c5e2df78ff73bf15/pack_firmware.py

Project Member

Comment 44 by bugdroid1@chromium.org, Mar 16 2017

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

commit e122cb4f4f32b09312a8a603475bd76655d64fe6
Author: Simon Glass <sjg@chromium.org>
Date: Thu Mar 16 16:52:29 2017

pack_firmware.py: Pass script as a parameter

Instead of reading this directly from the arguments in _CopyBaseFiles(),
pass it as a parameter. This clears the way for it to become a
model-specific value in a later CL.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: I340fc25ae6da9a8a00f38fbe78708b48f1490060
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/452975
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/e122cb4f4f32b09312a8a603475bd76655d64fe6/pack_firmware.py

Project Member

Comment 45 by bugdroid1@chromium.org, Mar 16 2017

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

commit f85707e7adbba3f0f253dd2b98038ffebc42ad32
Author: Simon Glass <sjg@chromium.org>
Date: Thu Mar 16 16:54:49 2017

pack_firmware.py: Correct a flag error with cbfstool

Fix an incorrect command-line argument which breaks the 'chell' board.

I have not added a test here since I don't really want to run cbfstool
in the test. It would involve adding another binary image or just checking
the arguments are right, which does not seem like a useful test.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py
Also: emerge-chell --nodeps chromeos-firmware-chell
with https://chromium-review.googlesource.com/c/442790/ applied

Change-Id: I7c9db40baabcbe179427d9a51281ff2645eff243
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/455232
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/f85707e7adbba3f0f253dd2b98038ffebc42ad32/pack_firmware.py

Project Member

Comment 46 by bugdroid1@chromium.org, Mar 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/37295d7a01fc6fd811ff0774a5272ace530f4a4b

commit 37295d7a01fc6fd811ff0774a5272ace530f4a4b
Author: Simon Glass <sjg@chromium.org>
Date: Thu Mar 16 17:05:24 2017

pack_firmware.py: Correct EC merging file size check

This check is actually the wrong way around at present. Fix it.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py
Also: emerge-chell --nodeps chromeos-firmware-chell
with https://chromium-review.googlesource.com/c/442790/ applied

Change-Id: Ic2107434fc352e38255e34fa55df51015cfc64b1
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/455235
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/37295d7a01fc6fd811ff0774a5272ace530f4a4b/pack_firmware_unittest.py
[modify] https://crrev.com/37295d7a01fc6fd811ff0774a5272ace530f4a4b/pack_firmware.py

Project Member

Comment 47 by bugdroid1@chromium.org, Mar 16 2017

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

commit ffe039d841e514ab1f4f2739712250cebd6c74db
Author: Simon Glass <sjg@chromium.org>
Date: Thu Mar 16 17:14:35 2017

pack_firmware.py: Preserve time stamps when merging firmware

When merging RW firmware into RO, copy the timestamp over as well. This
matches the behaviour when not merging, and allows us to produce the same
output each time.

We could drop the timestamp copy when creating the RW firmware, since the
eclass does not seem to ever create it without also merging it into RO.
But keep it for consistency.

Adjust the relevant test case to check this. Note that it is changed to
call the firmware packer directly rather than through its main() method.
This allows us to preserve the temporary files for checking in the test.
We still have one test which uses the main() method (testMockedRun).

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py
emerge-chell --nodeps chromeos-firmware-chell
with https://chromium-review.googlesource.com/c/442790/ applied
Also check that taking out each _CopyTimestamp() call causes a different
test failure.

Change-Id: I9d893f2dce0c98c43e430776fbc0d4959f93d713
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/456036
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/ffe039d841e514ab1f4f2739712250cebd6c74db/pack_firmware_unittest.py
[modify] https://crrev.com/ffe039d841e514ab1f4f2739712250cebd6c74db/pack_firmware.py

Project Member

Comment 48 by bugdroid1@chromium.org, Mar 16 2017

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

commit 4b66a6eed1f0965b369345af56c6d20fc5dca8a6
Author: Simon Glass <sjg@chromium.org>
Date: Thu Mar 16 17:17:02 2017

pack_firmware.py: Restore the 'typo' RW_FWID

It turns out that the read-only firmware ID is stored in a section called
RO_FRID while the read-write firmware ID is stored in a section called
RW_RWID. My attempt to fix this 'typo' was in fact incorrect. Re-fix it.

This inconsistency is quite confusing, but I don't this it is feasible to
change it at this stage.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py
emerge-chell --nodeps chromeos-firmware-chell
with https://chromium-review.googlesource.com/c/442790/ applied

Change-Id: I2bc57a9c7d336373be1febf56db9f44a46026c3d
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/456037
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/4b66a6eed1f0965b369345af56c6d20fc5dca8a6/pack_firmware_unittest.py
[modify] https://crrev.com/4b66a6eed1f0965b369345af56c6d20fc5dca8a6/pack_firmware.py
[rename] https://crrev.com/4b66a6eed1f0965b369345af56c6d20fc5dca8a6/test/RW_FWID

Project Member

Comment 49 by bugdroid1@chromium.org, Mar 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/19843860366e332e24e98ce6218ca0db97a99348

commit 19843860366e332e24e98ce6218ca0db97a99348
Author: Simon Glass <sjg@chromium.org>
Date: Thu Mar 16 17:24:22 2017

pack_firmware.py: Strip firmware ID after removing nul bytes

The original intent was to remove leading spaces, but x86-alex has
trailing spaces before the \0 bytes. Fix it to handle this situation.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py
emerge-x86-alex --nodeps chromeos-firmware-alex
with https://chromium-review.googlesource.com/c/442790/ applied

Change-Id: Ib6eb9d84aed034ef6ac035a9fbfad577635b372b
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/456038
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/19843860366e332e24e98ce6218ca0db97a99348/pack_firmware_unittest.py
[modify] https://crrev.com/19843860366e332e24e98ce6218ca0db97a99348/pack_firmware.py

Project Member

Comment 50 by bugdroid1@chromium.org, Mar 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/19843860366e332e24e98ce6218ca0db97a99348

commit 19843860366e332e24e98ce6218ca0db97a99348
Author: Simon Glass <sjg@chromium.org>
Date: Thu Mar 16 17:24:22 2017

pack_firmware.py: Strip firmware ID after removing nul bytes

The original intent was to remove leading spaces, but x86-alex has
trailing spaces before the \0 bytes. Fix it to handle this situation.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py
emerge-x86-alex --nodeps chromeos-firmware-alex
with https://chromium-review.googlesource.com/c/442790/ applied

Change-Id: Ib6eb9d84aed034ef6ac035a9fbfad577635b372b
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/456038
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/19843860366e332e24e98ce6218ca0db97a99348/pack_firmware_unittest.py
[modify] https://crrev.com/19843860366e332e24e98ce6218ca0db97a99348/pack_firmware.py

Project Member

Comment 51 by bugdroid1@chromium.org, Mar 16 2017

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

commit fc93618191ea3aa2c2488af9bf005b9f2e4ec304
Author: Simon Glass <sjg@chromium.org>
Date: Thu Mar 16 17:38:30 2017

pack_firmware.py: Pass extras as a parameter

Instead of reading this directly from the arguments in __CopyExtraFiles(),
pass it as a parameter. This clears the way for it to become a
model-specific value in a later CL.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: Ic3043ae3291d930fe2f41e3fe26a429522ed65ee
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/453292
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/fc93618191ea3aa2c2488af9bf005b9f2e4ec304/pack_firmware.py

Project Member

Comment 52 by bugdroid1@chromium.org, Mar 16 2017

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

commit fc93618191ea3aa2c2488af9bf005b9f2e4ec304
Author: Simon Glass <sjg@chromium.org>
Date: Thu Mar 16 17:38:30 2017

pack_firmware.py: Pass extras as a parameter

Instead of reading this directly from the arguments in __CopyExtraFiles(),
pass it as a parameter. This clears the way for it to become a
model-specific value in a later CL.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: Ic3043ae3291d930fe2f41e3fe26a429522ed65ee
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/453292
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/fc93618191ea3aa2c2488af9bf005b9f2e4ec304/pack_firmware.py

Project Member

Comment 53 by bugdroid1@chromium.org, Mar 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/236111bcf60f5cd16a5b34c31fe11a4cb5bdce44

commit 236111bcf60f5cd16a5b34c31fe11a4cb5bdce44
Author: Simon Glass <sjg@chromium.org>
Date: Thu Mar 16 17:41:04 2017

pack_firmware.py: Use a dict to store version info

_CopyFirmwareFiles() both copies the files and decides what to copy. It
handles this by setting the program argument self._args.merge_bios_rw_image
to False when it decides that it cannot in fact merge.

This mirrors the old shell script but is not very nice. It would be better
to make all the decisions up front and then perform the tasks without any
thought.

As a first step towards this, rather than writing directly into the
version information file, collect the information in a dict and write it
at the end. This will allow us to write the information out-of-order in a
future CL.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

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

[modify] https://crrev.com/236111bcf60f5cd16a5b34c31fe11a4cb5bdce44/pack_firmware.py

Project Member

Comment 54 by bugdroid1@chromium.org, Mar 16 2017

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

commit 03bab4c965f2c7d982485e7ea9cb08aa1a592d5f
Author: Simon Glass <sjg@chromium.org>
Date: Thu Mar 16 17:43:58 2017

pack_firmware.py: Rename variable to bios_rw_image

The bios_rw_bin variable in _CopyFirmwareFiles() is poorly named. Fix it.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: Id481cc99479b07fc499b29d3d29706501d2e92c2
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/452977
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/03bab4c965f2c7d982485e7ea9cb08aa1a592d5f/pack_firmware.py

Project Member

Comment 55 by bugdroid1@chromium.org, Mar 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/1c62af6cf147e3f1577496e0b620c513457f23db

commit 1c62af6cf147e3f1577496e0b620c513457f23db
Author: Simon Glass <sjg@chromium.org>
Date: Thu Mar 16 17:48:17 2017

pack_firmware.py: Pass parameters to _CopyFirmwareFiles()

Pass arguments in as parameters so that we can call it multiple times
with different values. With unified builds we will use settings from the
master configuration instead of program arguments.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

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

[modify] https://crrev.com/1c62af6cf147e3f1577496e0b620c513457f23db/pack_firmware.py

Project Member

Comment 56 by bugdroid1@chromium.org, Mar 16 2017

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

commit dfe191ff4425faa2caf8c651090d4c986eecf3b5
Author: Simon Glass <sjg@chromium.org>
Date: Thu Mar 16 17:50:44 2017

pack_firmware.py: Move inner control code into a function

With unified builds we need to add files for multiple models into the
same firmware bundle. In preparation for this, move the inner part of the
code into a new _ProcessModel() function and call it with the supplied
program arguments. With unified builds we will call it multiple times
with different values, collected from the master configuration.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: I83f1be291d62419723d726a18f160e51261edbdd
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/453379
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/dfe191ff4425faa2caf8c651090d4c986eecf3b5/pack_firmware_unittest.py
[modify] https://crrev.com/dfe191ff4425faa2caf8c651090d4c986eecf3b5/pack_firmware.py

Project Member

Comment 57 by bugdroid1@chromium.org, Mar 16 2017

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

commit dfe191ff4425faa2caf8c651090d4c986eecf3b5
Author: Simon Glass <sjg@chromium.org>
Date: Thu Mar 16 17:50:44 2017

pack_firmware.py: Move inner control code into a function

With unified builds we need to add files for multiple models into the
same firmware bundle. In preparation for this, move the inner part of the
code into a new _ProcessModel() function and call it with the supplied
program arguments. With unified builds we will call it multiple times
with different values, collected from the master configuration.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: I83f1be291d62419723d726a18f160e51261edbdd
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/453379
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/dfe191ff4425faa2caf8c651090d4c986eecf3b5/pack_firmware_unittest.py
[modify] https://crrev.com/dfe191ff4425faa2caf8c651090d4c986eecf3b5/pack_firmware.py

Project Member

Comment 58 by bugdroid1@chromium.org, Mar 16 2017

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

commit d395e9e6f9b477808b93b05d9d9b87ec3958f74b
Author: Simon Glass <sjg@chromium.org>
Date: Thu Mar 16 17:54:25 2017

pack_firmware.py: Pass parameters to _WriteUpdateScript()

At present the update script (created from 'pack_stub') has all the
variables it needs defined at the top:

  # Version information. Please keep this in head of the updater.
  TARGET_RO_FWID="REPLACE_RO_FWID"
  TARGET_FWID="REPLACE_FWID"
  TARGET_ECID="REPLACE_ECID"
  TARGET_PDID="REPLACE_PDID"
  TARGET_PLATFORM="REPLACE_PLATFORM"
  STABLE_FWID="REPLACE_STABLE_FWID"
  STABLE_ECID="REPLACE_STABLE_ECID"
  STABLE_PDID="REPLACE_STABLE_PDID"

With unified builds we will need one set of variables for each model.
To prepare for this, adjust the update script writer to take the
information it needs from the image_files dictionary rather than the
single-value class variables, which can obviously not support multiple
models.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py
Change-Id: Ibdcfe193afc7bf642c57e89d364a6e89fde92be6
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/453293

[modify] https://crrev.com/d395e9e6f9b477808b93b05d9d9b87ec3958f74b/pack_firmware.py

Project Member

Comment 59 by bugdroid1@chromium.org, Mar 16 2017

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

commit d395e9e6f9b477808b93b05d9d9b87ec3958f74b
Author: Simon Glass <sjg@chromium.org>
Date: Thu Mar 16 17:54:25 2017

pack_firmware.py: Pass parameters to _WriteUpdateScript()

At present the update script (created from 'pack_stub') has all the
variables it needs defined at the top:

  # Version information. Please keep this in head of the updater.
  TARGET_RO_FWID="REPLACE_RO_FWID"
  TARGET_FWID="REPLACE_FWID"
  TARGET_ECID="REPLACE_ECID"
  TARGET_PDID="REPLACE_PDID"
  TARGET_PLATFORM="REPLACE_PLATFORM"
  STABLE_FWID="REPLACE_STABLE_FWID"
  STABLE_ECID="REPLACE_STABLE_ECID"
  STABLE_PDID="REPLACE_STABLE_PDID"

With unified builds we will need one set of variables for each model.
To prepare for this, adjust the update script writer to take the
information it needs from the image_files dictionary rather than the
single-value class variables, which can obviously not support multiple
models.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py
Change-Id: Ibdcfe193afc7bf642c57e89d364a6e89fde92be6
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/453293

[modify] https://crrev.com/d395e9e6f9b477808b93b05d9d9b87ec3958f74b/pack_firmware.py

Project Member

Comment 60 by bugdroid1@chromium.org, Mar 16 2017

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

commit d395e9e6f9b477808b93b05d9d9b87ec3958f74b
Author: Simon Glass <sjg@chromium.org>
Date: Thu Mar 16 17:54:25 2017

pack_firmware.py: Pass parameters to _WriteUpdateScript()

At present the update script (created from 'pack_stub') has all the
variables it needs defined at the top:

  # Version information. Please keep this in head of the updater.
  TARGET_RO_FWID="REPLACE_RO_FWID"
  TARGET_FWID="REPLACE_FWID"
  TARGET_ECID="REPLACE_ECID"
  TARGET_PDID="REPLACE_PDID"
  TARGET_PLATFORM="REPLACE_PLATFORM"
  STABLE_FWID="REPLACE_STABLE_FWID"
  STABLE_ECID="REPLACE_STABLE_ECID"
  STABLE_PDID="REPLACE_STABLE_PDID"

With unified builds we will need one set of variables for each model.
To prepare for this, adjust the update script writer to take the
information it needs from the image_files dictionary rather than the
single-value class variables, which can obviously not support multiple
models.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py
Change-Id: Ibdcfe193afc7bf642c57e89d364a6e89fde92be6
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/453293

[modify] https://crrev.com/d395e9e6f9b477808b93b05d9d9b87ec3958f74b/pack_firmware.py

Project Member

Comment 61 by bugdroid1@chromium.org, Mar 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/67eaa4e76ec015be4e7ffd50118c838937ea41ed

commit 67eaa4e76ec015be4e7ffd50118c838937ea41ed
Author: Simon Glass <sjg@chromium.org>
Date: Thu Mar 16 17:57:58 2017

pack_firmware.py: Drop the version variables

At present we store the BIOS/EC/PD versions in the class, meaning there
can be only one. With unified builds we will have different versions for
each model. Since we have the version information in the image_files
dictionary, we can use that instead, and drop the variables.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: I3e148052cb1a28e266eab1cf7a6736e5ec26f07a
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/453294
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/67eaa4e76ec015be4e7ffd50118c838937ea41ed/pack_firmware.py

Project Member

Comment 62 by bugdroid1@chromium.org, Mar 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/29e5104e69ca1df84128b731ee85ab69416ea8cc

commit 29e5104e69ca1df84128b731ee85ab69416ea8cc
Author: Simon Glass <sjg@chromium.org>
Date: Thu Mar 16 18:02:46 2017

pack_firmware.py: Split up _WriteUpdateScript()

With unified builds we need to write multiple 'setvars' scripts each of
which sets the firmware variables for a particular model. The current
code just updates the top of the (single) update script.

In preparation for this, move the code which substitutes variables into
its own function, called by WriteUpdateScript(). In a future CL we can
call it from the unified build code.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: I3e2468abfa3d90a1f20eb2fa90b3c53068e4aebc
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/453296
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/29e5104e69ca1df84128b731ee85ab69416ea8cc/pack_firmware.py

Project Member

Comment 63 by bugdroid1@chromium.org, Mar 16 2017

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

commit b5f87612f0ffe541a09a465244000aa31c423b83
Author: Simon Glass <sjg@chromium.org>
Date: Thu Mar 16 18:05:08 2017

pack_firmware.py: Move the newline generation in VERSION

Generate the newline before each new model instead of after flashrom. This
changes nothing when there is only one model, but is easier to follow when
we have more than one.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: Ibee2383ae766d6079f78db9ef95501a67fffcbd0
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/455222
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/b5f87612f0ffe541a09a465244000aa31c423b83/pack_firmware.py

Project Member

Comment 64 by bugdroid1@chromium.org, Mar 16 2017

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

commit b5f87612f0ffe541a09a465244000aa31c423b83
Author: Simon Glass <sjg@chromium.org>
Date: Thu Mar 16 18:05:08 2017

pack_firmware.py: Move the newline generation in VERSION

Generate the newline before each new model instead of after flashrom. This
changes nothing when there is only one model, but is easier to follow when
we have more than one.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: Ibee2383ae766d6079f78db9ef95501a67fffcbd0
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/455222
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/b5f87612f0ffe541a09a465244000aa31c423b83/pack_firmware.py

Project Member

Comment 65 by bugdroid1@chromium.org, Mar 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/73237a4a5df5f5a3c83193a55f838fb44bbada0a

commit 73237a4a5df5f5a3c83193a55f838fb44bbada0a
Author: Simon Glass <sjg@chromium.org>
Date: Fri Mar 17 01:06:50 2017

pack_firmware.py: Support unpacking tar files automatically

At present the cros-firmware eclass is responsible for unpacking tar
files. This happens in that script's _unpack_archive() function.

This is somewhat clumsy but with unified builds it becomes a pain since it
means that both the eclass and pack_firmware.py need to read all the
firmware configuration. It is much easier if pack_firmware.py handles this
itself.

Add a way to detect tar files downloaded from bcs:// by the eclass, and
unpack the file within. The directory to unpack into is provided as a
command-line flag, since the eclass will need to control this.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: I646671a0b464436a8e72c1e339f8f685d5b57564
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/455223
Reviewed-by: Dan Erat <derat@chromium.org>

[add] https://crrev.com/73237a4a5df5f5a3c83193a55f838fb44bbada0a/test/path.tbz2
[modify] https://crrev.com/73237a4a5df5f5a3c83193a55f838fb44bbada0a/pack_firmware_unittest.py
[add] https://crrev.com/73237a4a5df5f5a3c83193a55f838fb44bbada0a/test/two_files.tbz2
[modify] https://crrev.com/73237a4a5df5f5a3c83193a55f838fb44bbada0a/pack_firmware.py

Project Member

Comment 66 by bugdroid1@chromium.org, Mar 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/6c33ff8de4061a04316cadeb7e0c374ec06f233c

commit 6c33ff8de4061a04316cadeb7e0c374ec06f233c
Author: Simon Glass <sjg@chromium.org>
Date: Fri Mar 17 01:06:50 2017

pack_firmware.py: Drop unnecessary test output

At present when running the functional tests we get the following output:

   Repacking from: /tmp/tmpbdNAhL.pack_firmware-4743
   Changed TARGET_FWID to Google_Reef.9042.50.0
   Changed TARGET_ROFWID to Google_Reef.9042.50.0

Allow it to be suppressed (with --quiet) to clean up the test output.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py
See that there is no output other than from the unittest framework.

Change-Id: I3786dd5c48a06bf28df1ebb58724168e81c5eacb
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/455224
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/6c33ff8de4061a04316cadeb7e0c374ec06f233c/pack_firmware.py

Project Member

Comment 67 by bugdroid1@chromium.org, Mar 17 2017

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

commit b3dbe68141bc4afa4f087a46939c244515925110
Author: Simon Glass <sjg@chromium.org>
Date: Fri Mar 17 01:06:50 2017

pack_firmware.py: Put the replace dictionary in its own function

With unified builds we want to call this for each model and handle the
replacement in a different file. In preparation, put it in its own
function. A future commit refactors _WriteUpdateScript() to reduce the
number of parameters.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: I3860faab9cf170c949c6278f31b82414c01a8a7e
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/455225
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/b3dbe68141bc4afa4f087a46939c244515925110/pack_firmware.py

Project Member

Comment 68 by bugdroid1@chromium.org, Mar 17 2017

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

commit e58014488ea0d34a7fc0aafadd6f8f9a964605b0
Author: Simon Glass <sjg@chromium.org>
Date: Fri Mar 17 01:06:50 2017

pack_firmware.py: Simplify _WriteUpdateScript()

At present we pass the stable versions into this function. It's a bit
messy because it passes them through, creates its own version of the
replace dictionary, then returns the original one.

Simplify this by having its caller generate the dictionary itself.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: Ia1aba1ab60f0a40846583ccc83beecb756a84bd0
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/455226
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/e58014488ea0d34a7fc0aafadd6f8f9a964605b0/pack_firmware.py

Project Member

Comment 69 by bugdroid1@chromium.org, Mar 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/722d6e4544d5d3383632db02670371cfbdb7ab73

commit 722d6e4544d5d3383632db02670371cfbdb7ab73
Author: Simon Glass <sjg@chromium.org>
Date: Fri Mar 17 01:06:51 2017

pack_firmware.sh: Use single spacing with EC RW

The current spacing is a little inconsistent. Adjust it so it is easier
to replicate in the new firmware script.

BUG= chromium:690573 
TEST=emerge-chell --nodeps chromeos-firmware-chell
with https://chromium-review.googlesource.com/c/442790/ applied

Change-Id: I915352c2533099b9a362225c8ff195d7bbbdec70
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/455233
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/722d6e4544d5d3383632db02670371cfbdb7ab73/pack_firmware.sh

Project Member

Comment 70 by bugdroid1@chromium.org, Mar 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/6e414e8f41b5496d47a5ab40e6ad71869744f562

commit 6e414e8f41b5496d47a5ab40e6ad71869744f562
Author: Simon Glass <sjg@chromium.org>
Date: Fri Mar 17 03:09:31 2017

pack_firmware.py: Tidy up a few missing comments

Fix a few function docstrings.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: Ia4192470c5ece454e52996ef944e4e603ab431b5
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/455228
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/6e414e8f41b5496d47a5ab40e6ad71869744f562/pack_firmware.py

Project Member

Comment 71 by bugdroid1@chromium.org, Mar 17 2017

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

commit ca6de3650587e075affb660abd3d50081c0f8fb7
Author: Simon Glass <sjg@chromium.org>
Date: Fri Mar 17 03:30:50 2017

pack_firmware.sh: Preserve time stamps when merging firmware

When merging RW firmware into RO, copy the timestamp over as well. This
matches the behaviour when not merging, and allows us to produce the same
output each time.

BUG= chromium:690573 
TEST=emerge-chell --nodeps chromeos-firmware-chell
with https://chromium-review.googlesource.com/c/442790/ applied

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

[modify] https://crrev.com/ca6de3650587e075affb660abd3d50081c0f8fb7/pack_firmware.sh

Project Member

Comment 72 by bugdroid1@chromium.org, Mar 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/86c29d5d66ca1d6cf0a35c13af693ccfb90d5573

commit 86c29d5d66ca1d6cf0a35c13af693ccfb90d5573
Author: Simon Glass <sjg@chromium.org>
Date: Fri Mar 17 20:04:15 2017

pack_firmware_unittest.py: Add a test for _BaseDirPath()

This is pretty trivial but we may as well have a test for it.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: If17586548d3f38e150d7d8a63c77276114dddd10
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/455230
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/86c29d5d66ca1d6cf0a35c13af693ccfb90d5573/pack_firmware_unittest.py

Project Member

Comment 73 by bugdroid1@chromium.org, Mar 17 2017

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

commit f123604a2b4f9e0a02a8c64865cb0b5669c865cd
Author: Simon Glass <sjg@chromium.org>
Date: Fri Mar 17 20:18:00 2017

pack_firmware.py: Support unified builds in the update script

With unified builds we need to set the UNIBUILD variable to 'yes' in the
update structure. Also most of the other variables are not used so we
shoud signal that to avoid confusion.

Adjust the behaviour based on a boolean 'unibuild' parameter. For now this
code is unused since we pass False for unibuild.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: I85432d0716316e44ece3035473d35114d924da3b
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/455227
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/f123604a2b4f9e0a02a8c64865cb0b5669c865cd/pack_firmware.py

Project Member

Comment 74 by bugdroid1@chromium.org, Mar 17 2017

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

commit f123604a2b4f9e0a02a8c64865cb0b5669c865cd
Author: Simon Glass <sjg@chromium.org>
Date: Fri Mar 17 20:18:00 2017

pack_firmware.py: Support unified builds in the update script

With unified builds we need to set the UNIBUILD variable to 'yes' in the
update structure. Also most of the other variables are not used so we
shoud signal that to avoid confusion.

Adjust the behaviour based on a boolean 'unibuild' parameter. For now this
code is unused since we pass False for unibuild.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: I85432d0716316e44ece3035473d35114d924da3b
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/455227
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/f123604a2b4f9e0a02a8c64865cb0b5669c865cd/pack_firmware.py

Project Member

Comment 75 by bugdroid1@chromium.org, Mar 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/2c7dd2e0fad0506f783c2acd2834e27632b437ff

commit 2c7dd2e0fad0506f783c2acd2834e27632b437ff
Author: Simon Glass <sjg@chromium.org>
Date: Fri Mar 17 20:25:22 2017

pack_firmware.py: Run tests with dash

Chrome OS uses the dash shell and the scripts will use that when they
include the '/bin/sh' shebang at the top. However the chroot uses bash
so the same shebang has a different meaning.

In order to make the test more faithful to the target environment,
add a way to change the shebank to explicitly select dash. This is only
used in tests and provides more confidence that we are not using
bash features in the firmware update scripts.

When this flag is enabled, the script replaces all shebangs with
/bin/dash.

While we are changing _CopyFile(), fix its documentation.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py
Also add a bash-specific construct in pacK_stub and see that the
functional tests now fail.

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

[modify] https://crrev.com/2c7dd2e0fad0506f783c2acd2834e27632b437ff/pack_firmware_functest.py
[modify] https://crrev.com/2c7dd2e0fad0506f783c2acd2834e27632b437ff/pack_firmware.py

Project Member

Comment 76 by bugdroid1@chromium.org, Mar 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/2c7dd2e0fad0506f783c2acd2834e27632b437ff

commit 2c7dd2e0fad0506f783c2acd2834e27632b437ff
Author: Simon Glass <sjg@chromium.org>
Date: Fri Mar 17 20:25:22 2017

pack_firmware.py: Run tests with dash

Chrome OS uses the dash shell and the scripts will use that when they
include the '/bin/sh' shebang at the top. However the chroot uses bash
so the same shebang has a different meaning.

In order to make the test more faithful to the target environment,
add a way to change the shebank to explicitly select dash. This is only
used in tests and provides more confidence that we are not using
bash features in the firmware update scripts.

When this flag is enabled, the script replaces all shebangs with
/bin/dash.

While we are changing _CopyFile(), fix its documentation.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py
Also add a bash-specific construct in pacK_stub and see that the
functional tests now fail.

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

[modify] https://crrev.com/2c7dd2e0fad0506f783c2acd2834e27632b437ff/pack_firmware_functest.py
[modify] https://crrev.com/2c7dd2e0fad0506f783c2acd2834e27632b437ff/pack_firmware.py

Project Member

Comment 77 by bugdroid1@chromium.org, Mar 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/2c7dd2e0fad0506f783c2acd2834e27632b437ff

commit 2c7dd2e0fad0506f783c2acd2834e27632b437ff
Author: Simon Glass <sjg@chromium.org>
Date: Fri Mar 17 20:25:22 2017

pack_firmware.py: Run tests with dash

Chrome OS uses the dash shell and the scripts will use that when they
include the '/bin/sh' shebang at the top. However the chroot uses bash
so the same shebang has a different meaning.

In order to make the test more faithful to the target environment,
add a way to change the shebank to explicitly select dash. This is only
used in tests and provides more confidence that we are not using
bash features in the firmware update scripts.

When this flag is enabled, the script replaces all shebangs with
/bin/dash.

While we are changing _CopyFile(), fix its documentation.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py
Also add a bash-specific construct in pacK_stub and see that the
functional tests now fail.

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

[modify] https://crrev.com/2c7dd2e0fad0506f783c2acd2834e27632b437ff/pack_firmware_functest.py
[modify] https://crrev.com/2c7dd2e0fad0506f783c2acd2834e27632b437ff/pack_firmware.py

Project Member

Comment 78 by bugdroid1@chromium.org, Mar 19 2017

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

commit 12c4c039850fff9fdb77d3e28d5e4f2bfcce0800
Author: Simon Glass <sjg@chromium.org>
Date: Sun Mar 19 00:45:23 2017

cros-firmware: Compare results of both pack_firmware scripts

A new Python-based pack_firmware script is now available. To provide
confidence that it does the same thing (bugs and features) as the existing
script, run both and compare the output.

Once this has successfully settled down, we can drop the old script.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
With test CL in place which modifies cros-firmware eclass to compare the
output of pack_firmware.sh and pack_firmware.py:
emerge-reef --nodeps chromeos-firmware-reef
emerge-x86-zgb --nodeps chromeos-firmware-zgb
(will do more using trybots)

Change-Id: I06fc03c2c3c4ca952151d290b5d820016f2600e1
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/442790
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/12c4c039850fff9fdb77d3e28d5e4f2bfcce0800/eclass/cros-firmware.eclass

@Simon Glass,
Excuse me 
i found the FW version can't be modified in chromeos-firmwareupdate via "./chromeos-firmwareupdate --sb_repack /tmp/sb", in fact, repack successfully and FW bin has been changed to the expected, but the version does not change in chromeos-firmwareupdate. i verified on bob and mickey, that's OK if i reverted the CL:452970.

(cr) ((a979a90...)) tomato@tomato-X751LN ~/trunk/src/scripts/tomato/mickey $ ./chromeos-firmwareupdate --sb_repack bios
Repacking from: bios
Changed TARGET_FWID to Google_Veyron_Mickey.6588.262.0
Changed TARGET_ROFWID to Google_Veyron_Mickey.6588.262.0
(cr) ((a979a90...)) tomato@tomato-X751LN ~/trunk/src/scripts/tomato/mickey $


if [ -z "${UNIBUILD}" ]; then
  # Version information. Please keep this in head of the updater.
  TARGET_RO_FWID="Google_Veyron_Mickey.6588.197.0"
  TARGET_FWID="Google_Veyron_Mickey.6588.197.0"
  TARGET_ECID="IGNORE"
  TARGET_PDID="IGNORE"
  TARGET_PLATFORM="Google_Veyron_Mickey"
  STABLE_FWID="Google_Veyron_Mickey.6588.168.0"
  STABLE_ECID=""
  STABLE_PDID=""
fi

Comment 80 by sjg@chromium.org, Mar 20 2017

Thanks for the report Tomato. Proposed fix here:

https://chromium-review.googlesource.com/c/457280/

thanks, CL:457280 Verify+1 :)
Project Member

Comment 82 by bugdroid1@chromium.org, Mar 21 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/1b5ccf7320f5de96e89bf404fb425d1848141159

commit 1b5ccf7320f5de96e89bf404fb425d1848141159
Author: Simon Glass <sjg@chromium.org>
Date: Tue Mar 21 21:04:02 2017

pack_firmware_functest: Put version reading in a separate function

We want to use this in other places, so move it into its own function.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: I7365786886e69990bbffb30383afec59e783817a
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/457279
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/1b5ccf7320f5de96e89bf404fb425d1848141159/pack_firmware_functest.py

Project Member

Comment 83 by bugdroid1@chromium.org, Mar 21 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/9c5e1175c5282c06e5777b8850d3fbd485279759

commit 9c5e1175c5282c06e5777b8850d3fbd485279759
Author: Simon Glass <sjg@chromium.org>
Date: Tue Mar 21 21:04:02 2017

pack_stub: Correct the operation of the version update

The version update feature (with --sb_repack) was broken by a recent
change. Fix this by allowing leading spaces in the script.

Also add a new test to verify that things work as expected.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: Ieddb93fc6827095000f13b9b8b8d5ae6f011f18b
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/457280
Reviewed-by: Dan Erat <derat@chromium.org>

[add] https://crrev.com/9c5e1175c5282c06e5777b8850d3fbd485279759/functest/base.fmd
[add] https://crrev.com/9c5e1175c5282c06e5777b8850d3fbd485279759/functest/fmap.bin
[modify] https://crrev.com/9c5e1175c5282c06e5777b8850d3fbd485279759/pack_stub
[modify] https://crrev.com/9c5e1175c5282c06e5777b8850d3fbd485279759/pack_firmware_functest.py

Project Member

Comment 84 by bugdroid1@chromium.org, Mar 22 2017

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

commit ba5b0abaa9843c15d2a4addf550fc1b806c16a52
Author: Simon Glass <sjg@chromium.org>
Date: Wed Mar 22 22:33:35 2017

coreboot-utils: Install fmaptool

This utility is useful for creating compiled FMAP files from .fmd files.
Add it to the build.

BUG= chromium:690573 
TEST=sudo emerge coreboot-utils
See that fmaptool is installed

Change-Id: I35bf056fb1d20d80bdeaa48856c8294c93d24bc2
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/457455
Reviewed-by: Martin Roth <martinroth@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/ba5b0abaa9843c15d2a4addf550fc1b806c16a52/sys-apps/coreboot-utils/coreboot-utils-9999.ebuild

Project Member

Comment 85 by bugdroid1@chromium.org, Mar 23 2017

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

commit ae28066e5ad00018f241066f2d44b8cb0125c830
Author: Simon Glass <sjg@chromium.org>
Date: Thu Mar 23 20:47:21 2017

pack_firmware.py: Use an empty version for local flashrom

Rather than returning a partial version string for a locally built flashrom,
return an empty one. This matches the behaviour of pack_firmware.sh.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: I70cb9757797d83d5cd8b3925460c2a6b5be5b983
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/457846
Reviewed-by: Aaron Durbin <adurbin@chromium.org>

[modify] https://crrev.com/ae28066e5ad00018f241066f2d44b8cb0125c830/pack_firmware_unittest.py
[modify] https://crrev.com/ae28066e5ad00018f241066f2d44b8cb0125c830/pack_firmware.py

Project Member

Comment 86 by bugdroid1@chromium.org, Mar 25 2017

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

commit e12e73a3027c79925291b7f6037e6f237d2d50f1
Author: Simon Glass <sjg@chromium.org>
Date: Sat Mar 25 02:37:50 2017

cros-firmware: Fix generation of local updater

This does not actually do what is intended due to a typo in an earlier
CL. Fix it and factor out the common -b flag at the same time.

BUG= chromium:690573 
TEST=USE=bootimage emerge-reef --nodeps  chromeos-firmware-reef
Release build outputs:
Changed TARGET_FWID to Google_Reef.9042.72.0
Changed TARGET_ROFWID to Google_Reef.9042.72.0
Changed TARGET_ECID to reef_v1.1.5891-37adb2a

See that the local firmware build outputs a different version:
Changed TARGET_FWID to Google_Reef.9394.0.2017_03_23_1345
Changed TARGET_ROFWID to Google_Reef.9394.0.2017_03_23_1345
Changed TARGET_ECID to reef_1.1.9999-7db12fd

Change-Id: I945c2e113ff3f97c4ab0b3236ecc6f6936256eb2
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/457932
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/e12e73a3027c79925291b7f6037e6f237d2d50f1/eclass/cros-firmware.eclass

Project Member

Comment 87 by bugdroid1@chromium.org, Mar 25 2017

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

commit c173b4f3fc81a03a57f3821cc9800bf245fdf0ab
Author: Simon Glass <sjg@chromium.org>
Date: Sat Mar 25 02:37:50 2017

cros-firmware: Refactor and comment _add_url()

With unified builds we need to call this in a different way since the
filename to read comes from the master configuration instead of a shell
variable.

Break out the core of the function to permit this, and add comments at
the same time.

BUG= chromium:690573 
TEST=USE=bootimage emerge-reef --nodeps chromeos-firmware-reef

Change-Id: I8554187d97efc995cb5229d911d28e0ecadab66c
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/457933
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/c173b4f3fc81a03a57f3821cc9800bf245fdf0ab/eclass/cros-firmware.eclass

Project Member

Comment 88 by bugdroid1@chromium.org, Mar 25 2017

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

commit eb984e0de782857954bdc3cea188eb73a26578c8
Author: Simon Glass <sjg@chromium.org>
Date: Sat Mar 25 02:37:51 2017

cros-firmware: Don't unpack files with unified builds

With unified builds file unpacking is done by the pack_firmware.py script
since it is just too complicated to unpack things for all the different
models in the eclass and pass all the resulting filenames for each model
to the script.

Adjust src_unpack() to do nothing when USE=unibuild is active.

Since this is the first CL that uses the unibuild flag in this eclass, add
it to IUSE and bring in the master configuration if needed.

BUG= chromium:690573 
TEST=USE=bootimage emerge-reef --nodeps chromeos-firmware-reef

Change-Id: Ie3b0e4f9fb3f72528353bd8fc3182913e781ab4f
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/457934
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/eb984e0de782857954bdc3cea188eb73a26578c8/eclass/cros-firmware.eclass

Project Member

Comment 89 by bugdroid1@chromium.org, Mar 25 2017

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

commit abb00be8570756117505379c1cdd3c80ce99d0c2
Author: Simon Glass <sjg@chromium.org>
Date: Sat Mar 25 02:37:51 2017

cros-firmware: Separate out the unsupported cases

We can't generate a local firmware update unless we have a main firmware
image. Move this check into its own part at the end, since it will apply
both for normal builds and unified builds. Do the same with the case where
we have no firmware images to pack.

BUG= chromium:690573 
TEST=USE="-bootimage cros_ec" emerge-reef --nodeps chromeos-firmware-reef
See the warning.

Change-Id: I796c84078981a68eba334c6affff70c54d854def
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/457935
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/abb00be8570756117505379c1cdd3c80ce99d0c2/eclass/cros-firmware.eclass

Project Member

Comment 90 by bugdroid1@chromium.org, Mar 25 2017

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

commit ad57aafffc0779193219316cb2299b3627feec92
Author: Simon Glass <sjg@chromium.org>
Date: Sat Mar 25 02:37:52 2017

cros-firmware: Sort out code order for non-unified build

We need to set up the extra parameters and output_file for both unified
and non-unified builds so move them to the top of the function. Also
adjust the local variable declarations to be closer to where they are
used.

BUG= chromium:690573 
TEST=USE=bootimage emerge-reef --nodeps chromeos-firmware-reef

Change-Id: Iaccc80f70b8566e231cbf8b6a919bd19457cef62
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/458897
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/ad57aafffc0779193219316cb2299b3627feec92/eclass/cros-firmware.eclass

Project Member

Comment 91 by bugdroid1@chromium.org, Mar 25 2017

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

commit 49b10f198f7ef082b33d9e8056ca4849bcc5b493
Author: Simon Glass <sjg@chromium.org>
Date: Sat Mar 25 02:37:51 2017

cros-firmware: Move the existing code inside if..fi

The existing code will not be used with unified builds. Put it inside an
'if' to show this and move all the local firmware code under
'if use bootimage' for clarity.

This is mostly to make the changes easier to review.

BUG= chromium:690573 
TEST=USE=bootimage emerge-reef --nodeps chromeos-firmware-reef

Change-Id: Ic18be2324c1788887a9d67bd40ba431938b428c6
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/458896
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/49b10f198f7ef082b33d9e8056ca4849bcc5b493/eclass/cros-firmware.eclass

Project Member

Comment 92 by bugdroid1@chromium.org, Mar 25 2017

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

commit d021acf55e6ab56d99dbcfa89e215b232adc3b98
Author: Simon Glass <sjg@chromium.org>
Date: Sat Mar 25 20:37:59 2017

pack_stub/pack_dist: Update on-device scripts for unified builds

With unified builds the firmware update has an extra step at the start
since it needs to support updating multiple models. We need to check the
device's model at the start.

This task is performed by the new cros_set_unibuild_vars() function. When
called it reads the model name from the hardware ID (HWID). It uses this
model name to find the file containing shell variable assignments for the
model. The file is created (in a later CL) from setvars_template, with
appropriate values substituted in !the 'REPLACE_...' strings.

Once this file is executed, we are in the same position as for a
single-model firmware update: we know the images and versions to be used
by the update.

From there the firmware update proceeds as normal.

Therefore the only change needed in the updater*.sh scripts is to call
this new cros_set_unibuild_vars() function at the start. Update
updater4.sh to do this so we can support firmware update with unified
builds on reef.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: I7c6f67851292ca582ca8e337e4d0b18c1313feec
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/452971
Reviewed-by: Hung-Te Lin <hungte@chromium.org>

[modify] https://crrev.com/d021acf55e6ab56d99dbcfa89e215b232adc3b98/pack_dist/crosutil.sh
[add] https://crrev.com/d021acf55e6ab56d99dbcfa89e215b232adc3b98/setvars_template
[modify] https://crrev.com/d021acf55e6ab56d99dbcfa89e215b232adc3b98/pack_dist/updater4.sh

Project Member

Comment 93 by bugdroid1@chromium.org, Apr 2 2017

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

commit c7595d58ae54abe0d0c195e8e04fb564d7dcfe2d
Author: Simon Glass <sjg@chromium.org>
Date: Sun Apr 02 19:57:29 2017

cros-unibuild: Add functions for reading strings

We need to read strings and list of strings from the master configuration.
Add some functions for this.

BUG= chromium:690573 
TEST=USE=unibuild emerge-reef --nodeps chromeos-firmware-reef
With other changes, see that it produces a valid firmware update.

Change-Id: I642c1906c1d593766b650e24f95b7aefde6e5f7b
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/458898
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/c7595d58ae54abe0d0c195e8e04fb564d7dcfe2d/eclass/cros-unibuild.eclass

Project Member

Comment 94 by bugdroid1@chromium.org, Apr 2 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/2449a8852dc7b5603ebb74576f79d36cc44a1b74

commit 2449a8852dc7b5603ebb74576f79d36cc44a1b74
Author: Simon Glass <sjg@chromium.org>
Date: Sun Apr 02 19:57:29 2017

pack_firmware.py: Add functions to access master configuration

We need to read firmware parameters from the master configuration. Add
some functions to do this, using the Python libfdt bindings. Also add
a helper method to extract a tar file and a -l flag to control whether
it works with local image files or with tarred-up image files files from
BCS.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

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

[modify] https://crrev.com/2449a8852dc7b5603ebb74576f79d36cc44a1b74/pack_firmware_unittest.py
[add] https://crrev.com/2449a8852dc7b5603ebb74576f79d36cc44a1b74/test/config.dtb
[modify] https://crrev.com/2449a8852dc7b5603ebb74576f79d36cc44a1b74/pack_firmware.py
[add] https://crrev.com/2449a8852dc7b5603ebb74576f79d36cc44a1b74/functest/Reef_EC.9042.50.0.tbz2

Project Member

Comment 95 by bugdroid1@chromium.org, Apr 3 2017

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

commit abf65161ab73baf0b3cc5fcbe57cbd864c751417
Author: Simon Glass <sjg@chromium.org>
Date: Mon Apr 03 00:21:08 2017

pack_firmware.py: Adjust the logic in _ExtractFile()

At present with a local firmware update, we try to add all available
images. But some images may not be valid. For example if a model does not
have a PD image in its normal firmware update, we should not add one in
its local firmware update either.

Adjust the logic in _ExtractFile() to handle this automatically.

Signed-off-by: Simon Glass <sjg@chromium.org>
BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

Change-Id: I5982e48fb67792f79266a47a74380dce3b43a198
Reviewed-on: https://chromium-review.googlesource.com/459120
Tested-by: Simon Glass <sjg@chromium.org>
Commit-Queue: Simon Glass <sjg@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/abf65161ab73baf0b3cc5fcbe57cbd864c751417/pack_firmware_unittest.py
[modify] https://crrev.com/abf65161ab73baf0b3cc5fcbe57cbd864c751417/pack_firmware.py

Project Member

Comment 96 by bugdroid1@chromium.org, Apr 3 2017

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

commit df16601bd66a249b05ebce8c2946412a911d2629
Author: Simon Glass <sjg@chromium.org>
Date: Mon Apr 03 10:58:16 2017

pack_firmware.py: Generate unified build firmware updates

Now that all the pieces are in place we can add support for generating a
firmware update that works on multiple models.

The shellball is created as normal, but we add a separate directory in it
for each model, and place the required files in there. A 'setvars.sh' file
provides the shell variables for the model. The list of models supported
is supplied with the -m flag on the command line. Information about which
iamges and versions to pack into the update comes from the Chrome OS master
configuration file, provided by the -c flag.

Add a few unit tests and a functional test. The latter runs an update on
two models to check that it is happy with either.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm python pack_firmware_unittest.py
PYTHONPATH=~/cosarm python pack_firmware_functest.py

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

[add] https://crrev.com/df16601bd66a249b05ebce8c2946412a911d2629/test/extra/fake_extra_tool
[add] https://crrev.com/df16601bd66a249b05ebce8c2946412a911d2629/test/usr/sbin/ectool
[add] https://crrev.com/df16601bd66a249b05ebce8c2946412a911d2629/functest/Reef.9000.0.0.tbz2
[modify] https://crrev.com/df16601bd66a249b05ebce8c2946412a911d2629/pack_firmware_unittest.py
[add] https://crrev.com/df16601bd66a249b05ebce8c2946412a911d2629/test/reef-files/reef_fake_extra
[modify] https://crrev.com/df16601bd66a249b05ebce8c2946412a911d2629/pack_firmware.py
[add] https://crrev.com/df16601bd66a249b05ebce8c2946412a911d2629/functest/Pyro_EC.9042.41.0.tbz2
[modify] https://crrev.com/df16601bd66a249b05ebce8c2946412a911d2629/pack_firmware_functest.py
[add] https://crrev.com/df16601bd66a249b05ebce8c2946412a911d2629/functest/mosys
[add] https://crrev.com/df16601bd66a249b05ebce8c2946412a911d2629/functest/Pyro.9042.41.0.tbz2

Project Member

Comment 97 by bugdroid1@chromium.org, Apr 4 2017

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

commit 51e79b55c0f48a1731fd419a38eaed44d2dfc19c
Author: Simon Glass <sjg@chromium.org>
Date: Tue Apr 04 02:09:24 2017

cros-firmware: Avoid using eval in _add_uri

At present we pass the variable to appended as a parameter. Instead we can
echo the value and have the caller append it to whatever variable it
likes.

BUG= chromium:690573 
TEST=FEATURES=test emerge-reef --nodeps chromeos-firmware-reef

Change-Id: Icab61a4102eba406588a77bcfe610017ebcbc314
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/466446
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/51e79b55c0f48a1731fd419a38eaed44d2dfc19c/eclass/cros-firmware.eclass

@Simon Glass,
Excuse me, i can't build chromeos-firmwareupdate successfully after cl:455229 merged. The fail massage as bellow. I verified on cave. Please help check, thanks.

Packed output image is: chromeos-firmwareupdate
Traceback (most recent call last):
  File "./pack_firmware.py", line 33, in <module>
    import libfdt
ImportError: No module named libfdt
 * ERROR: chromeos-base/chromeos-firmware-cave-9999::cave-private failed (compile phase):
 *   Cannot pack firmware using Python script.
 * 
 * Call stack:
 *     ebuild.sh, line   93:  Called src_compile
 *   environment, line 3512:  Called cros-firmware_src_compile
 *   environment, line  810:  Called die
 * The specific snippet of code:
 *               ./pack_firmware.py "${image_cmd[@]}" "${ext_cmd[@]}" -o "${UPDATE_SCRIPT}.PY" || die "Cannot pack firmware using Python script.";
 * 
 * If you need support, post the output of `emerge --info '=chromeos-base/chromeos-firmware-cave-9999::cave-private'`,
 * the complete build log and the output of `emerge -pqv '=chromeos-base/chromeos-firmware-cave-9999::cave-private'`.
 * The complete build log is located at '/build/cave/tmp/portage/logs/chromeos-base:chromeos-firmware-cave-9999:20170405-080446.log'.
 * For convenience, a symlink to the build log is located at '/build/cave/tmp/portage/chromeos-base/chromeos-firmware-cave-9999/temp/build.log'.
 * The ebuild environment file is located at '/build/cave/tmp/portage/chromeos-base/chromeos-firmware-cave-9999/temp/environment'.
 * Working directory: '/build/cave/tmp/portage/chromeos-base/chromeos-firmware-cave-9999/work/chromeos-firmware-cave-9999'
 * S: '/build/cave/tmp/portage/chromeos-base/chromeos-firmware-cave-9999/work/chromeos-firmware-cave-9999'

Comment 99 by sjg@chromium.org, Apr 5 2017

Hi Sarah, is it possible that you have an inconsistent checkout or build?

Can you try:

   repo sync
   ./build_packages --board=cave

I have not tested a build on cave but will do so today.

Comment 100 by sjg@chromium.org, Apr 5 2017

My cave build completed OK, so I think the above steps might fix it for you.
Project Member

Comment 101 by bugdroid1@chromium.org, Apr 6 2017

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

commit c1118b67f7a5f32941cf0521ac5f07d9410a55d8
Author: Simon Glass <sjg@chromium.org>
Date: Thu Apr 06 17:56:33 2017

Clean up files and invoke the linter

Fix / disable the pylint warnings so that we can enable the linter.

Enable the linter as a pre-submit check.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm:utils pylint *.py
Change-Id: Id81c7ae972a491613b5fd7b2a817bcbba9337400
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/466089

[modify] https://crrev.com/c1118b67f7a5f32941cf0521ac5f07d9410a55d8/pack_firmware_functest.py
[modify] https://crrev.com/c1118b67f7a5f32941cf0521ac5f07d9410a55d8/pack_firmware.py
[modify] https://crrev.com/c1118b67f7a5f32941cf0521ac5f07d9410a55d8/pack_firmware_unittest.py
[modify] https://crrev.com/c1118b67f7a5f32941cf0521ac5f07d9410a55d8/PRESUBMIT.cfg

Project Member

Comment 102 by bugdroid1@chromium.org, Apr 7 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/c7f6a6d912aed5391d9747c8d436e4d26ccf7dff

commit c7f6a6d912aed5391d9747c8d436e4d26ccf7dff
Author: Simon Glass <sjg@chromium.org>
Date: Fri Apr 07 17:43:29 2017

chromeos-config: Update binding for firmware

Add bindings for firmware updates. These are implemented by
pack_firmware.py and replace the ebuild variables in cros-firmware.eclass
when unified builds are used.

BUG= chromium:690573 
TEST=none
Change-Id: Ic3c51ad540dda093704fb82ce7e261298c2d1e45
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/445974

[modify] https://crrev.com/c7f6a6d912aed5391d9747c8d436e4d26ccf7dff/chromeos-config/README.md

Project Member

Comment 103 by bugdroid1@chromium.org, Apr 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/53d70c06d08339c6f23114b7a05c938e1f58a781

commit 53d70c06d08339c6f23114b7a05c938e1f58a781
Author: Simon Glass <sjg@chromium.org>
Date: Tue Apr 11 23:41:10 2017

Add a tool to convert ebuild variables

When converting to unified builds we will need to convert several ebuild
files to the master configuration format. This might need to be done many
times as migration continues. Add a tool to automate this.

BUG= chromium:690573 

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

[add] https://crrev.com/53d70c06d08339c6f23114b7a05c938e1f58a781/test/chromeos-firmware-reef-9999.ebuild
[add] https://crrev.com/53d70c06d08339c6f23114b7a05c938e1f58a781/convert_to_model.py
[add] https://crrev.com/53d70c06d08339c6f23114b7a05c938e1f58a781/convert_to_model
[add] https://crrev.com/53d70c06d08339c6f23114b7a05c938e1f58a781/test/chromeos-firmware-reef-0.0.1-r56.ebuild
[add] https://crrev.com/53d70c06d08339c6f23114b7a05c938e1f58a781/convert_to_model_unittest.py

Project Member

Comment 104 by bugdroid1@chromium.org, Apr 12 2017

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

commit 560f4f360104579583dba9d6021ff28192daa35a
Author: Simon Glass <sjg@chromium.org>
Date: Wed Apr 12 06:25:59 2017

cros-firmware: Download files for unified builds firmware update

With unified builds the files to be included in the update are listed in
the master configuration. We still need to download them from BCS, so add
a new setup function which handles this.

When unified builds is being used, this new function (called
cros-firmware_setup_source_unibuild()) should be called from the
chromeos-firmware-<board> ebuild instead of cros-firmware_setup_source().

It would be better to have this happen automatically based on the unibuild
USE flag. We could check this in cros-firmware_setup_source() and do the
right thing. However it does not seem to be possible to access USE flags
that early in the eclass.

BUG= chromium:690573 
TEST=USE=unibuild emerge-reef --nodeps chromeos-firmware-reef
With other changes, see that it produces a valid firmware update.

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

[modify] https://crrev.com/560f4f360104579583dba9d6021ff28192daa35a/eclass/cros-firmware.eclass

Project Member

Comment 105 by bugdroid1@chromium.org, Apr 12 2017

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

commit 0773d68f128a77d074c5c4b562b484e5b7ead99a
Author: Simon Glass <sjg@chromium.org>
Date: Wed Apr 12 06:25:58 2017

cros-unibuild: Allow configuration access without a ROOT

The SRC_URI variable is calculated very early during ebuild processing and
there is no guarantee that there is even a root directory in existence. So
if we want to look up information for this variable we cannot obtain the
configuration in the normal way.

Provide a separate function which can get the configuration directly from
the source ebuild via a symlink.

BUG= chromium:690573 
TEST=USE=unibuild emerge-reef --nodeps chromeos-firmware-reef
See that it still manages to set up SRC_URI and download the files

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

[modify] https://crrev.com/0773d68f128a77d074c5c4b562b484e5b7ead99a/eclass/cros-unibuild.eclass

Project Member

Comment 106 by bugdroid1@chromium.org, Apr 13 2017

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

commit ec238addbacd52408f3c6b22a3963f720ee6bd36
Author: Simon Glass <sjg@chromium.org>
Date: Thu Apr 13 03:22:26 2017

convert_to_model: Add a way to update the Manifest

It is useful to automatically update the Manifest when generating the
configuration. Output the command to do this when appropriate.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm ./convert_to_model_unittest.py
Change-Id: I3af6d71c4e8054247a2ddb3bc93ebffd06fab140
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/470108
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/ec238addbacd52408f3c6b22a3963f720ee6bd36/convert_to_model.py
[modify] https://crrev.com/ec238addbacd52408f3c6b22a3963f720ee6bd36/convert_to_model_unittest.py

Project Member

Comment 107 by bugdroid1@chromium.org, Apr 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/1641e8dbc831054c9fb65ffa9011f01cf213f76d

commit 1641e8dbc831054c9fb65ffa9011f01cf213f76d
Author: Simon Glass <sjg@chromium.org>
Date: Thu Apr 13 03:22:26 2017

convert_to_model: Adjust output to match final form

While we can't normally just cut and paste the config output into the
model configuration (since there will be other configuration items beside
firmware) it makes sense to match the final form as much as possible.

To help with this, add a 'firmware' node and make sure we don't output
trailing spaces.

BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm ./convert_to_model_unittest.py

Change-Id: I20857bb57a0039c3054df0bc401df98130ab3b61
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/475092
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/1641e8dbc831054c9fb65ffa9011f01cf213f76d/convert_to_model.py
[modify] https://crrev.com/1641e8dbc831054c9fb65ffa9011f01cf213f76d/convert_to_model_unittest.py

Project Member

Comment 108 by bugdroid1@chromium.org, Apr 15 2017

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

commit 15597d55d4ce9d2c206c069743a2ed4016deae83
Author: Simon Glass <sjg@chromium.org>
Date: Sat Apr 15 17:56:05 2017

cros-firmware: Add support for unified builds

Add support for creating a firmware update for unified builds. This mostly
relies on the pack_firmware.py script, which is able to read information
from the master configuration to decide what to include in the update for
each model.

BUG= chromium:690573 
TEST=USE=unibuild emerge-reef --nodeps chromeos-firmware-reef
With other changes, see that it produces a valid firmware update
Signed-off-by: Simon Glass <sjg@chromium.org>

Change-Id: Ie88d9afe082b96057b24f42d385185c89defb7b6
Reviewed-on: https://chromium-review.googlesource.com/458900
Commit-Ready: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/15597d55d4ce9d2c206c069743a2ed4016deae83/eclass/cros-firmware.eclass

Comment 109 by sjg@chromium.org, Apr 17 2017

Status: Fixed (was: Started)
Completed
- Rewrite of existing script in Python with unit and functional tests
- Support for unified build in the packer and the run-time script
- Automatic script to create master configuration for firmware from an existing ebuild
- cros-unibuild.eclass has some helpers

Comment 110 by sjg@google.com, Jun 15 2017

Blockedon: 732538
Status: Started (was: Fixed)
Need to support work-arounds for reef-uni since we cannot re-use the 'reef' board.
Project Member

Comment 111 by bugdroid1@chromium.org, Jun 17 2017

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

commit d6d3bc5e9014cec419b8430a840f72a33d336591
Author: Simon Glass <sjg@chromium.org>
Date: Sat Jun 17 00:24:25 2017

convert_to_model: Support the special case for 'reef-uni'

Unfortunately due to the structure of cbuildbot and GoldenEye we are
unable to have the reef overlay produce both unified and non-unified
builds. As a work-around, the 'reef-uni' board was created. Adjust the
script to support this.

Signed-off-by: Simon Glass <sjg@chromium.org>
BUG= chromium:732538 
BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm ./convert_to_model_unittest.py

Change-Id: I05cb8336aa5580a996e311620307fe3c142252a6
Reviewed-on: https://chromium-review.googlesource.com/537178
Commit-Ready: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[modify] https://crrev.com/d6d3bc5e9014cec419b8430a840f72a33d336591/convert_to_model.py
[modify] https://crrev.com/d6d3bc5e9014cec419b8430a840f72a33d336591/convert_to_model_unittest.py

Project Member

Comment 112 by bugdroid1@chromium.org, Jun 17 2017

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

commit d6d3bc5e9014cec419b8430a840f72a33d336591
Author: Simon Glass <sjg@chromium.org>
Date: Sat Jun 17 00:24:25 2017

convert_to_model: Support the special case for 'reef-uni'

Unfortunately due to the structure of cbuildbot and GoldenEye we are
unable to have the reef overlay produce both unified and non-unified
builds. As a work-around, the 'reef-uni' board was created. Adjust the
script to support this.

Signed-off-by: Simon Glass <sjg@chromium.org>
BUG= chromium:732538 
BUG= chromium:690573 
TEST=PYTHONPATH=~/cosarm ./convert_to_model_unittest.py

Change-Id: I05cb8336aa5580a996e311620307fe3c142252a6
Reviewed-on: https://chromium-review.googlesource.com/537178
Commit-Ready: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[modify] https://crrev.com/d6d3bc5e9014cec419b8430a840f72a33d336591/convert_to_model.py
[modify] https://crrev.com/d6d3bc5e9014cec419b8430a840f72a33d336591/convert_to_model_unittest.py

Comment 113 by sjg@google.com, Jun 19 2017

Status: Fixed (was: Started)
Project Member

Comment 114 by bugdroid1@chromium.org, Sep 26 2017

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

commit 0ce010b0b414f27734c9e09ddbb2af736a91f027
Author: Simon Glass <sjg@chromium.org>
Date: Tue Sep 26 23:14:04 2017

pack_firmware: Add a test for -V output

When the firmware updater is run with the first argument -V it outputs
version information for the firmware it contains and a list of file
checksums.

At present there is no test for this. Add one.

BUG= chromium:761228 ,  chromium:690573 
TEST=PYTHONPATH=~/c python pack_firmware_unittest.py && \
    PYTHONPATH=~/c python pack_firmware_functest.py

Change-Id: I184343472aab76581e7a94a379280814118ad445
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/684534
Reviewed-by: Jason Clinton <jclinton@chromium.org>
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/0ce010b0b414f27734c9e09ddbb2af736a91f027/pack_firmware_functest.py

Project Member

Comment 115 by bugdroid1@chromium.org, Sep 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/54e567ec23fa7e4ad6fe0f0e19e6b55dc2a5e30d

commit 54e567ec23fa7e4ad6fe0f0e19e6b55dc2a5e30d
Author: Simon Glass <sjg@chromium.org>
Date: Tue Sep 26 23:14:05 2017

pack_firmware: Move test setup into a function

We plan to use the same arguments to the firmware packer in several tests.
In preparation for this, move the new setup code into a new function.

BUG= chromium:761228 ,  chromium:690573 
TEST=PYTHONPATH=~/c python pack_firmware_unittest.py && \
    PYTHONPATH=~/c python pack_firmware_functest.py

Change-Id: Iaa192b54b0b300ea1c99f544386324d7458dd71d
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/684535
Reviewed-by: Jason Clinton <jclinton@chromium.org>
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/54e567ec23fa7e4ad6fe0f0e19e6b55dc2a5e30d/pack_firmware_functest.py

Project Member

Comment 116 by bugdroid1@chromium.org, Sep 26 2017

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

commit 89ac5dc83cc7851368971bb731c8591bc3c22501
Author: Simon Glass <sjg@chromium.org>
Date: Tue Sep 26 23:14:05 2017

pack_firmware: Add a test for the 'output' mode

Running the firmware updater with mode 'output' writes out the firmware
files to the given directory. Add a simple test for this. It does not
currently cover the updater's replacement of root key / vblock regions,
so the contents of these are ignored.

BUG= chromium:761228 ,  chromium:690573 
TEST=PYTHONPATH=~/c python pack_firmware_unittest.py && \
    PYTHONPATH=~/c python pack_firmware_functest.py

Change-Id: I445df67cdc72761316d8c1a92e52c84898340c8e
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/684536
Reviewed-by: Jason Clinton <jclinton@chromium.org>
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/89ac5dc83cc7851368971bb731c8591bc3c22501/pack_firmware_functest.py

Project Member

Comment 117 by bugdroid1@chromium.org, Sep 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/3330e07b88f36c3e678cdddc1edd9ed0fb227fff

commit 3330e07b88f36c3e678cdddc1edd9ed0fb227fff
Author: Simon Glass <sjg@chromium.org>
Date: Tue Sep 26 23:14:05 2017

pack_firmware: Add a test for signed firmware output

The firmware updater now supports a mode where it outputs signed firmware
for a given model. This works by starting with a base image and inserting
the rootkey/vblock regions (generated by the signer) into the image.

Add a test that this works correctly. For this we use predefined rootkey /
vblock files. These are compressed to save ~240KB of space in the repo.

We don't currently have a test of signer functionality (see for example
crbug.com/767395) but this test checks that the firware updater operates
as intended. Since the 'output' and 'autoupdate' modes use the same code
to generate the image for a model, this test has the happy side benefit
of adding test coverage for this important part of the autoupdate mode.

BUG= chromium:761228 ,  chromium:690573 
TEST=PYTHONPATH=~/c python pack_firmware_unittest.py && \
    PYTHONPATH=~/c python pack_firmware_functest.py

Change-Id: I9182966440d471d730e4e5ff545144a5bec0cc51
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/684537
Reviewed-by: Jason Clinton <jclinton@chromium.org>
Reviewed-by: C Shapiro <shapiroc@google.com>

[add] https://crrev.com/3330e07b88f36c3e678cdddc1edd9ed0fb227fff/functest/vblock_A.reef.gz
[add] https://crrev.com/3330e07b88f36c3e678cdddc1edd9ed0fb227fff/functest/vblock_B.electro.gz
[add] https://crrev.com/3330e07b88f36c3e678cdddc1edd9ed0fb227fff/functest/vblock_B.reef.gz
[add] https://crrev.com/3330e07b88f36c3e678cdddc1edd9ed0fb227fff/functest/rootkey.electro
[add] https://crrev.com/3330e07b88f36c3e678cdddc1edd9ed0fb227fff/functest/rootkey.reef
[modify] https://crrev.com/3330e07b88f36c3e678cdddc1edd9ed0fb227fff/pack_firmware_functest.py
[add] https://crrev.com/3330e07b88f36c3e678cdddc1edd9ed0fb227fff/functest/vblock_A.electro.gz

Project Member

Comment 118 by bugdroid1@chromium.org, Sep 27 2017

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

commit fd1cc50938ec23aec3ee29b2c4157df0797a64a9
Author: Simon Glass <sjg@chromium.org>
Date: Wed Sep 27 19:57:55 2017

pack_firmware: Run flashrom with 'sudo' in chroot

When running tests from the ebuild, /usr/sbin/flashrom does not start up
because it cannot access the lock file:

Cannot open lockfile /run/lock/firmware_utility_lockCould not acquire lock.

The invocation silently fails and is not detected by the firmware update
script and this causes it to fail to insert the expected keys.

The update script normally runs as root on a device, so this problem is
avoided in practice. For tests, trying to invoke the updater itself with
'sudo' causes the following error:

ERROR: ld.so: object 'libsandbox.so' from LD_PRELOAD cannot be preloaded
   (cannot open shared object file): ignored.

For tests the easiest fix is to invoke flashrom with 'sudo'.

Update the fake flashrom script to do this.

BUG= chromium:761228 ,  chromium:690573 
TEST=FEATURES=test emerge-reef-uni chromeos-firmware-update
FEATURES=test sudo -E emerge-reef-uni chromeos-firmware-update
Change-Id: I296596445bd92ff926e2e7dca59d839c10b65e31
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/686994
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[modify] https://crrev.com/fd1cc50938ec23aec3ee29b2c4157df0797a64a9/functest/flashrom
[modify] https://crrev.com/fd1cc50938ec23aec3ee29b2c4157df0797a64a9/pack_firmware_functest.py

Project Member

Comment 119 by bugdroid1@chromium.org, Sep 27 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/9756e2ed5cf5be52a794f5d6a561e8b5ecc94e79

commit 9756e2ed5cf5be52a794f5d6a561e8b5ecc94e79
Author: Simon Glass <sjg@chromium.org>
Date: Wed Sep 27 19:57:55 2017

pack_firmware: Refactor _SetupArgs() to return expected files

We have code which figures out the expected files in a firmware update.
Move this into _SetupArgs() which has two benefits:

- There is no need to return the model anymore
- We can return the list of expected files which will be used by more than
    one test

BUG= chromium:761228 ,  chromium:690573 
TEST=PYTHONPATH=~/c python pack_firmware_unittest.py && \
   PYTHONPATH=~/c python pack_firmware_functest.py

Change-Id: Ib53f930554d80fc4185a171c61eefcabc2099a6b
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/686995
Reviewed-by: Jason Clinton <jclinton@chromium.org>
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/9756e2ed5cf5be52a794f5d6a561e8b5ecc94e79/pack_firmware_functest.py

Project Member

Comment 120 by bugdroid1@chromium.org, Sep 27 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/3d07c3814c57688a0c3d08c233669349e66e97a5

commit 3d07c3814c57688a0c3d08c233669349e66e97a5
Author: Simon Glass <sjg@chromium.org>
Date: Wed Sep 27 19:57:55 2017

pack_firmware: Split -V testing into its own test

This test was originally tacked onto the end of the unified build test to
save run time, but really that does not seem very important.

Split it out into its own test in preparation for adding a special case
for this code path. This allows us to see what is actually needed to make
-V work (it doesn't need to run the fake scripts so does not need
environment variables to be set up).

BUG= chromium:761228 ,  chromium:690573 
TEST=PYTHONPATH=~/c python pack_firmware_unittest.py && \
    PYTHONPATH=~/c python pack_firmware_functest.py
Change-Id: I4f099bef2dc48dbab11dc63194cfb7d3873a747b
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/686996
Reviewed-by: Jason Clinton <jclinton@chromium.org>
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/3d07c3814c57688a0c3d08c233669349e66e97a5/pack_firmware_functest.py

Project Member

Comment 121 by bugdroid1@chromium.org, Sep 27 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/firmware/+/6f755ff0fea3a797285b35778465a30309078108

commit 6f755ff0fea3a797285b35778465a30309078108
Author: Simon Glass <sjg@chromium.org>
Date: Wed Sep 27 19:57:55 2017

pack_firmware: Simplify the -V test

This test sets up a lot of environment variables that are not needed by
the firmware upgrade script for the -V case. Separate out the code to make
it clearer what is needed.

BUG= chromium:761228 ,  chromium:690573 
TEST=PYTHONPATH=~/c python pack_firmware_unittest.py && \
    PYTHONPATH=~/c python pack_firmware_functest.py

Change-Id: Id651373b8eb3d343c54be6f0dd0fe8674a98e726
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/686997
Reviewed-by: Jason Clinton <jclinton@chromium.org>
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/6f755ff0fea3a797285b35778465a30309078108/pack_firmware_functest.py

Showing comments 22 - 121 of 121 Older

Sign in to add a comment