New issue
Advanced search Search tips

Issue 796983 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2018
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature



Sign in to add a comment

Implement YAML support in cros_config

Project Member Reported by sjg@chromium.org, Dec 21 2017

Issue description

Filing this bug since I could not find one.

We want to be able to ingest the master config in YAML format.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Dec 22 2017

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

commit e7798eb9f0e67bb5650e2e014b7b0bc12ab6010d
Author: Simon Glass <sjg@chromium.org>
Date: Fri Dec 22 06:50:30 2017

chromeos-config: Drop the Model class

The Model class is a subclass of Node which is conceptually useful in
distinguishing a vanilla node from a special 'model' node. However it
doesn't really pull its weight:

- there is only one function that is different, GetMergedProperties(), and
    that only handles one case
- it makes it hard to subclass Node somewhere use, which we want to do to
    implement YAML support (at present the prototype impl has to
    reimplement all the code in libcros_config_host.py which is obviously
    not desirable)
- it can easily be removed without clients noticing, with is suggestive of
    its limited benefit

Remove this class and tidy up afterwards.
BUG= chromium:796983 
TEST=FEATURES=test sudo emerge -q --nodeps chromeos-config-host
Change-Id: I87814553dc298f5e261a20abaa204c025d13874e
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/840444
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[modify] https://crrev.com/e7798eb9f0e67bb5650e2e014b7b0bc12ab6010d/chromeos-config/cros_config_host/libcros_config_host_unittest.py
[modify] https://crrev.com/e7798eb9f0e67bb5650e2e014b7b0bc12ab6010d/chromeos-config/cros_config_host/libcros_config_host.py

Comment 2 by sjg@chromium.org, Dec 22 2017

Owner: sjg@chromium.org
Status: Started (was: Untriaged)

Comment 3 by sjg@chromium.org, Dec 22 2017

Cc: athilenius@chromium.org
Project Member

Comment 4 by bugdroid1@chromium.org, Dec 23 2017

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

commit 6cc0e55dbb0f4ec94db620314df5e9225fa6e3fd
Author: Simon Glass <sjg@chromium.org>
Date: Sat Dec 23 06:33:06 2017

chromeos-config: Split the CrosConfig impl into its own class

We want a call to CrosConfig() to be able to return either a DTB or YAML
implementation. We want to have exactly the same methods in each impl, but
the construction of the object is different.

The easiest way to do this seems to be to make CrosConfig a function,
which returns the implementation, CrosConfigImpl. For the most part this
is transparent to users.

We could adjust GetTargetDirectories() to be a top-level function in
libcros_config_host but then it would no-longer be a member of the object
returned by CrosConfig(), which most users expect.

Rename the class, add CrosConfig() as a new function and update users.

BUG= chromium:796983 
TEST=FEATURES=test sudo -E emerge  --nodeps chromeos-config-host

Change-Id: I627895c6183a1a95b2126f8381aa33971c26a745
Signed-off-by: Simon Glass <sjg@chromium.org>

[modify] https://crrev.com/6cc0e55dbb0f4ec94db620314df5e9225fa6e3fd/chromeos-config/cros_config_host/cros_config_host.py
[modify] https://crrev.com/6cc0e55dbb0f4ec94db620314df5e9225fa6e3fd/chromeos-config/cros_config_host/libcros_config_host.py

Project Member

Comment 5 by bugdroid1@chromium.org, Dec 23 2017

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

commit c9279d1298a31b9f79ab0c83d4cb860a52ca82d7
Author: Simon Glass <sjg@chromium.org>
Date: Sat Dec 23 06:33:06 2017

chromeos-config: Move CrosConfig() to the bottom

Move this function to the bottom of the file so we can deal with a
circular dependency between it and the subclasses of CrosConfigImpl that
it will create. The subclasses need to import libcros_config_host and
this function needs to import the subclasses.

BUG= chromium:796983 
TEST=FEATURES=test sudo -E emerge  --nodeps chromeos-config-host

Change-Id: Ib1f4913af8659a54e9e7b41a4cd420a00362a378
Signed-off-by: Simon Glass <sjg@chromium.org>

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

Project Member

Comment 6 by bugdroid1@chromium.org, Dec 28 2017

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

commit 73a1adff30e8fed55c8a1771e113d4014e8d6cc0
Author: Simon Glass <sjg@chromium.org>
Date: Thu Dec 28 02:17:21 2017

chromeos-config: Split out the FDT impl into its own class

In preparation for making the YAML impl a subclass of CrosConfigImpl,
split out the FDT impl into its own subclass.

There are still references to phandles in the base class. These are not
used with YAML. Future work will move these into the subclass (once we
have the YAML impl working).

For now we stil use the existing YAML code.

BUG= chromium:796983 
TEST=FEATURES=test sudo -E emerge  --nodeps chromeos-config-host

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

[modify] https://crrev.com/73a1adff30e8fed55c8a1771e113d4014e8d6cc0/chromeos-config/cros_config_host/cros_config_host.py
[add] https://crrev.com/73a1adff30e8fed55c8a1771e113d4014e8d6cc0/chromeos-config/cros_config_host/libcros_config_host_fdt.py
[modify] https://crrev.com/73a1adff30e8fed55c8a1771e113d4014e8d6cc0/chromeos-config/cros_config_host/libcros_config_host_unittest.py
[modify] https://crrev.com/73a1adff30e8fed55c8a1771e113d4014e8d6cc0/chromeos-config/cros_config_host/libcros_config_host.py

Project Member

Comment 7 by bugdroid1@chromium.org, Feb 3 2018

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

commit cf0288ec3cba42dbb93e573fc7be431796b2f6f1
Author: Simon Glass <sjg@chromium.org>
Date: Sat Feb 03 19:07:19 2018

chromeos-config: Drop the 'all models' option

This feature is not actually used, since we now have commands which return
the required configuration in packaged form for ebuilds. It doesn't make a
lot of sense to get the value for a particular config for all models. It
is a fairly low-level feature, requiring ebuilds to cope with duplicate
data when models have the same value.

Drop it.

BUG= chromium:796983 
TEST=FEATURES=test sudo -E emerge chromeos-config-host

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

[modify] https://crrev.com/cf0288ec3cba42dbb93e573fc7be431796b2f6f1/chromeos-config/cros_config_host/cros_config_host.py
[modify] https://crrev.com/cf0288ec3cba42dbb93e573fc7be431796b2f6f1/chromeos-config/cros_config_host/cros_config_host_unittest.py

Project Member

Comment 8 by bugdroid1@chromium.org, Feb 3 2018

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

commit ac53135191d3f3a0db2c1d5c682afd5911984024
Author: Simon Glass <sjg@chromium.org>
Date: Sat Feb 03 19:07:20 2018

chromeos-config: Correct use of GetPath() in GetAudioFiles()

This function returns the path so there is no 'path' member to access. Fix
this.

BUG= chromium:796983 
TEST=FEATURES=test sudo -E emerge chromeos-config-host

Change-Id: I4e8d113d5a7abf27baa6c3b41e87988f4e57f7a9
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/900127
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/ac53135191d3f3a0db2c1d5c682afd5911984024/chromeos-config/cros_config_host/libcros_config_host_unittest.py
[modify] https://crrev.com/ac53135191d3f3a0db2c1d5c682afd5911984024/chromeos-config/cros_config_host/libcros_config_host.py
[add] https://crrev.com/ac53135191d3f3a0db2c1d5c682afd5911984024/chromeos-config/libcros_config/test_bad_audio.dts

Project Member

Comment 9 by bugdroid1@chromium.org, Feb 6 2018

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

commit 35a72bb148328b8287a30c5d42251824ea7b0d87
Author: Simon Glass <sjg@chromium.org>
Date: Tue Feb 06 20:21:20 2018

chromeos-config: Disable yaml validation for a while

