tree: 6287b0913be5aaea79569d55d989b9b729396f10 [path history] [tgz]
  1. .gitignore
  2. BUILD.gn
  3. OWNERS
  4. PRESUBMIT.cfg
  5. README.md
  6. chromeos-config-test-setup.sh
  7. cros_config_host/
  8. cros_config_main.cc
  9. cros_config_main_test.cc
  10. cros_config_mock.sh
  11. cros_configfs_main.cc
  12. init/
  13. libcros_config.pc.in
  14. libcros_config/
  15. platform2_preinstall.sh
  16. run_tests.sh
  17. setup.py
  18. test_data/
  19. testbin/
chromeos-config/README.md

Chrome OS Configuration -- Master Chrome OS Configuration tools / library

This is the homepage/documentation for chromeos-config which provides access to the master configuration for Chrome OS.

Internal Documentation

See the design doc for information about the design. This is accessible only within Google. A public page will be published to chromium.org once the feature is complete and launched.

Important classes

See CrosConfig for the class to use to access configuration strings on a target. See cros_config_host.py for access to the config on a host or during a build.

CLI Usage

There are two CLIs built for Chrome OS configuration access, cros_config for use on the target, and cros_config_host for use on the host/during building. See the --help for each tool respectively for help on usage.

Debugging

libcros_config will emit a lot of debugging log messages if you set the CROS_CONFIG_DEBUG environment variable to a non-empty value before calling into the library.

Config Schema

Chrome OS config is now YAML based. If you're still using the Flat Device Tree (FDT) based implementation, see the v1 schema description below.

The following components make up the YAML based chromeos-config support:

YAML Source

The YAML source is designed for human maintainability. It allows for easy config sharing across many different devices (via anchors).

For background on YAML, see: Learn YAML in 10 minutes

The source is generally located at:

ls src/overlay-${BOARD}/chromeos-base/chromeos-config-bsp/files/model.yaml

Beyond the normal features of YAML, there are a few custom features supported that allow for even better re-use and expressiveness in the YAML config.

  1. Templating - Templating allows config to be shared by letting callers reference variables in the config, which are then evaluated on a per device/sku/product basis.

    The basic syntax is:

    some-element: "{{some-template-variable}}"
    

    Valid template variables are any YAML elements that are currently in scope. When generating config, scope is evaluated in the following order:

    1. sku
    2. config (this is recursive ... any variable at any level can be referenced)
    3. device
    4. product

    This order allows shared anchors to define default variables that are then optionally overridden by either the device or product scope.

  2. Local Variables - These are variables that are only used for templating and are dropped in the final JSON output. Variables starting with ‘$’ are considered local and are ignored after template evaluation. The basic syntax is:

    config:
      $some-local-variable: "some-value"
      some-element: "{{$some-local-variable}}"
    

    This supports the following:

    1. Defining local variables that are re-used in multiple places (e.g. file paths).
    2. Re-using common config (e.g. ‘identity’) where the variable value isn't known until the device/product/sku variables come into scope (e.g. $sku-id).
  3. File Imports - File imports allow common snippets of YAML to be shared across multiple different implementations. File importing works the same as if the YAML files were cat'd together and then evaluated. File importing is recursive also, so it will support importing files that import other files. Import paths must be relative to the file that specifies the import.

    imports:
      - "some_common_import_file.yaml"
      - "../common/some_other_common_import_file.yaml"
    

The following provides a simple example of a config using both core YAML features and the custom features described above.

common_config: &common_config
  name: "{{$device-name}}"
  brand-code: "{{$brand-code}}"
  identity:
    platform-name: "SomePlatform"
    smbios-name-match: "SomePlatform"
    sku-id: "{{$sku-id}}"
  firmware-signing:
    key-id: "{{$key-id}}"
    signature-id: "{{name}}"
chromeos:
  devices:
    - $device-name: "SomeDevice"
      products:
        - $brand-code: "YYYY"
          $key-id: "SOME-KEY-ID"
      skus:
        - $sku-id: 0
          config:
            <<: *common_config
            wallpaper: "some-wallpaper"
        - $sku-id: 1
          config: *common_config

When this YAML is evaluated, it will fully expand out as the following:

chromeos:
  models:
    - name: "SomeDevice"
      brand-code: "YYYY"
      identity:
        platform-name: "SomePlatform"
        smbios-name-match: "SomePlatform"
        sku-id: 0
      firmware-signing:
        key-id: "SOME-KEY-ID"
        signature-id: "SomeDevice"
      wallpaper: "some-wallpaper"
    - name: "SomeDevice"
      brand-code: "YYYY"
      identity:
        platform-name: "SomePlatform"
        smbios-name-match: "SomePlatform"
        sku-id: 1
      firmware-signing:
        key-id: "SOME-KEY-ID"
        signature-id: "SomeDevice"

