New issue
Advanced search Search tips

Issue 776411 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature



Sign in to add a comment

Allow building the master config for a model in the filesystem

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

Issue description

Once we start up in user space we should consider writing the configuration for the current model as a set of files/directories on the filesystem. This could act as:

- a cache for cros_config (if reading the config becomes slow in the future)
- a place for devs to look things up in a different way (although we would still want to have all init-script access, etc. to go through cros_config so we can maintain backwards compatibility)

Previously my idea was to use the kernel to do this, since it already has this code, but that would be writing the entire master configuration out.

But this idea involves writing out only the nodes which represent actual config used by *this* device at runtime. This is not (currently) know until user-space starts.

I am thinking of something like:

cros_config --write-config /tmp/fred

to write the config out.

 

Comment 1 by adurbin@google.com, Oct 19 2017

In what format? It also doesn't need to live in /tmp proper. 

Comment 2 by sjg@chromium.org, Oct 19 2017

No, not in /tmp, that was just an example of how you would create it.

Suggested format is similar to the existing /proc/device-tree:

- directories for nodes, with the name the same as the node name
- files for properties, with the decoded property as the contents of the file
- either symlinks for things which are shared, or just copy them (probably have an --resolve-links option for that)

Do you have a more explicit example?

Comment 4 by sjg@chromium.org, Oct 19 2017

Well I can make one up:

It would output a dir structure like this:

/audio
    /main
        cras-config-dir    (file, contains the string "astronaut")
        ucm-suffix         (file, contains the string "astronaut")
        topology-name      (file, contains the string "coral")
/thermal
    dptf.dv    (file, contains the string "astronaut/dptf.dv")

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

Labels: Unibuild

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

Owner: adurbin@chromium.org
To Aaron for comment.

With a recent CL I got the execution time of cros_config down to 10ms, which is getting more acceptable.
Status: Assigned (was: Untriaged)

Sign in to add a comment