The YAML format of the master configuration is not actually used at
present. While we are working to update the schema it is annoying to have
to keep reef in sync. Adjust the ebuild to warn on validation problems,
rather than halting the build. This enables us to submit changes which
update the schema more easily.

We'll re-enable this once migration is complete.

BUG= chromium:796983 
TEST=emerge-reef --nodeps chromeos-config
with this CL:
https://chromium-review.googlesource.com/c/chromiumos/platform2/+/900451/2
See that it builds now

Change-Id: Ic9db91779ca3278eb936759447b2e3519c87d919
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/902953
Reviewed-by: C Shapiro <shapiroc@google.com>

[rename] https://crrev.com/35a72bb148328b8287a30c5d42251824ea7b0d87/chromeos-base/chromeos-config/chromeos-config-0.0.1-r10.ebuild
[modify] https://crrev.com/35a72bb148328b8287a30c5d42251824ea7b0d87/chromeos-base/chromeos-config/chromeos-config-0.0.1.ebuild

Project Member

Comment 10 by bugdroid1@chromium.org, Feb 7 2018

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

commit 998f36b746ab8a50bac09777ba8b27d84fe14b55
Author: Simon Glass <sjg@chromium.org>
Date: Wed Feb 07 02:18:58 2018

chromeos-config: Add a 'chromeos' top-level node

This matches the existing master config format. Change the YAML version to
look the same, to allow for easier migration.

BUG= chromium:796983 
TEST=FEATURES=test sudo -E emerge chromeos-config-host

Change-Id: I7ce665dd3a178037bc8de3e248cbbf22222b04d3
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/900451
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/998f36b746ab8a50bac09777ba8b27d84fe14b55/chromeos-config/cros_config_host/v2/libcros_config_host_json.py
[modify] https://crrev.com/998f36b746ab8a50bac09777ba8b27d84fe14b55/chromeos-config/cros_config_host/v2/cros_config_schema.yaml
[modify] https://crrev.com/998f36b746ab8a50bac09777ba8b27d84fe14b55/chromeos-config/cros_config_host/v2/cros_config_schema_example.json
[modify] https://crrev.com/998f36b746ab8a50bac09777ba8b27d84fe14b55/chromeos-config/cros_config_host/v2/cros_config_schema_example.yaml
[modify] https://crrev.com/998f36b746ab8a50bac09777ba8b27d84fe14b55/chromeos-config/cros_config_host/v2/cros_config_schema_unittest.py
[modify] https://crrev.com/998f36b746ab8a50bac09777ba8b27d84fe14b55/chromeos-config/cros_config_host/v2/generate_schema_doc.py
[modify] https://crrev.com/998f36b746ab8a50bac09777ba8b27d84fe14b55/chromeos-config/cros_config_host/v2/cros_config_schema.py

Project Member

Comment 11 by bugdroid1@chromium.org, Feb 7 2018

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

commit ab3542533f34476e5e49cb6db74264f639a6cee7
Author: Simon Glass <sjg@chromium.org>
Date: Wed Feb 07 08:43:40 2018

chromeos-config: Drop incorrect backslash

I think this was present in a shell script and was blinding brought over
to the master config. I don't believe this is needed with DT or yaml.

Note that the .json file seems to need trailing spaces on each line.

BUG= chromium:796983 
TEST=FEATURES=test sudo -E emerge chromeos-config-host

Change-Id: I9ccfceba2c9276538758cbb0606681b7521bf609
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/901763
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/ab3542533f34476e5e49cb6db74264f639a6cee7/chromeos-config/README.md
[modify] https://crrev.com/ab3542533f34476e5e49cb6db74264f639a6cee7/chromeos-config/libcros_config/test.dts
[modify] https://crrev.com/ab3542533f34476e5e49cb6db74264f639a6cee7/chromeos-config/cros_config_host/v2/cros_config_schema_example.json
[modify] https://crrev.com/ab3542533f34476e5e49cb6db74264f639a6cee7/chromeos-config/cros_config_host/v2/cros_config_schema_example.yaml
[modify] https://crrev.com/ab3542533f34476e5e49cb6db74264f639a6cee7/chromeos-config/cros_config_host/validate_config_unittest.py

Project Member

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

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

commit a044075e854118508a0c479c86276e168381ee67
Author: Simon Glass <sjg@chromium.org>
Date: Wed Feb 07 08:43:41 2018

chromeos-config: Update the instructions to generate json

These instructions require that you be in a particular subdirectory of
chromeos-config. It seems better to run the tools from the top-level
directory so that people don't have to keep changing directories.

Update the instructions.

BUG= chromium:796983 
TEST=FEATURES=test sudo -E emerge chromeos-config-host
Also change JSON to check that the message looks right

Change-Id: Iee27305ed96b3cce8548727b927f2af07d88752d
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/901764
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/a044075e854118508a0c479c86276e168381ee67/chromeos-config/cros_config_host/v2/cros_config_schema_unittest.py

Project Member

Comment 13 by bugdroid1@chromium.org, Feb 7 2018

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

commit fe43638ba509e20a9d1cb8f9f40a4ba20f336d83
Author: Simon Glass <sjg@chromium.org>
Date: Wed Feb 07 08:43:42 2018

chromeos-config: Drop device-tree unit addresses

These are not strictly needed in the format since we can tell the dtc
to avoid warning when they are not used. The dtc warning was added
fairly recently.

This makes it easier to convert the source files to yaml, which does not
use this convention.

BUG= chromium:796983 
TEST=FEATURES=test sudo -E emerge chromeos-config-host

Change-Id: I8f38f58697e9013f3058becef8e021162f6ded8a
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/901765
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/fe43638ba509e20a9d1cb8f9f40a4ba20f336d83/chromeos-config/README.md
[modify] https://crrev.com/fe43638ba509e20a9d1cb8f9f40a4ba20f336d83/chromeos-config/libcros_config/test.dts
[modify] https://crrev.com/fe43638ba509e20a9d1cb8f9f40a4ba20f336d83/chromeos-config/cros_config_host/validate_config_unittest.py
[modify] https://crrev.com/fe43638ba509e20a9d1cb8f9f40a4ba20f336d83/chromeos-config/cros_config_host/validate_config.py

Project Member

Comment 14 by bugdroid1@chromium.org, Feb 8 2018

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

commit 46bc6071474057236c565c5012e66d516ce76410
Author: Stephen Barber <smbarber@chromium.org>
Date: Thu Feb 08 17:15:21 2018

chromeos-config: Tidy up some pylint warnings in v2

Fix some of the warnings from 'cros lint'.

BUG= chromium:796983 
TEST=./run_tests

Change-Id: Ia042ab6b5e8e3fe79059a95c3ab58a066662cea6
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/905884
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/46bc6071474057236c565c5012e66d516ce76410/chromeos-config/cros_config_host/v2/libcros_config_host_json.py
[modify] https://crrev.com/46bc6071474057236c565c5012e66d516ce76410/chromeos-config/cros_config_host/v2/cros_config_schema.py

Project Member

Comment 15 by bugdroid1@chromium.org, Feb 8 2018

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

commit 9b2db9a2cfd14641855034ca088d088cfc41f290
Author: Simon Glass <sjg@chromium.org>
Date: Thu Feb 08 17:37:45 2018

chromeos-config: Suppress unwanted stderr output in test

When an invalid model is requested, cros_config_host outputs a message to
stderr which appears in test output. Suppress it.

BUG= chromium:796983 
TEST=./run_tests ; see that output is clean now:
$ ./run_tests.sh
......................................................................................
----------------------------------------------------------------------
Ran 86 tests in 2.953s

OK

Change-Id: I33745341f8c0de37ee103383ce32d072806c1b2a
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/901766
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/9b2db9a2cfd14641855034ca088d088cfc41f290/chromeos-config/cros_config_host/cros_config_host_unittest.py

Project Member