YAML Merging (multiple source YAML files)

There are various cases where it makes sense to manage YAML config across multiple different repos in separate YAML files.

E.g.

  • Permissions based control via git repo access to specific config
  • Extending overlays for device customization (e.g. Moblab)

This is supported through cros_config_schema tool and is invoked as part of the chromeos-config ebuild.

Using normal portage ebuilds/config, users can install as many YAML files as they wish to be merged together into: /usr/share/chromeos-config/yaml

E.g.

  • models.yaml
  • models-private.yaml (private config overlaid on the public config)

These files are then merged together based on their lexicographic name order.

Merging of YAML files applies the following characteristics:

  1. Order is important. If two files supply the same config, the last file wins.

  2. Identity is important. Config is merged based on ONE OF the following:

    1. name - If the name attribute matches, the config is merged
    2. identity - all fields of identity must match explicitly for code generation purposes. The fields are documented in identity. All fields that are present in the second file must be present in the first file. Note that a null value (the field is not present) and an empty string (the field is assigned the value of "") are not considered a match for code generation purposes.

For a detailed example of how merging works, see the following test files:

  1. test_merge_base.yaml - First file passed to the merge routine.
  2. test_merge_overlay.yaml - Second file passed (winner of any conflicts).
  3. test_merge.json - Result generated from the merge.

YAML Transform (to SquashFS)

Before the config gets used on the device, it's translated to a flattened filesystem view of the configuration, and stored as a SquashFS image. This keeps the runtime code on the device very simple.

First, the configuration is flattened using the following algorithm:

  • FOREACH device in chromeos/devices
    • FOREACH product in device/products
      • FOREACH sku in device/skus
        • sku varibles are put into scope
        • config variables are put into scope
        • device variables are put into scope
        • product variables are put into scope
        • with sku/config
          • config template variables are evaluated

After this, the configuration is stored in a SquashFS, with paths representing directories, and properties representing files.

/
├── identity.bin        # "Table of contents" to efficiently lookup device identity.
└── v1
    └── chromeos
        └── configs
            ├── 0
            │   ├── ...
            │   ├── power
            │   │   └── ...
            │   ├── wallpaper
            │   └── ...
            ├── 1
            │   ├── ...
            │   ├── power
            │   │   └── ...
            │   ├── wallpaper
            │   └── ...
            └── ...

This file gets installed at /usr/share/chromeos-config/configfs.img, and is used internally by the cros_configfs tool.

Making changes to a YAML model file

When modifying a model.yaml file there are few steps that need to be taken to manifest the change in a board target. Since the actual work to combine and process the YAML files is done in the chromeos-config ebuild, it needs to be remerged after the input YAML has been modified.

  1. Start cros_workon on the ebuild where your source model.yaml lives:

    (chroot) $ cros_workon start chromeos-base/chromeos-config-bsp-${BOARD}
    
  2. Make and install your incremental changes:

    (chroot) $ cros_workon_make chromeos-base/chromeos-config-bsp-${BOARD} --install
    
  3. Remerge the chromeos-config ebuild:

    Note: The config-bsp overlay path may be slightly different depending on the board and if it is public or private.

    (chroot) $ emerge-$BOARD chromeos-config
    

Schema Validation

The config is evaluated against a http://json-schema.org/ schema located at: chromeos-config/cros_config_host/cros_config_schema.yaml

NOTE: The schema is managed in YAML because it's easier to edit than JSON.

Only the transformed JSON is actually evaluated against the schema. Authors can do whatever makes sense in the YAML (from a sharing perspective) as long as it generates compliant JSON that passes the schema validation.

The schema documentation is auto-generated (and put into this README.md file) via: python -m cros_config_host.generate_schema_doc -o README.md

The schema definition is below:

CrOS Config Type Definitions (v2)

Definitions

In the tables below,

  • Build-only attributes get automatically stripped from the platform JSON as part of the build.

