New issue
Advanced search Search tips

Issue 781928 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2017
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Feature

Blocked on:
issue 775220



Sign in to add a comment

Support whitelabels for the same model

Project Member Reported by sjg@chromium.org, Nov 6 2017

Issue description

At present the whitelabel implementation works with a separate model for each whitelabel device. This maps model and device 1:1 in GoldenEye.

However some projects have a very large number of whitelabels and it is confusing to have so many models which are almost the same config. It is desirable to support whitelabels as a special case, where we just specify the few things that are different, within the same model.

This bug tracks that work:
- update the schema to support this
- add support in the firmware packer (including generating correct signing instructions)
- check that no changes are needed in GoldenEye, cbuildbot, signer, etc.
- deal with any problems that come up
 

Comment 1 by sjg@chromium.org, Nov 6 2017

Blockedon: 775220
Project Member

Comment 2 by bugdroid1@chromium.org, Nov 15 2017

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

commit 2bfcf1ec807a1baa745438774f68fa565f36ae19
Author: Simon Glass <sjg@chromium.org>
Date: Wed Nov 15 05:52:41 2017

chromeos-config: Add alternative whitelabel support

With this schema addition, we can have whitelabels which are not models,
but are all in the same model, with just the keys (and perhaps a few other
things) being different. This is useful for situations where we have (say)
90 different whitelabels and the overhead of seeing these all in GoldenEye
is too great.

BUG= chromium:781928 
TEST=PYTHONPATH=~/c python libcros_config_host_unittest.py
Manually tested on robo
Also manually tested by making robo a whitelabel and setting up vpd
Compared reset of the new and old schema and see that the firmware update
produced is identical, except for  crbug.com/784566 

Change-Id: Iced75f4257db5b0f9a7255959f468b722cd8d919
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/763907
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[modify] https://crrev.com/2bfcf1ec807a1baa745438774f68fa565f36ae19/chromeos-config/libcros_config/test.dts
[modify] https://crrev.com/2bfcf1ec807a1baa745438774f68fa565f36ae19/chromeos-config/cros_config_main.cc
[modify] https://crrev.com/2bfcf1ec807a1baa745438774f68fa565f36ae19/chromeos-config/libcros_config/lookup.cc
[modify] https://crrev.com/2bfcf1ec807a1baa745438774f68fa565f36ae19/chromeos-config/libcros_config/cros_config.cc
[modify] https://crrev.com/2bfcf1ec807a1baa745438774f68fa565f36ae19/chromeos-config/cros_config_host/cros_config_host_unittest.py
[modify] https://crrev.com/2bfcf1ec807a1baa745438774f68fa565f36ae19/chromeos-config/cros_config_host/libcros_config_host_unittest.py
[modify] https://crrev.com/2bfcf1ec807a1baa745438774f68fa565f36ae19/chromeos-config/libcros_config/cros_config_unittest.cc
[modify] https://crrev.com/2bfcf1ec807a1baa745438774f68fa565f36ae19/chromeos-config/cros_config_host/libcros_config_host.py
[modify] https://crrev.com/2bfcf1ec807a1baa745438774f68fa565f36ae19/chromeos-config/cros_config_host/fdt_unittest.py
[modify] https://crrev.com/2bfcf1ec807a1baa745438774f68fa565f36ae19/chromeos-config/libcros_config/cros_config.h
[modify] https://crrev.com/2bfcf1ec807a1baa745438774f68fa565f36ae19/chromeos-config/cros_config_host/validate_config.py

Comment 3 by sjg@chromium.org, Nov 17 2017

Status: Started (was: Untriaged)
Project Member

Comment 5 by bugdroid1@chromium.org, Nov 20 2017

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

commit e68641744aaaa8f83f4342b81e0287fab3482aae
Author: Simon Glass <sjg@chromium.org>
Date: Mon Nov 20 16:03:10 2017

Add support for alternative whitelabel schema

This request came up during a code review for the cros_config support
for the alternative whitelabel schema. At present the firmware updater
calls 'vpd' directly to read the customization ID and uses that as the
signature ID for accessing vblock/rootkey files. With this change it will
be able to call mosys, which in turn calls vpd_get_value which reads the
customization_id from /sys/firmware/vpd/ro/customization_id

The other option here would be to call 'vpd'. In the case where the RO vpd
has been updated since boot, this might be a better option. The downside
is that it takes about 700ms to run. But since this will only be used in
the firmware updater, that doesn't matter.

I've gone with vpd_get_value since that is what mosys uses elsewhere to
read vpd, so I though it best to keep things consistent.