Comment 16 by bugdroid1@chromium.org, Feb 8 2018

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

commit 5ed66fe319884b0f023ee415728d1cafcc1f6934
Author: Simon Glass <sjg@chromium.org>
Date: Thu Feb 08 17:40:35 2018

chromeos-config: Generate test yaml file from dts

As a starting point for using yaml format for the config, generate the
test file in yaml format.

This was generated with the following command:

./dts2yaml libcros_config/test.dts

This file is not suitable as is. A future commit adjusts it for use, so
that it is clear what changes must be made.

BUG= chromium:796983 
TEST=none

Change-Id: Ic159b3914991df4eec5003a8c79236992977c83e
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/902934
Reviewed-by: C Shapiro <shapiroc@google.com>

[add] https://crrev.com/5ed66fe319884b0f023ee415728d1cafcc1f6934/chromeos-config/libcros_config/test.yaml

Project Member

Comment 17 by bugdroid1@chromium.org, Feb 8 2018

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

commit 1749c38e0939df89120e938f5b5eefaf7af5d6fe
Author: Simon Glass <sjg@chromium.org>
Date: Thu Feb 08 17:41:55 2018

chromeos-config: Update the instructions to update the schema

These instructions require that you be in a particular subdirectory of
chromeos-config. It seems better to run the tools from the top-level
directory so that people don't have to keep changing directories.

Update the instructions.

BUG= chromium:796983 
TEST=FEATURES=test sudo -E emerge chromeos-config-host
Also test updating the schema:
$ python -m cros_config_host.v2.generate_schema_doc -o README.md

Change-Id: Ie99b1ff3d7633308db98b6479c3f3e2b7022e061
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/902936
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/1749c38e0939df89120e938f5b5eefaf7af5d6fe/chromeos-config/cros_config_host/v2/generate_schema_doc.py
[modify] https://crrev.com/1749c38e0939df89120e938f5b5eefaf7af5d6fe/chromeos-config/cros_config_host/v2/generate_schema_doc_unittest.py

Project Member

Comment 18 by bugdroid1@chromium.org, Feb 8 2018

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

commit 93ca83a238d08a28a0dd0ce147f6cc4e4c87a3b9
Author: Simon Glass <sjg@chromium.org>
Date: Thu Feb 08 17:42:18 2018

chromeos-config: Make -y a flag argument

Add a 'store_true' so that this argument operates as a flag.

BUG= chromium:796983 
TEST=./run_tests
See that (once we actually use yaml) we don't get this error now:
: error: argument -y/--yaml: expected one argument

Change-Id: I1caf052b0d6bb06c107c80fb88e3121e2ecea06a
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/905887
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/93ca83a238d08a28a0dd0ce147f6cc4e4c87a3b9/chromeos-config/cros_config_host/cros_config_host.py

Project Member

Comment 19 by bugdroid1@chromium.org, Feb 8 2018

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

commit 7e29d9fc75f6704b836cdba1dd26689708a16125
Author: Simon Glass <sjg@chromium.org>
Date: Thu Feb 08 18:12:40 2018

chromeos-config: Indent the test yaml file

Indent this file in a single commit so that future changes are easier to
review.

BUG= chromium:796983 
TEST=none

Change-Id: I13ef44e42c5c7901e2a381cc0a83ef77a2484560
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/902935
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/7e29d9fc75f6704b836cdba1dd26689708a16125/chromeos-config/libcros_config/test.yaml

Project Member

Comment 21 by bugdroid1@chromium.org, Feb 11 2018

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

commit 5b7cf44e921024e6c7eba85256d5121bcfde8f30
Author: Simon Glass <sjg@chromium.org>
Date: Sun Feb 11 16:13:44 2018

chromeos-config: Change the test yaml file to work correctly

Add updates so that the test file can pass schema validation (although it
requires some schema additions since the v2 schema does not support all
features yet).

BUG= chromium:796983 
TEST=manual
python -m cros_config_host.v2.cros_config_schema \
	-c libcros_config/test.yaml -o asc

which gets as far as schema validation and complains about a missing
'card' attribute.

Change-Id: If84d5260a62b39ffcb678c2d96ebf638fcb9a24c
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/901767
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/5b7cf44e921024e6c7eba85256d5121bcfde8f30/chromeos-config/libcros_config/test.yaml

Project Member

Comment 22 by bugdroid1@chromium.org, Feb 11 2018

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

commit c8b2b7e3984c6ac8dcc6405b469194eb8370f17a
Author: Simon Glass <sjg@chromium.org>
Date: Sun Feb 11 16:16:04 2018

chromeos-config: Drop audio and BCS work-arounds

These are needed because the v2 schema does not match v1. For migration
it is easier to drop them and the associated tests. The tests will be
replaced with the 'generic' unit tests once they pass.

BUG= chromium:796983 
TEST=./run_tests

Change-Id: I830c50a5eb57e62806e644b8b2e783868d881261
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/901769
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/c8b2b7e3984c6ac8dcc6405b469194eb8370f17a/chromeos-config/cros_config_host/v2/libcros_config_host_json.py
[modify] https://crrev.com/c8b2b7e3984c6ac8dcc6405b469194eb8370f17a/chromeos-config/cros_config_host/v2/cros_config_schema.yaml
[modify] https://crrev.com/c8b2b7e3984c6ac8dcc6405b469194eb8370f17a/chromeos-config/cros_config_host/v2/cros_config_schema_example.json
[modify] https://crrev.com/c8b2b7e3984c6ac8dcc6405b469194eb8370f17a/chromeos-config/README.md
[modify] https://crrev.com/c8b2b7e3984c6ac8dcc6405b469194eb8370f17a/chromeos-config/cros_config_host/v2/cros_config_schema_example.yaml
[modify] https://crrev.com/c8b2b7e3984c6ac8dcc6405b469194eb8370f17a/chromeos-config/cros_config_host/v2/cros_config_schema_unittest.py
[modify] https://crrev.com/c8b2b7e3984c6ac8dcc6405b469194eb8370f17a/chromeos-config/cros_config_host/v2/libcros_config_host_json_unittest.py
[modify] https://crrev.com/c8b2b7e3984c6ac8dcc6405b469194eb8370f17a/chromeos-config/cros_config_host/v2/cros_config_schema.py

Project Member

Comment 23 by bugdroid1@chromium.org, Feb 11 2018

Project Member

Comment 24 by bugdroid1@chromium.org, Feb 11 2018

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

commit adfbe49bd3e200846f1644715bd51868daa7b2f6
Author: Simon Glass <sjg@chromium.org>
Date: Sun Feb 11 16:30:21 2018

chromeos-config: Support a default config file for yaml

With FDT we can support a default file when this class is used in an
ebuild context. Support this for YAML also.

BUG= chromium:796983 
TEST=./run_tests
(The test is added in a later commit)

Change-Id: I3a80ead7d3dfce4f0a1771c1470eb5172307f2f2
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/905888
Reviewed-by: C Shapiro <shapiroc@google.com>

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

Project Member

Comment 25 by bugdroid1@chromium.org, Feb 11 2018

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

commit 786f44ad9e3d3b0dcfab027ec26d3fd3938bcde3
Author: Simon Glass <sjg@chromium.org>
Date: Sun Feb 11 16:33:15 2018

chromeos-config: Support node-following in yaml

Update FollowShare() to work for yaml and add a note about this in the
code.

BUG= chromium:796983 
TEST=./run_tests
(but this will be tested by a later commit once we run the normal unit
tests with a yaml config)

Change-Id: I1e4e9d0a2c3e9b580901be04cace9d15d12eb01c
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/905889
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/786f44ad9e3d3b0dcfab027ec26d3fd3938bcde3/chromeos-config/cros_config_host/libcros_config_host.py

Project Member

Comment 26 by bugdroid1@chromium.org, Feb 11 2018

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

