Info |
---|
This page is under review |
Why flag ?
- If the code changes has to be enabled only on certain scenarios or only applicable for specific boards , then we have to define the flag .
Defining a new flag
- The flag has to be defined in ccsp_common.inc file
- There are two ways to define the flag
1. Having the flag enabled always
2. Enabling only for specific board or on specific condition
Having the flag enabled always
- Go to ccsp_common.inc file
- Add the flag under "CFLAGS_append +="
Syntax
CFLAGS_append += " <FLAG> " |
---|
Sample
CFLAGS_append += " ......... -DRDKB_FEATURE "Image Added- By this method, the flag is always set to 1 always (true)
- Now add the flag at required pieces of code
Enabling only for specific board or on specific condition
...
- Add the flag using DISTRO_FEATURE in ccsp_common.inc file as below
Syntax
CFLAGS_append += " ${@bb.utils.contains('DISTRO_FEATURES', '<keyword>', '<FLAG>', '', d)}" |
---|
Sample
CFLAGS_append += " ${@bb.utils.contains('DISTRO_FEATURES', 'rdkb', '-DRDKB_FEATURE', '', d)}" |
---|
- Now the flag has to be added in the platform specific .Now to enable the flag for the specific platform , invoke from platform specific machine conf file
Syntax
DISTRO_FEATURES_append = " ........ <keyword> " |
---|
Sample
File : In Rpi,
In ccsp_common.inc
Image Added
In raspberrypi-rdk-broadband.conf
DISTRO_FEATURES_append = " ........ rdkb "
- With this method, the flag is set to 1 for the specific platform
Now add the flag at required pieces of codeImage Added
This enables RDK_REF_PLATFORM_ flag for rpi platform .
- the package enable/disable for the specific platform can be controlled
Image Added - installation of file based on feature availability
Image Added - Functionality of feature can be controlled
Image Added