This adds some more whitelabel support to mosys. Hopefully we can drop
this eventually by moving things to use cros_config. For now we need to
implement part of the whitelabel support in mosys to make everything work.
The discussion of moving to using cros_config in the firmware updater is
best had after we have better library support. [1]

With this feature, mosys can obtain the brand code and the signature ID
for whitelabels.

[1] https://chromium-review.googlesource.com/c/chromiumos/platform/firmware/+/668321

BUG= chromium:781928 
BRANCH=none
TEST=FEATURES=test emerge-coral mosys
Basic whitelabel santiy test on robo (with config hacked to make robo a
whitelabel)
$ /tmp/mosys platform signature
whitetip1

Change-Id: I40d2db63de66cebbc88c8af34376da70b9a10dc2
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/770653
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[modify] https://crrev.com/e68641744aaaa8f83f4342b81e0287fab3482aae/lib/misc/sku.c
[modify] https://crrev.com/e68641744aaaa8f83f4342b81e0287fab3482aae/tests/test_config.dts
[modify] https://crrev.com/e68641744aaaa8f83f4342b81e0287fab3482aae/include/lib/sku.h
[modify] https://crrev.com/e68641744aaaa8f83f4342b81e0287fab3482aae/lib/cros_config/cros_config.c
[modify] https://crrev.com/e68641744aaaa8f83f4342b81e0287fab3482aae/tests/simple_tests.c
[modify] https://crrev.com/e68641744aaaa8f83f4342b81e0287fab3482aae/include/lib/cros_config.h

Project Member

Comment 7 by bugdroid1@chromium.org, Dec 11 2017

Labels: merge-merged-factory-coral-10122.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/2331edf33fc739c1915daad5c0fadc8712d5dbe8

commit 2331edf33fc739c1915daad5c0fadc8712d5dbe8
Author: Simon Glass <sjg@chromium.org>
Date: Mon Dec 11 09:02:18 2017

chromeos-config: Add alternative whitelabel support

With this schema addition, we can have whitelabels which are not models,
but are all in the same model, with just the keys (and perhaps a few other
things) being different. This is useful for situations where we have (say)
90 different whitelabels and the overhead of seeing these all in GoldenEye
is too great.

BUG= chromium:781928 
TEST=PYTHONPATH=~/c python libcros_config_host_unittest.py
Manually tested on robo
Also manually tested by making robo a whitelabel and setting up vpd
Compared reset of the new and old schema and see that the firmware update
produced is identical, except for  crbug.com/784566 

Change-Id: Iced75f4257db5b0f9a7255959f468b722cd8d919
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/763907
Reviewed-by: Jason Clinton <jclinton@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/794710
Commit-Queue: Marco Chen <marcochen@chromium.org>
Tested-by: Marco Chen <marcochen@chromium.org>

[modify] https://crrev.com/2331edf33fc739c1915daad5c0fadc8712d5dbe8/chromeos-config/libcros_config/test.dts
[modify] https://crrev.com/2331edf33fc739c1915daad5c0fadc8712d5dbe8/chromeos-config/cros_config_main.cc
[modify] https://crrev.com/2331edf33fc739c1915daad5c0fadc8712d5dbe8/chromeos-config/libcros_config/lookup.cc
[modify] https://crrev.com/2331edf33fc739c1915daad5c0fadc8712d5dbe8/chromeos-config/libcros_config/cros_config.cc
[modify] https://crrev.com/2331edf33fc739c1915daad5c0fadc8712d5dbe8/chromeos-config/cros_config_host/cros_config_host_unittest.py
[modify] https://crrev.com/2331edf33fc739c1915daad5c0fadc8712d5dbe8/chromeos-config/cros_config_host/libcros_config_host_unittest.py
[modify] https://crrev.com/2331edf33fc739c1915daad5c0fadc8712d5dbe8/chromeos-config/libcros_config/cros_config_unittest.cc
[modify] https://crrev.com/2331edf33fc739c1915daad5c0fadc8712d5dbe8/chromeos-config/cros_config_host/libcros_config_host.py
[modify] https://crrev.com/2331edf33fc739c1915daad5c0fadc8712d5dbe8/chromeos-config/cros_config_host/fdt_unittest.py
[modify] https://crrev.com/2331edf33fc739c1915daad5c0fadc8712d5dbe8/chromeos-config/libcros_config/cros_config.h
[modify] https://crrev.com/2331edf33fc739c1915daad5c0fadc8712d5dbe8/chromeos-config/cros_config_host/validate_config.py

Project Member

Comment 8 by bugdroid1@chromium.org, Dec 11 2017

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