commit fd30440664fd9a3e8cb765231f3324077a7ee871
Author: Simon Glass <sjg@chromium.org>
Date: Sun Feb 11 16:35:13 2018

chromeos-config: Handle unicode strings in ShowTree()

At present this function assumes that unicode is not used. Update it to
convert the node name (which may be unicode when yaml is used) to a common
format.

BUG= chromium:796983 
TEST=./run_tests

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

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

Project Member

Comment 27 by bugdroid1@chromium.org, Feb 11 2018

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

commit 1dc88078c3563675cbd1d42194970781faecd800
Author: Simon Glass <sjg@chromium.org>
Date: Sun Feb 11 16:36:52 2018

chromeos-config: Correct setup for touch firmware

At present testGetTouchFirmwareFiles() requires that two environment
variables be set up, which is done by another test. Update this test
to set them up correctly, so the test can be run by itself.

Similarly, fix up the cli test.

BUG= chromium:796983 
TEST=PYTHONPATH=~/cosarm python -m \
	cros_config_host.libcros_config_host_unittest \
	CrosConfigHostTest.testGetTouchFirmwareFiles

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

[modify] https://crrev.com/1dc88078c3563675cbd1d42194970781faecd800/chromeos-config/cros_config_host/cros_config_host_unittest.py
[modify] https://crrev.com/1dc88078c3563675cbd1d42194970781faecd800/chromeos-config/cros_config_host/libcros_config_host_unittest.py

Project Member

Comment 28 by bugdroid1@chromium.org, Feb 11 2018

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

commit 1918ea63710cedeacb40bfcf4912c30959ca0d67
Author: Simon Glass <sjg@chromium.org>
Date: Sun Feb 11 16:38:34 2018

chromeos-config: Add control over dropping the family node

This is not normally used with yaml but keeping it around allows us to run
the existing unit tests (specifically the '/firmware/script' property).

Update TransformConfig() to make this optional for now.

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

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

[modify] https://crrev.com/1918ea63710cedeacb40bfcf4912c30959ca0d67/chromeos-config/cros_config_host/v2/cros_config_schema.py

Project Member

Comment 29 by bugdroid1@chromium.org, Feb 11 2018

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

commit 3440f3016d409533d20537ecd0d623318c5c2b31
Author: Simon Glass <sjg@chromium.org>
Date: Sun Feb 11 16:41:47 2018

chromeos-config: Make unit tests FDT-specific

Update the unit tests to be FDT-specific. Then we can use the same tests
for yaml in a future commit.

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

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

[modify] https://crrev.com/3440f3016d409533d20537ecd0d623318c5c2b31/chromeos-config/cros_config_host/libcros_config_host_unittest.py

Project Member

Comment 30 by bugdroid1@chromium.org, Feb 11 2018

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

commit fbc76070851366c5538f7a8a0409633558a6ddcf
Author: Simon Glass <sjg@chromium.org>
Date: Sun Feb 11 16:43:52 2018

chromeos-config: Make return values deterministic

At present some API functions rely on the ordering of the config. Adjust
them to always sort the returned results instead. This will make it easier
to pass the same tests with yaml.

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

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

[modify] https://crrev.com/fbc76070851366c5538f7a8a0409633558a6ddcf/chromeos-config/cros_config_host/libcros_config_host_unittest.py
[modify] https://crrev.com/fbc76070851366c5538f7a8a0409633558a6ddcf/chromeos-config/cros_config_host/libcros_config_host.py

Project Member

Comment 31 by bugdroid1@chromium.org, Feb 11 2018

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

commit 3d513582c30ac32d82f3f50fbb7a7492caffae8e
Author: Simon Glass <sjg@chromium.org>
Date: Sun Feb 11 16:46:56 2018

chromeos-config: Adjust a few tests to use an 'expected' var

The long assert functions are a bit confusing in some cases. Update them
to use a variable.

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

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

[modify] https://crrev.com/3d513582c30ac32d82f3f50fbb7a7492caffae8e/chromeos-config/cros_config_host/libcros_config_host_unittest.py

Project Member

Comment 32 by bugdroid1@chromium.org, Feb 11 2018

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

commit c8a79968e0fb73eaf194bc03edbeedc5da6e9c3a
Author: Simon Glass <sjg@chromium.org>
Date: Sun Feb 11 16:48:43 2018

chromeos-config: Add support for running unit tests with yaml

The yaml format supports most of the same features as FDT. The exceptions
are:

   - cannot use a 'dict' as a model since the validator cannot support
        dicts with a name that is not in the schema (so we have to put the
        models in a list instead)
   - cannot point to a model since it is a member of a list
   - therefore cannot support models which are whitelabels of another
        model
   - also cannot support the 'default' property for the same reason (in
        fact this was probably a bad idea anyway)

Apart from the model issue, the yaml format supports similar things in a
different way, so little is lost.

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

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

[modify] https://crrev.com/c8a79968e0fb73eaf194bc03edbeedc5da6e9c3a/chromeos-config/cros_config_host/libcros_config_host_unittest.py

Project Member

Comment 33 by bugdroid1@chromium.org, Feb 11 2018

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

commit 37d388d9d0f3c91ab8a2fc637cdba96a7d86834c
Author: Simon Glass <sjg@chromium.org>
Date: Sun Feb 11 16:50:30 2018

chromeos-config: Make cli tests FDT-specific

Update the unit tests to be FDT-specific. Then we can use the same tests
for yaml in a future commit.

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

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

[modify] https://crrev.com/37d388d9d0f3c91ab8a2fc637cdba96a7d86834c/chromeos-config/cros_config_host/cros_config_host_unittest.py

Project Member

Comment 34 by bugdroid1@chromium.org, Feb 12 2018

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

commit b198ca1c88ad2c5ac5c96a8c3bbb4d66b7840045
Author: Simon Glass <sjg@chromium.org>
Date: Mon Feb 12 00:39:02 2018

chromeos-config: Rename dtb_file to conf_file

The CLI tests currently only work with device tree. But once they work
with yaml this variable name will be confusing. Change it.

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

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

[modify] https://crrev.com/b198ca1c88ad2c5ac5c96a8c3bbb4d66b7840045/chromeos-config/cros_config_host/cros_config_host_unittest.py

Project Member

Comment 35 by bugdroid1@chromium.org, Feb 12 2018

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

commit 8813e7e2361299291ac0d6769015bc5c51af5a6f
Author: Simon Glass <sjg@chromium.org>
Date: Mon Feb 12 03:25:52 2018

chromeos-config: Add support for running cli tests with yaml

Add support for running the cli tests both with fdt and yaml. Some small
changes are required to make this work.

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

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

[modify] https://crrev.com/8813e7e2361299291ac0d6769015bc5c51af5a6f/chromeos-config/cros_config_host/cros_config_host_unittest.py

Project Member

Comment 36 by bugdroid1@chromium.org, Feb 12 2018

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

commit 94ee263b19ff2e22457f60432b077577310a4cb1
Author: Simon Glass <sjg@chromium.org>
Date: Mon Feb 12 03:29:41 2018

chromeos-config: Correct the format detection