model

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
arcarcFalseFalse
audioaudioFalseFalse
auto-night-lightbooleanFalseFalseWhether the auto-night-light feature is enabled on the device, which sets the schedule for Night light automatically to sunset-to-sunrise.
bluetoothbluetoothFalseFalse
brand-codestringFalseFalseBrand code of the model (also called RLZ code).
cameracameraFalseFalse
cros-healthdcros-healthdFalseFalseContains properties used by cros_healthd for model-specific telemetry. Each property represents a category of information and contains boolean properties that indicate whether a device supports a particular telemetry item. See cros_healthd_probe.mojom for descriptions of each property.
cross-devicecross-deviceFalseFalseContains properties to configure cross-device features between ChromeOS devices and other devices, such as Instant Tethering and Smart Lock.
demo-modedemo-modeFalseFalseProperties related to the ChromeOS Demo Mode, defining the user experience when the device is used in retail.
detachable-basedetachable-baseFalseFalseContains the configuration for the hammerd which is used to update the detachable base firmware.
fingerprintfingerprintFalseFalseContains details about the model's fingerprint implementation.
firmwarefirmwareFalseFalse
firmware-signingfirmware-signingFalseTrue
hardware-propertieshardware-propertiesFalseFalseContains boolean flags or enums for hardware properties of this board, for example if it's convertible, has a touchscreen, has a camera, etc. This information is used to auto-generate C code that is consumed by the EC build process in order to do run-time configuration. If a value is defined within a config file, but not for a specific model, that value will be assumed to be false for that model. If a value is an enum and is not specified for a specific model, it will default to “none”. All properties must be booleans or enums. If non-boolean properties are desired, the generation code in cros_config_schema.py must be updated to support them.
identityidentityFalseFalseDefines attributes that are used by cros_config to detect the identity of the platform and which corresponding config should be used. This tuple must either contain x86 properties only or ARM properties only.
modemmodemFalseFalse
namestring^[_a-zA-Z0-9]{3,}TrueFalseGoogle code name for the given model. While it is OK to use this string for human-display purposes (such as in a debug log or help dialog), or for a searchable-key in metrics collection, it is not recommended to use this property for creating model-specific behaviors. In this case, add a property to the schema which describes your behavior and use that instead.
nnpalmnnpalmFalseFalse
oem-idstring[0-9]+FalseFalseSome projects store SKU ID, OEM ID and Board Revision in an EEPROM and only SKU ID can be updated in the factory and RMA flow but others should be pre-flashed in the chip level. In this case, we would like to validate whether oem-id here from the updated SKU ID matches the one in the EEPROM so we can prevent this device from being updated to another OEM's devices.
powerpowerFalseFalseDefines settings that control power management functions. This mostly defines power_manager preferences, but but there are a few other power related settings included. For details about each power_manager preference, see - src/platform2/power_manager/common/power_constants.h/cc For examples on setting these properties (including multiline examples), see the power config example in libcros_config/test.yaml
regulatory-labelstringFalseFalseBase name of the directory containing the regulatory label files to show on this device.
test-labelstringFalseFalseTest alias (model) label that will be applied in Autotest and reported for test results.
thermalthermalFalseFalse
touchtouchFalseFalse
uiuiFalseFalse
wallpaperstringFalseFalseBase filename of the default wallpaper to show on this device.
wifiwifiFalseFalseSets limits on maximum WiFi transmit power for tablet and non-tablet device configurations. This config must contain properties for ath10k wifi driver or rtw88 wifi driver only.

arc

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
build-propertiesbuild-propertiesTrueFalse
hardware-featureshardware-featuresFalseFalseDefines hardware_features.xml file provided to ARC during initialization.
media-profilesmedia-profilesFalseFalseDefines media_profiles.xml file provided to ARC during initialization.
scaleintegerFalseFalseThe screen density value in dpi that will be used for ARC apps. This value should be from the list of DPIs in android cdd.

build-properties

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
devicestringTrueFalseDevice name to report in ‘ro.product.device’. This is often ‘{product}_cheets’ but it can be something else if desired.
first-api-levelstringTrueFalseThe first Android API level that this model shipped with.
marketing-namestringFalseFalseName of this model as it is called in the market, reported in ‘ro.product.model’. This often starts with ‘{oem}’.
metrics-tagstringTrueFalseTag to use to track metrics for this model. The tag can be shared across many devices if desired, but this will result in larger granularity for metrics reporting. Ideally the metrics system should support collation of metrics with different tags into groups, but if this is not supported, this tag can be used to achieve the same end. This is reported in ‘ro.product.metrics.tag’.
oemstringFalseFalseOriginal Equipment Manufacturer for this model. This generally means the OEM name printed on the device.
pai-regionsstring```(^([a-zA-Z0-9.-]+,)*[a-zA-Z0-9.-]+$)(^*$)```FalseFalse
productstringTrueFalseProduct name to report in ‘ro.product.name’. This may be the device name, or it can be something else, to allow several devices to be grouped into one product.

hardware-features

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
build-pathstringTrueTrueSource of the file relative to the build system.
system-pathstringTrueFalseInstallation path for the file on the system image.

media-profiles

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
build-pathstringTrueTrueSource of the file relative to the build system.
system-pathstringTrueFalseInstallation path for the file on the system image.

audio

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
mainmainTrueFalse

main

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
cras-config-dirstringTrueFalseSubdirectory for model-specific configuration.
disable-profilestringFalseFalseOptional --disable_profile parameter for CRAS deamon.
filesarray - filesFalseTrue
ucm-suffixstringFalseFalseOptional UCM suffix used to determine model specific config.