commit bbd03d9fcd2cf31efb488fae1deb810e7a4e6b39
Author: Simon Glass <sjg@chromium.org>
Date: Mon Dec 11 09:06:36 2017

pack_firmware_functest: Add a test for whitelabel alternative schema

Add a functional test for this to verify that everything works.

BUG= chromium:781928 
TEST=python pack_firmware_functest.py

Change-Id: Ide73319241ad73c42fe90642a3a97f82ad35ec1d
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/766522
Reviewed-by: Jason Clinton <jclinton@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/794730
Commit-Queue: Marco Chen <marcochen@chromium.org>
Tested-by: Marco Chen <marcochen@chromium.org>

[add] https://crrev.com/bbd03d9fcd2cf31efb488fae1deb810e7a4e6b39/functest/rootkey.wltag2
[add] https://crrev.com/bbd03d9fcd2cf31efb488fae1deb810e7a4e6b39/functest/rootkey.wltag1
[add] https://crrev.com/bbd03d9fcd2cf31efb488fae1deb810e7a4e6b39/functest/vblock_A.wltag1.gz
[add] https://crrev.com/bbd03d9fcd2cf31efb488fae1deb810e7a4e6b39/functest/vblock_B.wltag2.gz
[add] https://crrev.com/bbd03d9fcd2cf31efb488fae1deb810e7a4e6b39/functest/vblock_A.wltag2.gz
[modify] https://crrev.com/bbd03d9fcd2cf31efb488fae1deb810e7a4e6b39/pack_firmware_functest.py
[modify] https://crrev.com/bbd03d9fcd2cf31efb488fae1deb810e7a4e6b39/test/config_base.dtsi
[add] https://crrev.com/bbd03d9fcd2cf31efb488fae1deb810e7a4e6b39/functest/vblock_B.wltag1.gz

Project Member

Comment 9 by bugdroid1@chromium.org, Dec 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/mosys/+/684e8e1d15cf1bc951e005c9ff3c7a768f3d28d4

commit 684e8e1d15cf1bc951e005c9ff3c7a768f3d28d4
Author: Simon Glass <sjg@chromium.org>
Date: Mon Dec 11 09:11:11 2017

Add support for alternative whitelabel schema

This request came up during a code review for the cros_config support
for the alternative whitelabel schema. At present the firmware updater
calls 'vpd' directly to read the customization ID and uses that as the
signature ID for accessing vblock/rootkey files. With this change it will
be able to call mosys, which in turn calls vpd_get_value which reads the
customization_id from /sys/firmware/vpd/ro/customization_id

The other option here would be to call 'vpd'. In the case where the RO vpd
has been updated since boot, this might be a better option. The downside
is that it takes about 700ms to run. But since this will only be used in
the firmware updater, that doesn't matter.

I've gone with vpd_get_value since that is what mosys uses elsewhere to
read vpd, so I though it best to keep things consistent.

This adds some more whitelabel support to mosys. Hopefully we can drop
this eventually by moving things to use cros_config. For now we need to
implement part of the whitelabel support in mosys to make everything work.
The discussion of moving to using cros_config in the firmware updater is
best had after we have better library support. [1]

With this feature, mosys can obtain the brand code and the signature ID
for whitelabels.

[1] https://chromium-review.googlesource.com/c/chromiumos/platform/firmware/+/668321

BUG= chromium:781928 
BRANCH=none
TEST=FEATURES=test emerge-coral mosys
Basic whitelabel santiy test on robo (with config hacked to make robo a
whitelabel)
$ /tmp/mosys platform signature
whitetip1

Change-Id: I40d2db63de66cebbc88c8af34376da70b9a10dc2
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/770653
Reviewed-by: Jason Clinton <jclinton@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/801479
Commit-Queue: Marco Chen <marcochen@chromium.org>
Tested-by: Marco Chen <marcochen@chromium.org>

[modify] https://crrev.com/684e8e1d15cf1bc951e005c9ff3c7a768f3d28d4/lib/misc/sku.c
[modify] https://crrev.com/684e8e1d15cf1bc951e005c9ff3c7a768f3d28d4/tests/test_config.dts
[modify] https://crrev.com/684e8e1d15cf1bc951e005c9ff3c7a768f3d28d4/include/lib/sku.h
[modify] https://crrev.com/684e8e1d15cf1bc951e005c9ff3c7a768f3d28d4/lib/cros_config/cros_config.c
[modify] https://crrev.com/684e8e1d15cf1bc951e005c9ff3c7a768f3d28d4/tests/simple_tests.c
[modify] https://crrev.com/684e8e1d15cf1bc951e005c9ff3c7a768f3d28d4/include/lib/cros_config.h

Sign in to add a comment