At present the constructor does not distinguish between a format of None
(meaning we don't know) and 0 (currently meaning FDT). Fix it.

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

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

[modify] https://crrev.com/94ee263b19ff2e22457f60432b077577310a4cb1/chromeos-config/cros_config_host/libcros_config_host.py

Project Member

Comment 37 by bugdroid1@chromium.org, Feb 12 2018

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

commit 7103cc547a00b55f06811c05b99975587c22cbd9
Author: Simon Glass <sjg@chromium.org>
Date: Mon Feb 12 03:36:11 2018

chromeos-config: Set the initial state for testDefaultConfig()

The first part of this test relies on SYSROOT not being set. Change the
test to make sure it is not.

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

Change-Id: Id18919f6047e66cfd5c34be208ef186e0b276cc7
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/909844
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/7103cc547a00b55f06811c05b99975587c22cbd9/chromeos-config/cros_config_host/libcros_config_host_unittest.py

Project Member

Comment 38 by bugdroid1@chromium.org, Feb 12 2018

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

commit 879e50f5736eeb980a32b458da14d4027db1f854
Author: Simon Glass <sjg@chromium.org>
Date: Mon Feb 12 03:40:39 2018

chromeos-config: Drop the default audio config

The yaml implementation does not implement the dubious 'default' property
so the test config does not have a valid audio setup for caroline. Drop it
to avoid test failures.

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

Change-Id: I9de9ebac93ee16888c230b613caae04ab82fb49a
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/909845
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/879e50f5736eeb980a32b458da14d4027db1f854/chromeos-config/cros_config_host/v2/cros_config_schema_example.json
[modify] https://crrev.com/879e50f5736eeb980a32b458da14d4027db1f854/chromeos-config/cros_config_host/v2/cros_config_schema_example.yaml

Project Member

Comment 39 by bugdroid1@chromium.org, Feb 12 2018

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

commit 939cde3ed6fde2d91310221e262610f11b44442f
Author: Simon Glass <sjg@chromium.org>
Date: Mon Feb 12 03:53:51 2018

chromeos-config: Implement yaml as a subclass of CrosConfigImpl

We have everything ready now to switch the yaml implementation over to
use the same base class as the fdt implementation.

Rewrite CrosConfigJson so that is a simple subclass of the base
implementation. Enable running the tests for yaml (as well as the existing
fdt).

This completes the basic converion of the host tools to support yaml.

Some work still remains (not a complete list):
- Adjust the yaml schema to adher to the v2 ideal (some of which is TBD)
- Migrate existing boards over (using dts2yaml, etc.)
- Implement SKU matching, after discussion about how best to do this in
    yaml
- Consider (again) allowing the validator to support validation of dict
    names
- Revert to the stricter yaml validation (e.g. required properties)
- Clean out some fdt features which are not really needed in yaml
- Try to make the yaml validator more user-friendly (e.g. sometimes it
    dumps the entire config when it sees an error)

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

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

[modify] https://crrev.com/939cde3ed6fde2d91310221e262610f11b44442f/chromeos-config/cros_config_host/v2/libcros_config_host_json.py
[modify] https://crrev.com/939cde3ed6fde2d91310221e262610f11b44442f/chromeos-config/cros_config_host/cros_config_host_unittest.py
[modify] https://crrev.com/939cde3ed6fde2d91310221e262610f11b44442f/chromeos-config/cros_config_host/libcros_config_host_unittest.py
[modify] https://crrev.com/939cde3ed6fde2d91310221e262610f11b44442f/chromeos-config/cros_config_host/libcros_config_host.py

Project Member

Comment 40 by bugdroid1@chromium.org, Feb 12 2018

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

commit d4003fd4cfcd1e05e9a55dc82ba9b327a0c44f8b
Author: Simon Glass <sjg@chromium.org>
Date: Mon Feb 12 03:59:03 2018

chromeos-config: Drop the old json unittest

This is a pretty limited test and is now replaced with the full suite of
unit tests. Drop it.

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

Change-Id: I3505bbfc543391d4a613de98dba6e9a2fab545a6
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/909846
Reviewed-by: C Shapiro <shapiroc@google.com>

[delete] https://crrev.com/939cde3ed6fde2d91310221e262610f11b44442f/chromeos-config/cros_config_host/v2/libcros_config_host_json_unittest.py

Project Member

Comment 41 by bugdroid1@chromium.org, Feb 14 2018

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

commit a6605a04328cc288a08d3bdb5ab3fe52350da5fd
Author: Simon Glass <sjg@chromium.org>
Date: Wed Feb 14 05:16:57 2018

chromeos-config: Obtain the phandle properties from the schema

We should not be hard-coding the schema properties in the host library.
Instead, read the list from the schema, which has this information.

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

Change-Id: I8b7f83749470939e34fefac5d1164651ab970dd9
Reviewed-on: https://chromium-review.googlesource.com/909847
Commit-Ready: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/a6605a04328cc288a08d3bdb5ab3fe52350da5fd/chromeos-config/cros_config_host/validate_config.py
[modify] https://crrev.com/a6605a04328cc288a08d3bdb5ab3fe52350da5fd/chromeos-config/cros_config_host/libcros_config_host.py

Project Member

Comment 42 by bugdroid1@chromium.org, Feb 14 2018

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

commit 47f2cc84fe2ba7833c26231bba9295fa9bec1b54
Author: Simon Glass <sjg@chromium.org>
Date: Wed Feb 14 16:44:04 2018

unibuild: Don't require unit addresses

We currently require that the master config uses unit addresses when there
are multiple nodes with the same name. This means we need to specify a
'reg' property as well as #address-cells and #size-cells properties.

This can be confusing for people who are not familiar with device tree.
Add a dtc flag so that this is no-longer required.

BUG= chromium:796983 
TEST=FEATURES=test sudo -E emerge chromeos-config-host

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

[modify] https://crrev.com/47f2cc84fe2ba7833c26231bba9295fa9bec1b54/eclass/cros-unibuild.eclass
[modify] https://crrev.com/47f2cc84fe2ba7833c26231bba9295fa9bec1b54/chromeos-base/chromeos-config/chromeos-config-0.0.1.ebuild
[rename] https://crrev.com/47f2cc84fe2ba7833c26231bba9295fa9bec1b54/chromeos-base/chromeos-config/chromeos-config-0.0.1-r11.ebuild

Project Member

Comment 43 by bugdroid1@chromium.org, Feb 15 2018

Project Member

Comment 44 by bugdroid1@chromium.org, Feb 15 2018

Project Member

Comment 45 by bugdroid1@chromium.org, Feb 15 2018

Project Member

Comment 46 by bugdroid1@chromium.org, Feb 15 2018

Project Member

Comment 47 by bugdroid1@chromium.org, Feb 15 2018

Project Member

Comment 48 by bugdroid1@chromium.org, Feb 15 2018

Project Member

Comment 49 by bugdroid1@chromium.org, Feb 15 2018

Project Member

Comment 50 by bugdroid1@chromium.org, Feb 15 2018

Project Member

Comment 51 by bugdroid1@chromium.org, Feb 15 2018

Project Member

Comment 52 by bugdroid1@chromium.org, Feb 15 2018

Project Member

Comment 53 by bugdroid1@chromium.org, Feb 15 2018

Project Member

Comment 54 by bugdroid1@chromium.org, Feb 15 2018

Project Member

Comment 55 by bugdroid1@chromium.org, Feb 16 2018

Project Member

Comment 56 by bugdroid1@chromium.org, Feb 16 2018

Project Member

Comment 57 by bugdroid1@chromium.org, Feb 16 2018

Project Member

Comment 58 by bugdroid1@chromium.org, Feb 16 2018

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

commit edeb629a674c9e4bf25088d3a4437c8dfba94b1a
Author: Simon Glass <sjg@chromium.org>
Date: Fri Feb 16 19:09:24 2018

chromeos-config: Add the platform name property to identity

This is needed to distinguish different SKU maps within the same family.
Add this property to the schema.

Also make the sku-id optional, since not all models have it.

These changes bring identity into line with the current master config
format.

BUG= chromium:796983 
TEST=see that the schema validation for reef works (it includes this
field)

Change-Id: I656b432e3272646ad68f8d793117c0bb32578a36
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/919243
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/edeb629a674c9e4bf25088d3a4437c8dfba94b1a/chromeos-config/README.md
[modify] https://crrev.com/edeb629a674c9e4bf25088d3a4437c8dfba94b1a/chromeos-config/cros_config_host/v2/cros_config_schema.yaml

Project Member

Comment 59 by bugdroid1@chromium.org, Feb 16 2018

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

commit 2e43ed8117fcff89b6d7e96643f78d8f01bcc992
Author: Simon Glass <sjg@chromium.org>
Date: Fri Feb 16 19:09:25 2018

chromeos-config: Support outputting a list of phandle properties

A long-standing niggle with the device-tree config is that the phandle
property names are hard-coded, rather than being read from the schema. Add
a command that works similarly to the target directories feature, adding
the information to the config. This can then be read by cros_config at
run time.

BUG= chromium:796983 
TEST=sudo emerge -q --nodeps chromeos-config-tools chromeos-config-host
emerge-reef chromeos-firmware-reef
fdtdump ~/cosarm/chroot/build/reef/usr/share/chromeos-config/config.dtb
See that the schema info is present:
   phandle-properties = "arc-properties-type", "audio-type", "bcs-type",
      "power-type", "shares", "single-sku", "touch-type", "whitelabel";

Change-Id: I31429aac08db736c07d05cd465279456fa3c957f
Reviewed-on: https://chromium-review.googlesource.com/919244
Commit-Ready: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/2e43ed8117fcff89b6d7e96643f78d8f01bcc992/chromeos-config/cros_config_host/cros_config_host.py
[modify] https://crrev.com/2e43ed8117fcff89b6d7e96643f78d8f01bcc992/chromeos-config/cros_config_host/cros_config_host_unittest.py
[modify] https://crrev.com/2e43ed8117fcff89b6d7e96643f78d8f01bcc992/chromeos-config/cros_config_host/libcros_config_host.py
[modify] https://crrev.com/2e43ed8117fcff89b6d7e96643f78d8f01bcc992/chromeos-config/cros_config_host/validate_config.py

Project Member

Comment 60 by bugdroid1@chromium.org, Feb 17 2018

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

commit 2691db26ce72b3e475f30efe44794ff7853821fb
Author: Simon Glass <sjg@chromium.org>
Date: Sat Feb 17 05:41:55 2018

chromeos-config: Include phandle property info in the config

This is needed by cros_config at run-time and will allow us to avoid
hard-coding this information in the source code.

BUG= chromium:796983 
TEST=emerge-reef chromeos-config-bsp chromeos-config
fdtdump

Change-Id: Ic6d047c00d6bd0a7e934eaf1936546d50077627c
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/919242
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/2691db26ce72b3e475f30efe44794ff7853821fb/chromeos-base/chromeos-config/chromeos-config-0.0.1.ebuild
[rename] https://crrev.com/2691db26ce72b3e475f30efe44794ff7853821fb/chromeos-base/chromeos-config/chromeos-config-0.0.1-r12.ebuild

Comment 61 by sjg@chromium.org, Feb 20 2018

Now that this is implemented a good next step is to bring reef up to use yaml and work correctly.

I'll track that on a separate bug, but we need a feature to allow config results to be compared, so I'll continue that here.
Project Member

Comment 62 by bugdroid1@chromium.org, Feb 22 2018

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

commit 6781af9c1ce3f9c676d29f547ad22b36def25d4e
Author: Simon Glass <sjg@chromium.org>
Date: Thu Feb 22 04:39:09 2018

chromeos-config: Drop unwanted TODO in the Property() constructor

The type is already useful, but this TODO is not.

BUG= chromium:796983 
TEST=sudo emerge -q --nodeps chromeos-config-tools chromeos-config-host
emerge-reef chromeos-firmware-reef
Change-Id: Ie7cf07a138ef0cf7d3ca9e7c90d049c04064ea91
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/927002
Reviewed-by: Jason Clinton <jclinton@chromium.org>
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/6781af9c1ce3f9c676d29f547ad22b36def25d4e/chromeos-config/cros_config_host/v2/libcros_config_host_json.py
[modify] https://crrev.com/6781af9c1ce3f9c676d29f547ad22b36def25d4e/chromeos-config/cros_config_host/libcros_config_host_fdt.py

Project Member

Comment 63 by bugdroid1@chromium.org, Feb 22 2018

Project Member

Comment 64 by bugdroid1@chromium.org, Feb 23 2018

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

commit e0680ed617413166dc701233052fb0228c4ffb19
Author: Simon Glass <sjg@chromium.org>
Date: Fri Feb 23 11:36:26 2018

chromeos-config: Drop the old libcros_config_host dir

This is not needed now that the firmware packer

BUG= chromium:796983 
TEST=sudo emerge -q --nodeps chromeos-config-tools chromeos-config-host
emerge-reef chromeos-firmware-reef

See that it works. Will also use trybot/pre-cq

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

[modify] https://crrev.com/e0680ed617413166dc701233052fb0228c4ffb19/chromeos-config/setup.py
[delete] https://crrev.com/e2a6f810f48fb1d6b7c32371247f5495455f61a7/chromeos-config/libcros_config_host/__init__.py

Project Member

Comment 65 by bugdroid1@chromium.org, Feb 23 2018

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

commit e0f3216f667a14f07127c090ae6f1e5c52071bd0
Author: Simon Glass <sjg@chromium.org>
Date: Fri Feb 23 11:36:27 2018

chromeos-config: Drop the old File code in the constructor

We don't need this anymore as there are no users. Drop it.

BUG= chromium:796983 
TEST=sudo emerge -q --nodeps chromeos-config-tools chromeos-config-host
emerge-reef chromeos-firmware-reef
Signed-off-by: Simon Glass <sjg@chromium.org>

Change-Id: I836b7ccf992cf88fe72d8aa6027b1782f723fcac
Reviewed-on: https://chromium-review.googlesource.com/927003
Commit-Ready: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jason Clinton <jclinton@chromium.org>
Reviewed-by: C Shapiro <shapiroc@google.com>

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

Project Member

Comment 66 by bugdroid1@chromium.org, Feb 24 2018

Project Member

Comment 67 by bugdroid1@chromium.org, Feb 24 2018

Project Member

Comment 68 by bugdroid1@chromium.org, Feb 24 2018

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

commit 897e16832e2be774df0e9930b92d9069a66a9984
Author: Simon Glass <sjg@chromium.org>
Date: Sat Feb 24 23:16:09 2018

chromeos-config: Drop support for built-in FDT properties

We don't need this anymore so can resolve this TODO. Also add the dtc flag
to the test script to avoid a warning there.

BUG= chromium:796983 
TEST=sudo emerge -q --nodeps chromeos-config-tools chromeos-config-host
emerge-reef chromeos-firmware-reef
Signed-off-by: Simon Glass <sjg@chromium.org>

Change-Id: Ie3487b15d409c9f4c32dae366640cdcfb725e142
Reviewed-on: https://chromium-review.googlesource.com/927004
Commit-Ready: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jason Clinton <jclinton@chromium.org>
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/897e16832e2be774df0e9930b92d9069a66a9984/chromeos-config/chromeos-config-test-setup.sh
[modify] https://crrev.com/897e16832e2be774df0e9930b92d9069a66a9984/chromeos-config/cros_config_host/validate_config.py

Comment 69 by sjg@chromium.org, Feb 26 2018

Update: 

1. YAML support in cros_config_host is complete.

2. I have some half-baked support in cros_config and hope to have this up for review this week, ideally by 1 March since that would give us a clear month to complete reef migration in Q1.
Project Member

Comment 70 by bugdroid1@chromium.org, Feb 28 2018

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

commit 3e5c847031f824df09cdcaba27350fc2bccf467b
Author: Simon Glass <sjg@chromium.org>
Date: Wed Feb 28 17:21:11 2018

chromeos-config: Provide a way to compare FDT and YAML result

We should get the same result regardless of whether we use FDT or YAML
formats for our config, with some exceptions. Add an option to
cros_config_host to validate that this is in fact true. Make the option
on by default, assuming that a config file in the other format can be
found.

NOTE: The exceptions relate to minor differences between the fdt and
yaml config which appear in tests but which will not be used in real
config files. This means that we should catch any differences in the
wild.

BUG= chromium:796983 
TEST=FEATURES=test sudo -E emerge  --nodeps chromeos-config-host \
            chromeos-config-tools

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

[add] https://crrev.com/3e5c847031f824df09cdcaba27350fc2bccf467b/chromeos-config/libcros_config/test_bad_compare.dts
[add] https://crrev.com/3e5c847031f824df09cdcaba27350fc2bccf467b/chromeos-config/libcros_config/test_bad_compare.yaml
[modify] https://crrev.com/3e5c847031f824df09cdcaba27350fc2bccf467b/chromeos-config/cros_config_host/cros_config_host.py
[modify] https://crrev.com/3e5c847031f824df09cdcaba27350fc2bccf467b/chromeos-config/cros_config_host/libcros_config_host_unittest.py
[modify] https://crrev.com/3e5c847031f824df09cdcaba27350fc2bccf467b/chromeos-config/cros_config_host/libcros_config_host.py

Project Member

Comment 71 by bugdroid1@chromium.org, Feb 28 2018

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

commit 96ba2be5d151047e5279534e0bcf0656c352839b
Author: Simon Glass <sjg@chromium.org>
Date: Wed Feb 28 17:28:39 2018

chromeos-config: Make 'config_format' a member

This does not need to be a global variable, and the current code products
a 'cros lint' warning. Make it a member instead.

BUG= chromium:796983 
TEST=FEATURES=test sudo -E emerge  --nodeps chromeos-config-host \
	chromeos-config-tools

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

[modify] https://crrev.com/96ba2be5d151047e5279534e0bcf0656c352839b/chromeos-config/cros_config_host/libcros_config_host_unittest.py

Project Member

Comment 72 by bugdroid1@chromium.org, Feb 28 2018

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

commit d72590b0e863fa56992cf0a806c5dcdc8607db0a
Author: Simon Glass <sjg@chromium.org>
Date: Wed Feb 28 18:08:39 2018

chromeos-config: Split out identity impl into its own class

We have a separate header file for identity, but at present the
implementation is mixed up in the main cros_config.cc file. This is a bit
confusing. It seems cleaner to split it into a separate class.

Create a new CrosConfigIdentity class and move methods related to identity
into it.

BUG= chromium:796983 
TEST=FEATURES=test sudo -E emerge  --nodeps chromeos-config-host \
	chromeos-config-tools

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

[modify] https://crrev.com/d72590b0e863fa56992cf0a806c5dcdc8607db0a/chromeos-config/libcros_config/cros_config_common.cc
[modify] https://crrev.com/d72590b0e863fa56992cf0a806c5dcdc8607db0a/chromeos-config/libcros_config/identity.cc
[add] https://crrev.com/d72590b0e863fa56992cf0a806c5dcdc8607db0a/chromeos-config/libcros_config/identity.h
[modify] https://crrev.com/d72590b0e863fa56992cf0a806c5dcdc8607db0a/chromeos-config/libcros_config/cros_config.cc
[modify] https://crrev.com/d72590b0e863fa56992cf0a806c5dcdc8607db0a/chromeos-config/libcros_config/cros_config.h

Project Member

Comment 73 by bugdroid1@chromium.org, Feb 28 2018

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

commit 378eb3d986ae84a56316f33b0bf2e0247dd3933c
Author: Simon Glass <sjg@chromium.org>
Date: Wed Feb 28 18:12:10 2018

chromeos-config: Drop the hard-coded phandle properties

These come from the schema now, so read them from there.

BUG= chromium:796983 ,  chromium:761284 
TEST=FEATURES=test sudo -E emerge  --nodeps chromeos-config-host \
	chromeos-config-tools

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

[modify] https://crrev.com/378eb3d986ae84a56316f33b0bf2e0247dd3933c/chromeos-config/libcros_config/cros_config.cc
[modify] https://crrev.com/378eb3d986ae84a56316f33b0bf2e0247dd3933c/chromeos-config/libcros_config/cros_config.h
[modify] https://crrev.com/378eb3d986ae84a56316f33b0bf2e0247dd3933c/chromeos-config/libcros_config/target_dirs.dtsi

Project Member

Comment 74 by bugdroid1@chromium.org, Feb 28 2018

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

commit 7a3ccd493f449080ba8a6619e72b8ea879d957b9
Author: Simon Glass <sjg@chromium.org>
Date: Wed Feb 28 18:30:01 2018

chromeos-config: Use a map for the target directories

These are currently read out from the device tree as needed. This is not
how things will work with yaml. Change the code to read the target
directories in a map at the start, instead.

BUG= chromium:796983 
TEST=FEATURES=test sudo -E emerge  --nodeps chromeos-config-host \
	chromeos-config-tools

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

[modify] https://crrev.com/7a3ccd493f449080ba8a6619e72b8ea879d957b9/chromeos-config/libcros_config/cros_config.cc
[modify] https://crrev.com/7a3ccd493f449080ba8a6619e72b8ea879d957b9/chromeos-config/libcros_config/cros_config.h

Project Member

Comment 75 by bugdroid1@chromium.org, Mar 4 2018

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

commit 7c8afc8e98d9ff1a217ae9bfaae15ca3f3b18442
Author: Simon Glass <sjg@chromium.org>
Date: Sun Mar 04 04:04:09 2018

chromeos-config: Add a ConfigNode object

At present we use a simple integer to reference a node since this is
enough when using a device tree. With yaml we will need a dictionary
pointer.

Create a ConfigNode object to hold the integer offset. We can then add a
dictionary pointer later without changing the logic.

BUG= chromium:796983 
TEST=FEATURES=test sudo -E emerge --nodeps chromeos-config-host \
	chromeos-config-tools

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

[modify] https://crrev.com/7c8afc8e98d9ff1a217ae9bfaae15ca3f3b18442/chromeos-config/libcros_config/lookup.cc
[modify] https://crrev.com/7c8afc8e98d9ff1a217ae9bfaae15ca3f3b18442/chromeos-config/libcros_config/cros_config.cc
[modify] https://crrev.com/7c8afc8e98d9ff1a217ae9bfaae15ca3f3b18442/chromeos-config/libcros_config/cros_config.h

Project Member

Comment 76 by bugdroid1@chromium.org, Mar 4 2018

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

commit fced07620b47e6b33b089a8572f2f3cb58acd4d8
Author: Simon Glass <sjg@chromium.org>
Date: Sun Mar 04 04:04:10 2018

chromeos-config: Rename 'offset' to node

The word 'offset' is a flat-device-tree concept. In yaml we cannot access
nodes by their offset in the file. The offset would also not be useful if
we used a live device tree (e.g. like Linux).

Use the term 'node' instead which works for both yaml and device tree.

BUG= chromium:796983 
TEST=FEATURES=test sudo -E emerge --nodeps chromeos-config-host \
	chromeos-config-tools

Change-Id: Idcd4865a78bff8e487b1278f176d1d3bb83516f9
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/937389
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/fced07620b47e6b33b089a8572f2f3cb58acd4d8/chromeos-config/libcros_config/lookup.cc
[modify] https://crrev.com/fced07620b47e6b33b089a8572f2f3cb58acd4d8/chromeos-config/libcros_config/cros_config.cc
[modify] https://crrev.com/fced07620b47e6b33b089a8572f2f3cb58acd4d8/chromeos-config/libcros_config/cros_config.h

Project Member

Comment 77 by bugdroid1@chromium.org, Mar 4 2018

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

commit 2a690f7b8cdc50cd94c1892173be12e2c44bbde4
Author: Simon Glass <sjg@chromium.org>
Date: Sun Mar 04 04:04:12 2018

chromeos-config: Add a GetProp() method to read properties

Move the logic for reading a property into a method. This will allow us to
use different logic for yaml.

BUG= chromium:796983 
TEST=FEATURES=test sudo -E emerge --nodeps chromeos-config-host \
	chromeos-config-tools

Change-Id: Ic3d61e62a98cc242271a4b7274b4a9dd1220c1f7
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/937391
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/2a690f7b8cdc50cd94c1892173be12e2c44bbde4/chromeos-config/libcros_config/cros_config.cc
[modify] https://crrev.com/2a690f7b8cdc50cd94c1892173be12e2c44bbde4/chromeos-config/libcros_config/cros_config.h

Project Member

Comment 78 by bugdroid1@chromium.org, Mar 4 2018

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

commit 3397d2bee5c80d7b81afc2d1c25812b0d538514e
Author: Simon Glass <sjg@chromium.org>
Date: Sun Mar 04 04:04:13 2018

chromeos-config: Move FDT into a separate class

We want to use both the FDT and yaml configs and check that they return
the same result for each query. In preparation for this, move the main
implementation into a new CrosConfigImpl class, and add a CrosConfigFdt
subclass which implements the FDT-specific pieces.

Most of the code from cros_config.cc moves to cros_config_impl.cc since
we will now have implementations specific to the config file. The code
in lookup.cc moves to cros_config_fdt.cc since is device-tree-specific.
You should be able to use meld to compare files in the previous commit
with their corresponding files.

The CrosConfig class is mostly just a veneer, calling into CrosConfigImpl
subclasses to do the real work.

After this we can add a YAML subclass to implement that, and compare the
results.

NOTE: This is all in one large commit to avoid grumbling.

BUG= chromium:796983 
TEST=FEATURES=test sudo -E emerge --nodeps chromeos-config-host \
	chromeos-config-tools

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

[add] https://crrev.com/3397d2bee5c80d7b81afc2d1c25812b0d538514e/chromeos-config/libcros_config/cros_config_impl.cc
[delete] https://crrev.com/2a690f7b8cdc50cd94c1892173be12e2c44bbde4/chromeos-config/libcros_config/lookup.cc
[modify] https://crrev.com/3397d2bee5c80d7b81afc2d1c25812b0d538514e/chromeos-config/libcros_config/cros_config.cc
[add] https://crrev.com/3397d2bee5c80d7b81afc2d1c25812b0d538514e/chromeos-config/libcros_config/cros_config_fdt.cc
[add] https://crrev.com/3397d2bee5c80d7b81afc2d1c25812b0d538514e/chromeos-config/libcros_config/cros_config_impl.h
[delete] https://crrev.com/2a690f7b8cdc50cd94c1892173be12e2c44bbde4/chromeos-config/libcros_config/cros_config_common.cc
[modify] https://crrev.com/3397d2bee5c80d7b81afc2d1c25812b0d538514e/chromeos-config/chromeos-config.gyp
[modify] https://crrev.com/3397d2bee5c80d7b81afc2d1c25812b0d538514e/chromeos-config/libcros_config/cros_config.h
[add] https://crrev.com/3397d2bee5c80d7b81afc2d1c25812b0d538514e/chromeos-config/libcros_config/cros_config_fdt.h

Project Member

Comment 79 by bugdroid1@chromium.org, Mar 8 2018

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

commit be428afe5b3f2939827bdce89722f3cabea41855
Author: Simon Glass <sjg@chromium.org>
Date: Thu Mar 08 08:37:53 2018

chromeos-config: Add yaml support

Add a new CrosConfigYaml class which allowing using a yaml/json config
file instead of device tree.

This passes all important tests except for submodels. It should be enough
to migrate reef (but this is TBD).

BUG= chromium:796983 
TEST=FEATURES=test sudo -E emerge --nodeps chromeos-config-host \
	chromeos-config-tools

Change-Id: I2e64747eb14ab4f273070bd814ec9e219d0591af
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/936475
Reviewed-by: C Shapiro <shapiroc@google.com>

[add] https://crrev.com/be428afe5b3f2939827bdce89722f3cabea41855/chromeos-config/libcros_config/cros_config_yaml.cc
[modify] https://crrev.com/be428afe5b3f2939827bdce89722f3cabea41855/chromeos-config/libcros_config/cros_config_impl.cc
[modify] https://crrev.com/be428afe5b3f2939827bdce89722f3cabea41855/chromeos-config/libcros_config/cros_config.cc
[add] https://crrev.com/be428afe5b3f2939827bdce89722f3cabea41855/chromeos-config/libcros_config/cros_config_yaml.h
[modify] https://crrev.com/be428afe5b3f2939827bdce89722f3cabea41855/chromeos-config/libcros_config/cros_config_fdt.cc
[modify] https://crrev.com/be428afe5b3f2939827bdce89722f3cabea41855/chromeos-config/libcros_config/cros_config_impl.h
[modify] https://crrev.com/be428afe5b3f2939827bdce89722f3cabea41855/chromeos-config/libcros_config/test.yaml
[modify] https://crrev.com/be428afe5b3f2939827bdce89722f3cabea41855/chromeos-config/libcros_config/cros_config_unittest.cc
[modify] https://crrev.com/be428afe5b3f2939827bdce89722f3cabea41855/chromeos-config/libcros_config/test.json
[delete] https://crrev.com/0c2d56466be865965dd8f48b06d4637535e57b64/chromeos-config/libcros_config/cros_config_json.cc
[modify] https://crrev.com/be428afe5b3f2939827bdce89722f3cabea41855/chromeos-config/chromeos-config-test-setup.sh
[modify] https://crrev.com/be428afe5b3f2939827bdce89722f3cabea41855/chromeos-config/chromeos-config.gyp
[modify] https://crrev.com/be428afe5b3f2939827bdce89722f3cabea41855/chromeos-config/libcros_config/cros_config.h
[modify] https://crrev.com/be428afe5b3f2939827bdce89722f3cabea41855/chromeos-config/libcros_config/cros_config_fdt.h

Comment 80 by sjg@chromium.org, Mar 8 2018

Status: Fixed (was: Started)
This is working now, and manually tested to a very basic level on reef.
Project Member

Comment 81 by bugdroid1@chromium.org, Mar 16 2018

Labels: merge-merged-factory-fizz-10167.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/682b70ec335bd3829a52222d9c20796dd1f8913f

commit 682b70ec335bd3829a52222d9c20796dd1f8913f
Author: Simon Glass <sjg@chromium.org>
Date: Fri Mar 16 02:34:44 2018

unibuild: Don't require unit addresses

We currently require that the master config uses unit addresses when there
are multiple nodes with the same name. This means we need to specify a
'reg' property as well as #address-cells and #size-cells properties.

This can be confusing for people who are not familiar with device tree.
Add a dtc flag so that this is no-longer required.

BUG= chromium:796983 
TEST=FEATURES=test sudo -E emerge chromeos-config-host

Manually uprev'ed the ebuild due to merge conflict.

Change-Id: I4f2303cebccfb4ed71c18094f7da32b558c74ced
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/911977
Reviewed-by: Jason Clinton <jclinton@chromium.org>
Reviewed-by: C Shapiro <shapiroc@google.com>
(cherry picked from commit 47f2cc84fe2ba7833c26231bba9295fa9bec1b54)
Reviewed-on: https://chromium-review.googlesource.com/964799
Commit-Queue: YH Lin <yueherngl@chromium.org>
Tested-by: YH Lin <yueherngl@chromium.org>

[modify] https://crrev.com/682b70ec335bd3829a52222d9c20796dd1f8913f/eclass/cros-unibuild.eclass
[modify] https://crrev.com/682b70ec335bd3829a52222d9c20796dd1f8913f/chromeos-base/chromeos-config/chromeos-config-0.0.1.ebuild
[rename] https://crrev.com/682b70ec335bd3829a52222d9c20796dd1f8913f/chromeos-base/chromeos-config/chromeos-config-0.0.1-r11.ebuild

Sign in to add a comment