files

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
destinationstringFalseTrueInstallation path for the file on the system image.
sourcestringFalseTrueSource of the file relative to the build system.

bluetooth

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
configconfigFalseFalse
flagsflagsFalseFalse

config

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
build-pathstringTrueTrueSource of the file relative to the build system.
system-pathstringTrueFalseInstallation path for the file on the system image.

flags

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
enable-suspend-managementbooleanFalseFalseEnable powerd suspend management callbacks.
reset-on-resumebooleanFalseFalseExpect bluetooth chip to have reset on resume.
stop-on-suspendbooleanFalseFalseStop the bluetooth adapter on suspend and start it on resume.

camera

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
clockstringFalseFalseSpecified the camera clock on the model.
config-fileconfig-fileFalseFalseDefines the camera configuration file.
countintegerFalseFalseSpecified the number of cameras on the model.
legacy-usbbooleanFalseFalseIndicates if the device has legacy usb cameras.
zsl-lookbackintegerFalseFalseSpecifies the duration to look back for Zero-Shutter Lag (ZSL) in milliseconds.

config-file

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
build-pathstringTrueTrueSource of the file relative to the build system.
system-pathstringTrueFalseInstallation path for the file on the system image.

cros-healthd

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
backlightbacklightFalseFalse
batterybatteryFalseFalse
cached-vpdcached-vpdFalseFalse

backlight

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
has-backlightbooleanFalseFalse

battery

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
has-smart-battery-infobooleanFalseFalse

cached-vpd

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
has-sku-numberbooleanFalseFalse

cross-device

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
instant-tetheringinstant-tetheringFalseFalseContains properties to configure the Instant Tethering cross-device feature.

instant-tethering

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
disable-instant-tetheringbooleanFalseFalseDisables the Instant Tethering feature. false by default

demo-mode

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
highlights-extension-idstringFalseFalseThe Chrome extension ID of the highlights app used during demo mode.
screensaver-extension-idstringFalseFalseThe Chrome extension ID of the attract loop played during demo mode.

