New issue
Advanced search Search tips

Issue 775229 link

Starred by 1 user

Issue metadata

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



Sign in to add a comment

Refactor libcros_config_host.py to allow family access

Project Member Reported by sjg@chromium.org, Oct 16 2017

Issue description

At present this library assumes that you will only ask for config from the models. But some tools will want to look up family config, e.g. /chromeos/family/firmware property 'script'.

I think the best thing to do is to get the whole tree into a CrosConfig.Node structure and write a new GetNode() function (or similar) which returns a node for any path. Then ChildNodeFromPath can be implemented to call that, perhaps.

This is needed for pack_firmware to use the library, for example.
 

Comment 1 by sjg@chromium.org, Oct 26 2017

Owner: sjg@chromium.org
I'm taking this for now. It is related to the firmware updater
Project Member

Comment 2 by bugdroid1@chromium.org, Oct 31 2017

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

commit 8ea4405aebef47fee2b436ef9867108958054a01
Author: Simon Glass <sjg@chromium.org>
Date: Tue Oct 31 06:21:24 2017

chromeos-config: Refactor node init to handle whole tree

CrosConfig creates it own node /property tree parallel to the Fdt version.
This is so it can have its own methods and some abstraction from the
underlying Fdt.

At present the creation of the config tree is a bit unusual. It creates
nodes only for models, then locates the phandles separately in the
underlying Fdt. It has no knowledge of the family node, for example.

Adjust the init method to scan the entire tree. Phandles are located as
we progress and point to a CrosConfig Node. The same happens with
submodels.

Also drop the additional iteration in the CrosConfig constructor since we
can just use the root node. In fact it might be better for CrosConfig to
have a single root property instead of a nodes list, but that would
require a little more refactoring.

With these changes we have a consistent tree with all nodes present.

BUG= chromium:775229 
TEST=./run_tests.sh

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

[modify] https://crrev.com/8ea4405aebef47fee2b436ef9867108958054a01/chromeos-config/libcros_config_host/libcros_config_host.py

Project Member

Comment 3 by bugdroid1@chromium.org, Oct 31 2017

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

commit dd2b1dee3b7c72b600d2749ebde0af9a4550fabc
Author: Simon Glass <sjg@chromium.org>
Date: Tue Oct 31 06:21:24 2017

chromeos-config: Move static members out of the class

These two functions do not really need to be in the class. Move them out
on their own.

BUG= chromium:775229 
TEST=FEATURES=test  emerge-reef-uni --nodeps chromeos-config-tools

Change-Id: I58aa698ebd7fa61eb6074e45dd928a2401b8baa9
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/743030
Reviewed-by: Jason Clinton <jclinton@chromium.org>
Reviewed-by: Lann Martin <lannm@chromium.org>

[modify] https://crrev.com/dd2b1dee3b7c72b600d2749ebde0af9a4550fabc/chromeos-config/libcros_config_host/libcros_config_host.py

Project Member

Comment 4 by bugdroid1@chromium.org, Oct 31 2017

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

commit 09b3b9d0a70ea135a53f8b1545898d43700df720
Author: Simon Glass <sjg@chromium.org>
Date: Tue Oct 31 08:44:39 2017

chromeos-config: Add family access functions

Add some new methods that are useful for accessing family config.

BUG= chromium:775229 
TEST=FEATURES=test  emerge-reef-uni --nodeps chromeos-config-tools

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

[modify] https://crrev.com/09b3b9d0a70ea135a53f8b1545898d43700df720/chromeos-config/libcros_config_host/libcros_config_host.py
[modify] https://crrev.com/09b3b9d0a70ea135a53f8b1545898d43700df720/chromeos-config/libcros_config_host_unittest.py

Comment 5 by sjg@chromium.org, Nov 4 2017

Labels: Unibuild

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

Status: Fixed (was: Untriaged)

Sign in to add a comment