source code: py/test/l10n/MIGRATE_REGION_FIELDS.md
l10n Migrate Region FieldsΒΆ
Since crrev.com/c/356873, we stopped using fixed numeric id to encode region fields. Some discussions can be found on crbug.com/624257.
Basically, instead of
region_field: !region_field
...
region_component: !region_component
...
rules:
- name: verify.regions
evaluate: >
Assert(GetVPDValue('ro', 'region') in [
'us', 'gb',
])
you should use
region_field: !region_field [us, gb]
...
region_component: !region_component
in your HWID database. And this is the default setup for all new HWID
databases. For HWID database of old projects, if you need to enable a new
region, which is not in the LEGACY_REGIONS_LIST defined by regions.py
.
Instead of adding the new region to the list, you should migrate to new region
field instead.
You need to do the following:
Create a new image id and new image pattern in HWID database.
The new image pattern can have everything copied from latest image pattern, and then you change
region_field
tonew_region_field
. You should still preserve 8 bits for the new field.In
encoded_fields
section, definenew_region_field
as following:new_region_field: !region_field ['us', 'ca.fr' ...] # You should only list countries approved for list device, including the new # region you plan to add.
Get approval of new HWID database from device PM and SIE.