detachable-base

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
ec-image-namestringFalseFalseThe target EC binary name which is placed under /lib/firmware.
filesarray - filesFalseTrue
product-idintegerFalseFalseThe Product ID of the detachable base. This value can be queried by command ‘lsusb’. By taking this as an example: Bus 001 Device 032: ID 18d1:503c Google Inc. the product-id is 20540(=0x503c).
touch-image-namestringFalseFalseThe touchpad binary name which is placed under /lib/firmware. This is only needed if the detachable base contains touchpad.
usb-pathstringFalseFalseSearches and finds the idVendor and idProduct under sysfs /sys/bus/usb/devices/* which matches the vendor-id and product-id. By taking this as an example: ‘/sys/bus/usb/devices/1-1.1’ The usb-path is ‘1-1.1’.
vendor-idintegerFalseFalseThe Vendor ID of the detachable base. This value can be queried by command ‘lsusb’. By taking this as an example: Bus 001 Device 032: ID 18d1:503c Google Inc. the vendor-id is 6353(=0x18d1).

files

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
destinationstringFalseTrueInstallation path for the file on the system image.
sourcestringFalseTrueSource of the file relative to the build system ${FILESDIR}
symlinkstringFalseTrueSymlink file that will be installed pointing to the destination.

fingerprint

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
boardstringFalseFalseSpecifies the fingerprint board in use.
fingerprint-sensor-typestringFalseFalseType of FP sensor. Currently describes whether FP is overlapped on the power button or not.
sensor-locationstringFalseFalseSpecifies the location of the fingerprint sensor.

firmware

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
bcs-overlaystringFalseTrueBCS overlay path used to determine BCS file path for binary firmware downloads.
build-targetsbuild-targetsFalseTrue
ec-ro-imagestringFalseTrueName of the file located in BCS under the respective bcs-overlay.
firmware-configintegerFalseFalseThe firmware config bitmap to be flashed to the CBI. This field is used in the factory.
image-namestringFalseFalseThe name of the firmware image used by the firmware updater. Typically the device name, but can differ when a device may have two or more different firmware images.
key-idstringFalseTrueKey ID from the signer key set that is used to sign the given firmware image.
main-ro-imagestringFalseTrueName of the file located in BCS under the respective bcs-overlay.
main-rw-imagestringFalseTrueName of the file located in BCS under the respective bcs-overlay.
namestringFalseTrueThis is a human-recognizable name used to refer to the firmware. It will be used when generating the shellball via firmware packer. Mainly, this is only for compatibility testing with device tree (since DT allowed firmwares to be named).
no-firmwarebooleanFalseTrueDoes nothing and pending removal. Do not set. (Bug)
pd-ro-imagestringFalseTrueName of the file located in BCS under the respective bcs-overlay.

build-targets

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
basestringFalseTrueBuild target of the base EC firmware for a detachable device, that will be considered dirty when building/testing
corebootstringFalseTrueBuild target that will be considered dirty when building/testing locally.
depthchargestringFalseTrueBuild target that will be considered dirty when building/testing locally.
ecstringFalseTrueBuild target that will be considered dirty when building/testing locally.
ec_extrasarray - stringFalseTrueExtra EC build targets to build within chromeos-ec.
gscstringFalseTrueBuild target that will be considered dirty when building/testing locally.
ishstringFalseTrueBuild target that will be considered dirty when building/testing locally.
libpayloadstringFalseTrueBuild target that will be considered dirty when building/testing locally.
u-bootstringFalseTrueBuild target that will be considered dirty when building/testing locally.

firmware-signing

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
key-idstringTrueTrueKey ID from the signer key set that is used to sign the given firmware image.
sig-id-in-customization-idbooleanFalseTrueIndicates that this model cannot be decoded by the mapping table. Instead the model is stored in the VPD (Vital Product Data) region in the customization_id property. This allows us to determine the model to use in the factory during the finalization stage. Note that if the VPD is wiped then the model will be lost. This may mean that the device will revert back to a generic model, or may not work. It is not possible in general to test whether the model in the VPD is correct at run-time. We simply assume that it is. The advantage of using this property is that no hardware changes are needed to change one model into another. For example we can create 20 different whitelabel boards, all with the same hardware, just by changing the customization_id that is written into SPI flash.
signature-idstringTrueTrueID used to generate keys/keyblocks in the firmware signing output.

hardware-properties

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
display-typestringFalseFalseDenotes the type of display this device contains.
has-base-accelerometerbooleanFalseFalseIs there an accelerometer in the base of the device.
has-base-gyroscopebooleanFalseFalseIs there a gyroscope in the base of the device.
has-base-light-sensorbooleanFalseFalseIs there a light sensor in the base of the device.
has-base-magnetometerbooleanFalseFalseIs there a magnetometer in the base of the device.
has-lid-accelerometerbooleanFalseFalseIs there an accelerometer in the lid of the device.
has-lid-gyroscopebooleanFalseFalseIs there a gyroscope in the lid of the device.
has-lid-light-sensorbooleanFalseFalseIs there a light sensor in the lid of the device.
has-lid-magnetometerbooleanFalseFalseIs there a magnetometer in the lid of the device.
has-touchscreenbooleanFalseFalseDoes the device have a touchscreen.
is-lid-convertiblebooleanFalseFalseCan the lid be rotated 360 degrees.
psu-typestringFalseFalseType of PSU the device has: - battery: the device has a battery intended for primary use - AC_primary: the device has a battery, but it is not intended for primary use - AC_only: the device has no battery - no_power: the device does not receive power in any direct manner (e.g., it is virtualized)
stylus-categorystringFalseFalseDenotes the category of stylus this device contains.

identity

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
customization-idstringFalsex86False‘customization_id’ value set in the VPD for non-unibuild Zergs and Whitelabels. Deprecated for use in new products since 2017/07/26.
platform-namestringFalsex86FalseDefines the name of the mosys platform used. Mosys is the only software which is allowed to used this value.
sku-idintegerFalsex86FalseSKU/Board strapping pins configured during board manufacturing. Leaving this value unset will cause the config to match any SKU ID. Minimum value: -0x1. Maximum value: 0x7fffffff.
smbios-name-matchstringFalsex86False[x86] Firmware name built into the firmware and reflected back out in the SMBIOS tables. Leaving this value unset will cause the config to match any SMBIOS product name.
whitelabel-tagstringFalsex86False‘whitelabel_tag’ value set in the VPD, to add Whitelabel branding over an unbranded base model.
device-tree-compatible-matchstringFalseARMFalse[ARM] String pattern (partial) that is matched against the contents of /proc/device-tree/compatible on ARM devices.
platform-namestringFalseARMFalseDefines the name of the mosys platform used. Mosys is the only software which is allowed to used this value.
sku-idintegerFalseARMFalseSKU/Board strapping pins configured during board manufacturing. Leaving this value unset will cause the config to match any SKU ID. Minimum value: -0x1. Maximum value: 0x7fffffff.
whitelabel-tagstringFalseARMFalse‘whitelabel_tag’ value set in the VPD, to add Whitelabel branding over an unbranded base model.

modem

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
firmware-variantstringFalseFalseVariant of the modem firmware to be used. This value is read by modemfwd to match against the variant field of a firmware entry in a firmware manifest. In most cases, we simply use the model name as the value.

nnpalm

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
radius-polynomialstringFalseFalseOptional - empty by default.
touch-compatiblebooleanFalseFalseOptional - false by default but should be true for compatible devices.

power

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
allow-ambient-eqstring^[01]$FalseFalseEnable (1) or disable (0) Ambient EQ.
als-smoothing-constantstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
autobrightnessautobrightnessFalseFalse
avoid-suspend-when-headphone-jack-pluggedstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
battery-poll-interval-initial-msstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
battery-poll-interval-msstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
battery-stabilized-after-line-power-connected-msstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
battery-stabilized-after-line-power-disconnected-msstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
battery-stabilized-after-resume-msstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
battery-stabilized-after-startup-msstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
charging-portsstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
cutoff-power-uastringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
dark-resume-devicesstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
dark-resume-sourcesstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
detect-hoverstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
disable-dark-resumestringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
disable-idle-suspendstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
enable-console-during-suspendstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
external-display-onlystringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
factory-modestringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
has-ambient-light-sensorstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
has-charge-controllerstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
has-keyboard-backlightstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
hibernate-power-uastringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
ignore-external-policystringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
instant-transitions-below-min-levelstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
internal-backlight-als-stepsstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
internal-backlight-max-nitsstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
internal-backlight-no-als-ac-brightnessstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
internal-backlight-no-als-battery-brightnessstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
keyboard-backlight-als-stepsstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
keyboard-backlight-keep-on-during-video-msstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
keyboard-backlight-keep-on-msstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
keyboard-backlight-no-als-brightnessstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
keyboard-backlight-turn-on-for-user-activitystringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
keyboard-backlight-user-stepsstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
legacy-power-buttonstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
low-battery-shutdown-percentstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
low-battery-shutdown-time-sstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
max-charge-samplesstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
max-current-samplesstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
max-dark-suspend-delay-timeout-msstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
min-visible-backlight-levelstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
mosys-eventlogstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
multiple-batteriesstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
num-sessions-on-current-chargestringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
plugged-dim-msstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
plugged-off-msstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
plugged-suspend-msstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
power-supply-full-factorstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
require-usb-input-device-to-suspendstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
retry-suspend-attemptsstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
retry-suspend-msstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
set-cellular-transmit-power-dpr-gpiostringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
set-cellular-transmit-power-for-proximitystringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
set-cellular-transmit-power-for-tablet-modestringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
set-wifi-transmit-power-for-proximitystringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
set-wifi-transmit-power-for-tablet-modestringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
shutdown-from-suspend-secstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
smart-discharge-to-zero-hrstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
suspend-modestringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
suspend-to-idlestringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
touchpad-wakeupstring^[01]$FalseFalseEnable (1) or disable (0) wake from touchpad.
tpm-counter-suspend-thresholdstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
tpm-status-interval-secstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
turn-off-screen-timeout-msstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
unplugged-dim-msstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
unplugged-off-msstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
unplugged-suspend-msstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
usb-min-ac-wattsstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
use-crasstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
use-lidstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
wake-on-dpstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/
wakeup-input-device-namesstringFalseFalseFor details, see https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/master/power_manager/

autobrightness

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
config-fileconfig-fileTrueFalse

config-file

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
build-pathstringTrueTrueSource of the file relative to the build system.
system-pathstringTrueFalseInstallation path for the file on the system image.

thermal

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
dptf-dvstringFalseFalseSystem image path to the .dv file containing DPTF (Dynamic Platform and Thermal Framework) settings.
filesarray - filesTrueTrue

files

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
destinationstringFalseTrueInstallation path for the file on the system image.
sourcestringFalseTrueSource of the file relative to the build system.

touch

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
filesarray - filesFalseTrue

files

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
destinationstringFalseTrueInstallation path for the file on the system image.
sourcestringFalseTrueSource of the file relative to the build system ${FILESDIR}
symlinkstringFalseTrueSymlink file that will be installed pointing to the destination.

ui

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
extra-ash-flagsarray - stringFalseTrueFlags passed to the Ash window manager and system UI. Each entry should be a string of the form --=, or -- for boolean flags. If this property is not set, flags will be determined by other cros_config properties. Serialized to a null byte separated string when written to configfs.img
power-buttonpower-buttonFalseFalse
side-volume-buttonside-volume-buttonFalseFalseDefines the position of the side volume button. region indicates whether the button is at the side of the “screen” or “keyboard” of the device. side indicates which edge the button is anchored to while the device in landscape primary screen orientation. It can be “left”, “right”, “top”, “bottom”.

power-button

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
edgestringFalseFalse
positionstringFalseFalse

side-volume-button

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
regionstringFalseFalse
sidestringFalseFalse

wifi

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
non-tablet-mode-power-table-ath10knon-tablet-mode-power-table-ath10kFalseath10kFalse[ath10k] WiFi power chain for use with QCA ath10k drivers. Limits in units of 1 dBm. 5g band power limit applies to all 5g bands.
tablet-mode-power-table-ath10ktablet-mode-power-table-ath10kFalseath10kFalse[ath10k] WiFi power chain for use with QCA ath10k drivers. Limits in units of 1 dBm. 5g band power limit applies to all 5g bands.
geo-offsets-eugeo-offsets-euFalsertwFalseOffsets which are applied to WiFi power limits depending on the current regulatory domain. Offsets in units of 0.125 dBm. The sum of a geo offset and any power limit to which it applies cannot exceed 255. When the current regulatory domain is unknown or has yet to be determined, the base transmit power limits are used without any geo offsets applied. ‘geo-offsets-fcc’ is used for regulatory domains which follow FCC guidelines, ‘geo-offsets-eu’ is used for regulatory domains which follow ETSI guidelines, and ‘geo-offsets-rest-of-world’ is used for regulatory domains which don't follow FCC or ETSI guidelines.
geo-offsets-fccgeo-offsets-fccFalsertwFalseOffsets which are applied to WiFi power limits depending on the current regulatory domain. Offsets in units of 0.125 dBm. The sum of a geo offset and any power limit to which it applies cannot exceed 255. When the current regulatory domain is unknown or has yet to be determined, the base transmit power limits are used without any geo offsets applied. ‘geo-offsets-fcc’ is used for regulatory domains which follow FCC guidelines, ‘geo-offsets-eu’ is used for regulatory domains which follow ETSI guidelines, and ‘geo-offsets-rest-of-world’ is used for regulatory domains which don't follow FCC or ETSI guidelines.
geo-offsets-rest-of-worldgeo-offsets-rest-of-worldFalsertwFalseOffsets which are applied to WiFi power limits depending on the current regulatory domain. Offsets in units of 0.125 dBm. The sum of a geo offset and any power limit to which it applies cannot exceed 255. When the current regulatory domain is unknown or has yet to be determined, the base transmit power limits are used without any geo offsets applied. ‘geo-offsets-fcc’ is used for regulatory domains which follow FCC guidelines, ‘geo-offsets-eu’ is used for regulatory domains which follow ETSI guidelines, and ‘geo-offsets-rest-of-world’ is used for regulatory domains which don't follow FCC or ETSI guidelines.
non-tablet-mode-power-table-rtwnon-tablet-mode-power-table-rtwFalsertwFalse[rtw] WiFi power chain for use with Realtek rtw88 drivers. Limits in units of 0.125 dBm. 5g band 2 (channels 5.35G-5.47G) power limit is not supported.
tablet-mode-power-table-rtwtablet-mode-power-table-rtwFalsertwFalse[rtw] WiFi power chain for use with Realtek rtw88 drivers. Limits in units of 0.125 dBm. 5g band 2 (channels 5.35G-5.47G) power limit is not supported.

non-tablet-mode-power-table-ath10k

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
limit-2gintegerFalseFalse2G band power limit (dBm) Minimum value: 0x0. Maximum value: 0xff.
limit-5gintegerFalseFalse5G band power limit (dBm) Minimum value: 0x0. Maximum value: 0xff.

tablet-mode-power-table-ath10k

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
limit-2gintegerFalseFalse2G band power limit (dBm) Minimum value: 0x0. Maximum value: 0xff.
limit-5gintegerFalseFalse5G band power limit (dBm) Minimum value: 0x0. Maximum value: 0xff.

geo-offsets-eu

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
offset-2gintegerFalseFalseValue to be added to the 2.4GHz WiFi band. (0.125 dBm) Minimum value: 0x0. Maximum value: 0xff.
offset-5gintegerFalseFalseValue to be added to all 5GHz WiFi bands. (0.125 dBm) Minimum value: 0x0. Maximum value: 0xff.

geo-offsets-fcc

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
offset-2gintegerFalseFalseValue to be added to the 2.4GHz WiFi band. (0.125 dBm) Minimum value: 0x0. Maximum value: 0xff.
offset-5gintegerFalseFalseValue to be added to all 5GHz WiFi bands. (0.125 dBm) Minimum value: 0x0. Maximum value: 0xff.

geo-offsets-rest-of-world

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
offset-2gintegerFalseFalseValue to be added to the 2.4GHz WiFi band. (0.125 dBm) Minimum value: 0x0. Maximum value: 0xff.
offset-5gintegerFalseFalseValue to be added to all 5GHz WiFi bands. (0.125 dBm) Minimum value: 0x0. Maximum value: 0xff.

non-tablet-mode-power-table-rtw

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
limit-2gintegerFalseFalse2G band power limit: All 2G band channels. (0.125 dBm) Minimum value: 0x0. Maximum value: 0xff.
limit-5g-1integerFalseFalse5G band 1 power limit: 5.15G-5.35G channels. (0.125 dBm) Minimum value: 0x0. Maximum value: 0xff.
limit-5g-3integerFalseFalse5G band 3 power limit: 5.47G-5.725G channels. (0.125 dBm) Minimum value: 0x0. Maximum value: 0xff.
limit-5g-4integerFalseFalse5G band 4 power limit: 5.725G-5.95G channels. (0.125 dBm) Minimum value: 0x0. Maximum value: 0xff.

tablet-mode-power-table-rtw

AttributeTypeRegExRequiredOneof GroupBuild-onlyDescription
limit-2gintegerFalseFalse2G band power limit: All 2G band channels. (0.125 dBm) Minimum value: 0x0. Maximum value: 0xff.
limit-5g-1integerFalseFalse5G band 1 power limit: 5.15G-5.35G channels. (0.125 dBm) Minimum value: 0x0. Maximum value: 0xff.
limit-5g-3integerFalseFalse5G band 3 power limit: 5.47G-5.725G channels. (0.125 dBm) Minimum value: 0x0. Maximum value: 0xff.
limit-5g-4integerFalseFalse5G band 4 power limit: 5.725G-5.95G channels. (0.125 dBm) Minimum value: 0x0. Maximum value: 0xff.

On the Device

At bootup, cros_configfs is executed to mount /usr/share/chromeos-config/configfs.img at /run/chromeos-config/private. The table of contents is scanned to match the device's identity to a matching configuration, and the corresponding directory then gets mounted (via a bind mount) to /run/chromeos-config/v1.

Identity Matching

Identity matching is done by comparing properties which come from /identity to the corresponding values from firmware. If properties are left unspecified in /identity, they will match any value from firmware, or even a missing value.

The first config with a matching identity is selected.

The files in the table below, exposed from firmware by the kernel, are used to compare the values from firmware. Strings are compared case-insensitive.

Property (from /identity)x86 fileARM file
smbios-name-match/sys/class/dmi/id/product_nameN/A
device-tree-compatible-matchN/A/proc/device-tree/compatible
sku-id/sys/class/dmi/id/product_sku/proc/device-tree/firmware/coreboot/sku-id
customization-id/sys/firmware/vpd/ro/customization_id/sys/firmware/vpd/ro/customization_id
whitelabel-tag/sys/firmware/vpd/ro/whitelabel_tag/sys/firmware/vpd/ro/whitelabel_tag

File Parsing Notes

All files are parsed as strings, except where mentioned below:

/proc/device-tree/compatible: This file contains a list of null-terminated strings. If any of the strings in the list match device-tree-compatible-match, it is considered to be a match.

/sys/class/dmi/id/product_sku: This file is parsed as scanf("sku%u", &sku_id).

/proc/device-tree/firmware/coreboot/sku-id: 4 bytes, parsed as a 32-bit network-endian integer.

Accessing the Config

The configuration can be read by any language or library simply by reading the corresponding file to the property. For example, to read /ui/power-button:edge from the configuration, you can simply read the contents of /run/chromeos-config/v1/ui/power-button/edge.

There is also the cros_config command line tool, which can cat these files for you, or libcros_config, which provides C++ bindings used widely across platform2 to read these files.

Usage Instructions

Adding and testing new properties

Before starting, cros_workon the following:

(chroot) $ cros_workon --host start chromeos-config-host
(chroot) $ cros_workon --board=BOARD start chromeos-config-bsp chromeos-config

To introduce a new property, first add its definition to the schema:

chromeos-config/cros_config_host/cros_config_schema.yaml

Then update the README.md automatically via (unit tests will check this):

(chroot) $ python -m cros_config_host.generate_schema_doc -o README.md

To install the updated schema, run:

(chroot) $ FEATURES=test sudo -E emerge chromeos-config-host

To use the new property, update your respective YAML source file. e.g. overlay-${BOARD}-private/chromeos-base/chromeos-config-bsp/files/model.yaml

To install the changes, run:

(chroot) $ emerge-${BOARD} chromeos-config-bsp chromeos-config

At this point the updated config is located at:

/build/${BOARD}/usr/share/chromeos-config/yaml/config.yaml

To query your new item run the test command in the chroot:

(chroot) $  cros_config_host -c /build/${BOARD}/usr/share/chromeos-config/yaml/config.yaml -m <MODEL> get </path/to/property> <property name>

For instance:

(chroot) $ cros_config_host -c /build/coral/usr/share/chromeos-config/yaml /config.yaml -m robo360 get /firmware key-id
(chroot) $ cros_config_host -c /build/coral/usr/share/chromeos-config/yaml /config.yaml list-models

Device Testing

To test configuration changes on actual devices use the platform.CrosConfig Tast test. This will run cros_config tests for unibuilds and mosys for all devices. See HOWTO.