tree: 6282f72f78fefbb6cc1409cc29903299a0ea5b61 [path history] [tgz]
  1. init/
  2. protos/
  3. tmpfiles.d/
  4. tools/
  5. BUILD.gn
  6. DIR_METADATA
  7. feature_check.cc
  8. feature_management.cc
  9. feature_management.h
  10. feature_management_backend.cc
  11. feature_management_fake.cc
  12. feature_management_fake.h
  13. feature_management_hwid.cc
  14. feature_management_hwid.h
  15. feature_management_hwid_test.cc
  16. feature_management_impl.cc
  17. feature_management_impl.h
  18. feature_management_impl_test.cc
  19. feature_management_interface.h
  20. feature_management_test.cc
  21. feature_management_util.cc
  22. feature_management_util.h
  23. feature_management_util_test.cc
  24. OWNERS
  25. README.md
libsegmentation/README.md

libsegmentation

C++ library to know if a software feature is enabled on a given device.

It is unrelated to featured. Although both returns if a given feature is enabled or not, featured uses the variations framework while libsegmentation uses a local store when enabled.

Design Documentation

See the design_doc and the application note.

Package dependency

legend
└── ► depends on

             chromeos-base/libsegmentation
                         │
                         ▼
             chromeos-base/feature-management-data
                  │      │                                  public-overlay
---------------------------------------------------------------------------
                                                            private-overlay
                  │      │
                  │      └── ► chromeos-base/feature-management-bsp
                  │
                  └── ► chromeos-base/feature-management-private

chromeos-base/feature-management-private provide the private features definitions for chromeos-base/feature-management-data, that build the database needed by libsegmentation in chromeos/feature-management-data/libsegmenation_pb.h. It also holds the protobuf that describes a feature.

chromeos-base/feature-management-bsp provide device selection override, if needed.

Usage

We can check manually if a feature is supported on the test image with

/usr/local/sbin/feature_explorer --feature_name=FeatureManagementNotSupported
0
/usr/local/sbin/feature_explorer --feature_name=FeatureManagementBasic
1

Adding a feature

Public features are added in features.star starlak file.